diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AutoSDKHttpResponse.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..4f72a14 --- /dev/null +++ b/src/libs/ResembleAI/Generated/ResembleAI.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace ResembleAI +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetAccount.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetAccount.g.cs index 6f3257d..5e0d4ad 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetAccount.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetAccount.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageAccountClient global::System.Threading.Tasks.Task GetAccountAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get account
+ /// Get account information + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAccountAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetBillingUsage.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetBillingUsage.g.cs index a54bcd0..104130d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetBillingUsage.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetBillingUsage.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageAccountClient global::System.Threading.Tasks.Task GetBillingUsageAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get billing usage
+ /// Get billing and usage information + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetBillingUsageAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeam.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeam.g.cs index f11cedd..e09af39 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeam.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeam.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAccountClient global::System.Guid teamUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get team
+ /// Get specific team information + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTeamAsResponseAsync( + global::System.Guid teamUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeams.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeams.g.cs index 3d4630c..a0d6ac0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeams.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAccountClient.GetTeams.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageAccountClient global::System.Threading.Tasks.Task GetTeamsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get teams
+ /// Get team information + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTeamsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs index 83e4961..047347d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageAgentKnowledgeBaseClient /// Attaches an existing knowledge item to an agent /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachKnowledgeItemToAgentAsResponseAsync( + global::System.Guid agentUuid, + + global::ResembleAI.AttachKnowledgeItemToAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach knowledge item to agent
+ /// Attaches an existing knowledge item to an agent + ///
+ /// /// /// The UUID of the knowledge item to attach /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs index 6daa90a..e61680f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageAgentKnowledgeBaseClient /// Create knowledge item
/// Creates a new knowledge item and queues it for ingestion processing /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateKnowledgeItemAsResponseAsync( + + global::ResembleAI.CreateKnowledgeItemRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create knowledge item
+ /// Creates a new knowledge item and queues it for ingestion processing + ///
/// /// Title of the knowledge item /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs index 572456a..eccdac0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentKnowledgeBaseClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete knowledge item
+ /// Deletes a knowledge item and cleans up associated data + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteKnowledgeItemAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs index 896544f..9ae18fc 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageAgentKnowledgeBaseClient global::System.Guid knowledgeItemUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach knowledge item from agent
+ /// Removes a knowledge item from an agent + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachKnowledgeItemFromAgentAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid knowledgeItemUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs index 39c7b52..9b6e4c8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentKnowledgeBaseClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get knowledge item
+ /// Retrieves a single knowledge item with detailed information including attached agents + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetKnowledgeItemAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs index 521a6ee..bd295b3 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentKnowledgeBaseClient global::System.Guid agentUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent's knowledge items
+ /// Lists all knowledge items attached to a specific agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAgentKnowledgeItemsAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs index 64dc93c..38066a4 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs @@ -26,5 +26,27 @@ public partial interface ISubpackageAgentKnowledgeBaseClient int? perPage = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List knowledge items
+ /// List all knowledge items belonging to the authenticated user's team + ///
+ /// + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 20 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListKnowledgeItemsAsResponseAsync( + global::ResembleAI.KnowledgeItemsGetParametersStatus? status = default, + global::ResembleAI.KnowledgeItemsGetParametersSourceType? sourceType = default, + int? page = default, + int? perPage = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs index d25aa1e..590b2d7 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentKnowledgeBaseClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Re-ingest knowledge item
+ /// Re-runs the ingestion pipeline for an existing knowledge item + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReingestKnowledgeItemAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs index 64a4955..7c30383 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageAgentPhoneNumbersClient /// Create agent phone number
/// Create a new agent phone number /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreatePhoneNumberAsResponseAsync( + + global::ResembleAI.CreatePhoneNumberRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent phone number
+ /// Create a new agent phone number + ///
/// /// E.164 formatted phone number /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs index e85b81b..cdde93c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentPhoneNumbersClient int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent phone number
+ /// Delete an agent phone number + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeletePhoneNumberAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs index 1375a85..df3ff95 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentPhoneNumbersClient int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Force delete agent phone number
+ /// Force delete an agent phone number even if linked to agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ForceDeletePhoneNumberAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs index feedd52..49b4418 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentPhoneNumbersClient int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent phone number
+ /// Get agent phone number details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetPhoneNumberAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs index aff1433..fdc53c8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageAgentPhoneNumbersClient global::System.Threading.Tasks.Task ListPhoneNumbersAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent phone numbers
+ /// List all agent phone numbers + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListPhoneNumbersAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.CreateAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.CreateAgentTool.g.cs index 8b6970a..d02bf06 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.CreateAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.CreateAgentTool.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageAgentToolsClient /// Create a new tool for an agent /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentToolAsResponseAsync( + global::System.Guid agentUuid, + + global::ResembleAI.CreateAgentToolRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent tool
+ /// Create a new tool for an agent + ///
+ /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.DeleteAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.DeleteAgentTool.g.cs index 4a2e53b..7677c7b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.DeleteAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.DeleteAgentTool.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageAgentToolsClient global::System.Guid toolUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent tool
+ /// Delete a tool + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid toolUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.GetAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.GetAgentTool.g.cs index f6fb38c..8e6ef26 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.GetAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.GetAgentTool.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageAgentToolsClient global::System.Guid toolUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent tool
+ /// Get details of a specific tool + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid toolUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.ListAgentTools.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.ListAgentTools.g.cs index 7d5f53c..03e108f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.ListAgentTools.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.ListAgentTools.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentToolsClient global::System.Guid agentUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent tools
+ /// List all tools for an agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAgentToolsAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.UpdateAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.UpdateAgentTool.g.cs index 0e42da2..7af730a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.UpdateAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentToolsClient.UpdateAgentTool.g.cs @@ -27,6 +27,23 @@ public partial interface ISubpackageAgentToolsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid toolUuid, + + global::ResembleAI.UpdateAgentToolRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent tool
+ /// Update an existing tool + ///
+ /// + /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs index 8719b11..ffcb4b8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageAgentWebhooksClient /// Create a new webhook for an agent /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + + global::ResembleAI.CreateAgentWebhookRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent webhook
+ /// Create a new webhook for an agent + ///
+ /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs index b30548a..8cce382 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageAgentWebhooksClient global::System.Guid webhookUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent webhook
+ /// Delete a webhook + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid webhookUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.GetAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.GetAgentWebhook.g.cs index 46f925d..1d5e9f8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.GetAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.GetAgentWebhook.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageAgentWebhooksClient global::System.Guid webhookUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent webhook
+ /// Get details of a specific webhook + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid webhookUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs index 85b8285..262db8b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentWebhooksClient global::System.Guid agentUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agent webhooks
+ /// List all webhooks for an agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAgentWebhooksAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs index cee0fd7..5248bb4 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs @@ -27,6 +27,23 @@ public partial interface ISubpackageAgentWebhooksClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid webhookUuid, + + global::ResembleAI.UpdateAgentWebhookRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent webhook
+ /// Update an existing webhook + ///
+ /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.CreateAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.CreateAgent.g.cs index fc6602e..89f3b07 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.CreateAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.CreateAgent.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageAgentsClient /// Create agent
/// Create a new voice agent /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentAsResponseAsync( + + global::ResembleAI.CreateAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create agent
+ /// Create a new voice agent + ///
/// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DeleteAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DeleteAgent.g.cs index 923264a..823687b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DeleteAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DeleteAgent.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAgentsClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete agent
+ /// Delete an agent and all its configurations + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteAgentAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DispatchAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DispatchAgent.g.cs index 03f06c2..11f636e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DispatchAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.DispatchAgent.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageAgentsClient /// Make an outbound call with an agent /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DispatchAgentAsResponseAsync( + global::System.Guid uuid, + + global::ResembleAI.DispatchAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Dispatch agent
+ /// Make an outbound call with an agent + ///
+ /// /// /// Destination phone number /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgent.g.cs index a48721b..7b75130 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgent.g.cs @@ -20,5 +20,21 @@ public partial interface ISubpackageAgentsClient bool? advanced = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get agent
+ /// Retrieve a specific agent's details + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentAsResponseAsync( + global::System.Guid uuid, + bool? advanced = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgentCapabilities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgentCapabilities.g.cs index 71d8b7a..632a8b2 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgentCapabilities.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetAgentCapabilities.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageAgentsClient global::System.Threading.Tasks.Task GetAgentCapabilitiesAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get capabilities
+ /// List supported ASR and LLM providers and models + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAgentCapabilitiesAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetSystemTools.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetSystemTools.g.cs index 66ba118..b7d0569 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetSystemTools.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.GetSystemTools.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageAgentsClient global::System.Threading.Tasks.Task GetSystemToolsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get system tools
+ /// List available system tools + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSystemToolsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.ListAgents.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.ListAgents.g.cs index 8984a8d..1807c1b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.ListAgents.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.ListAgents.g.cs @@ -20,5 +20,21 @@ public partial interface ISubpackageAgentsClient bool? advanced = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List agents
+ /// Retrieve all agents for the authenticated team + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAgentsAsResponseAsync( + string? phoneNumber = default, + bool? advanced = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.UpdateAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.UpdateAgent.g.cs index c2de1d3..2bfd3d5 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.UpdateAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAgentsClient.UpdateAgent.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageAgentsClient /// Update an existing agent's configuration /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateAgentAsResponseAsync( + global::System.Guid uuid, + + global::ResembleAI.UpdateAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update agent
+ /// Update an existing agent's configuration + ///
+ /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.CreateAudioEdit.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.CreateAudioEdit.g.cs index 5d44e1a..aac4e91 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.CreateAudioEdit.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.CreateAudioEdit.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageAudioEditClient /// Create audio edit
/// Edit audio segments using voice synthesis /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAudioEditAsResponseAsync( + + global::ResembleAI.CreateAudioEditRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create audio edit
+ /// Edit audio segments using voice synthesis + ///
/// /// WAV, MP3, M4A, or WMA file (< 20 seconds) /// @@ -47,5 +60,66 @@ public partial interface ISubpackageAudioEditClient string voiceUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create audio edit
+ /// Edit audio segments using voice synthesis + ///
+ /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// Accurate transcript of the uploaded audio + /// + /// + /// Desired replacement text + /// + /// + /// Voice used to render the edited segment + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateAudioEditAsync( + global::System.IO.Stream inputAudio, + string inputAudioname, + string originalTranscript, + string targetTranscript, + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create audio edit
+ /// Edit audio segments using voice synthesis + ///
+ /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// Accurate transcript of the uploaded audio + /// + /// + /// Desired replacement text + /// + /// + /// Voice used to render the edited segment + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAudioEditAsResponseAsync( + global::System.IO.Stream inputAudio, + string inputAudioname, + string originalTranscript, + string targetTranscript, + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.GetAudioEdit.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.GetAudioEdit.g.cs index b1a1226..441dfbb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.GetAudioEdit.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.GetAudioEdit.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAudioEditClient string audioEditUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get audio edit
+ /// Get status and result of an audio edit + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAudioEditAsResponseAsync( + string audioEditUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.ListAudioEdits.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.ListAudioEdits.g.cs index 5dc1e44..a58df32 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.ListAudioEdits.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEditClient.ListAudioEdits.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageAudioEditClient int page, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List audio edits
+ /// Retrieve paginated list of audio edits + ///
+ /// + /// Default Value: 1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAudioEditsAsResponseAsync( + int page, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs index baccf5f..d452ab8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs @@ -23,6 +23,20 @@ public partial interface ISubpackageAudioEnhancementClient /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
/// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAudioEnhancementAsResponseAsync( + + global::ResembleAI.CreateAudioEnhancementRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create audio enhancement
+ /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
+ /// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. + ///
/// /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. /// @@ -71,5 +85,112 @@ public partial interface ISubpackageAudioEnhancementClient int? loudnessPeakLimit = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create audio enhancement
+ /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
+ /// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. + ///
+ /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Enhancement engine to use. Default is v2.
+ /// Default Value: v2 + /// + /// + /// Remove background noise. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Normalize audio levels. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Apply studio-quality enhancement. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Enhancement intensity (0.0 to 1.0). Engine v1 only (legacy). + /// + /// + /// Target loudness in LUFS. Engine v1 only (legacy).
+ /// Default Value: -14 + /// + /// + /// Peak limit in dBTP. Engine v1 only (legacy).
+ /// Default Value: -1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateAudioEnhancementAsync( + global::System.IO.Stream audioFile, + string audioFilename, + global::ResembleAI.AudioEnhancementsPostRequestBodyContentMultipartFormDataSchemaEnhancementEngine? enhancementEngine = default, + bool? removeNoise = default, + bool? normalize = default, + bool? studioSound = default, + double? enhancementLevel = default, + int? loudnessTargetLevel = default, + int? loudnessPeakLimit = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create audio enhancement
+ /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
+ /// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. + ///
+ /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Enhancement engine to use. Default is v2.
+ /// Default Value: v2 + /// + /// + /// Remove background noise. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Normalize audio levels. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Apply studio-quality enhancement. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Enhancement intensity (0.0 to 1.0). Engine v1 only (legacy). + /// + /// + /// Target loudness in LUFS. Engine v1 only (legacy).
+ /// Default Value: -14 + /// + /// + /// Peak limit in dBTP. Engine v1 only (legacy).
+ /// Default Value: -1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAudioEnhancementAsResponseAsync( + global::System.IO.Stream audioFile, + string audioFilename, + global::ResembleAI.AudioEnhancementsPostRequestBodyContentMultipartFormDataSchemaEnhancementEngine? enhancementEngine = default, + bool? removeNoise = default, + bool? normalize = default, + bool? studioSound = default, + double? enhancementLevel = default, + int? loudnessTargetLevel = default, + int? loudnessPeakLimit = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs index 37fe080..5212b13 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAudioEnhancementClient string enhancementUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get audio enhancement
+ /// Poll this endpoint to check the status of an enhancement job and retrieve the download URL when complete. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAudioEnhancementAsResponseAsync( + string enhancementUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs index 1423862..57deeb9 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs @@ -20,5 +20,21 @@ public partial interface ISubpackageAudioEnhancementClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List audio enhancements
+ /// Returns a paginated list of all audio enhancements for your team, ordered by most recent first. + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAudioEnhancementsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs index 4f25aa5..a7b32ad 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageAudioSourceTracingClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get audio source tracing
+ /// Retrieve a single source tracing report by its UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetAudioSourceTracingAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs index 5f7f240..9d71179 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs @@ -20,5 +20,21 @@ public partial interface ISubpackageAudioSourceTracingClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List audio source tracings
+ /// Retrieve a paginated list of all source tracing reports for the authenticated user's team + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAudioSourceTracingsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.DeleteClip.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.DeleteClip.g.cs index d9a8b64..127cfb4 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.DeleteClip.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.DeleteClip.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageClipsClient string clipUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete clip
+ /// Delete a clip + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteClipAsResponseAsync( + string projectUuid, + string clipUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.GetClip.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.GetClip.g.cs index 25ea066..d14919e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.GetClip.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.GetClip.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageClipsClient string clipUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get clip
+ /// Get clip details + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetClipAsResponseAsync( + string projectUuid, + string clipUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.ListClips.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.ListClips.g.cs index d9d7cbf..d3e87c6 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.ListClips.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.ListClips.g.cs @@ -24,5 +24,25 @@ public partial interface ISubpackageClipsClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List clips
+ /// List clips in a project + ///
+ /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListClipsAsResponseAsync( + string projectUuid, + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.UpdateClip.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.UpdateClip.g.cs index ea27e5f..926ddcf 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.UpdateClip.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageClipsClient.UpdateClip.g.cs @@ -27,6 +27,23 @@ public partial interface ISubpackageClipsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateClipAsResponseAsync( + string projectUuid, + string clipUuid, + + global::ResembleAI.UpdateClipRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update clip
+ /// Update a clip + ///
+ /// + /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs index f36a0d5..c80fe7d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageCustomPronunciationsClient /// Bulk create pronunciations from ZIP
/// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BulkCreatePronunciationsAsResponseAsync( + + global::ResembleAI.BulkCreatePronunciationsRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Bulk create pronunciations from ZIP
+ /// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. + ///
/// /// ZIP file containing audio files. Max 50 files, max 100MB total. /// @@ -35,5 +48,42 @@ public partial interface ISubpackageCustomPronunciationsClient string zipname, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Bulk create pronunciations from ZIP
+ /// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. + ///
+ /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BulkCreatePronunciationsAsync( + global::System.IO.Stream zip, + string zipname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Bulk create pronunciations from ZIP
+ /// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. + ///
+ /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BulkCreatePronunciationsAsResponseAsync( + global::System.IO.Stream zip, + string zipname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.CreatePronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.CreatePronunciation.g.cs index 983041f..7334c6c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.CreatePronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.CreatePronunciation.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageCustomPronunciationsClient /// Create custom pronunciation
/// Upload a single pronunciation with a reference audio file. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreatePronunciationAsResponseAsync( + + global::ResembleAI.CreatePronunciationRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create custom pronunciation
+ /// Upload a single pronunciation with a reference audio file. + ///
/// /// The word or phrase (2-100 characters). Letters, accented characters, apostrophes, hyphens, and spaces only. /// @@ -39,5 +52,50 @@ public partial interface ISubpackageCustomPronunciationsClient string audioname, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create custom pronunciation
+ /// Upload a single pronunciation with a reference audio file. + ///
+ /// + /// The word or phrase (2-100 characters). Letters, accented characters, apostrophes, hyphens, and spaces only. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreatePronunciationAsync( + string word, + global::System.IO.Stream audio, + string audioname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create custom pronunciation
+ /// Upload a single pronunciation with a reference audio file. + ///
+ /// + /// The word or phrase (2-100 characters). Letters, accented characters, apostrophes, hyphens, and spaces only. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreatePronunciationAsResponseAsync( + string word, + global::System.IO.Stream audio, + string audioname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.DeletePronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.DeletePronunciation.g.cs index a8e92d7..e60e7be 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.DeletePronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.DeletePronunciation.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageCustomPronunciationsClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete custom pronunciation
+ /// Permanently remove a custom pronunciation. Takes effect immediately. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeletePronunciationAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.GetPronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.GetPronunciation.g.cs index e6608a4..0e9f43d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.GetPronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.GetPronunciation.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageCustomPronunciationsClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get custom pronunciation
+ /// Retrieve a single custom pronunciation by UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetPronunciationAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.ListPronunciations.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.ListPronunciations.g.cs index 978df58..9fe8a63 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.ListPronunciations.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.ListPronunciations.g.cs @@ -22,5 +22,23 @@ public partial interface ISubpackageCustomPronunciationsClient bool? active = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List custom pronunciations
+ /// Retrieve all custom pronunciations for your team, with optional filters. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListPronunciationsAsResponseAsync( + string? language = default, + string? domain = default, + global::ResembleAI.PronunciationsGetParametersStatus? status = default, + bool? active = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs index 7a6a040..361b9b9 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageCustomPronunciationsClient /// Enable or disable a pronunciation without deleting it. Inactive pronunciations are not used during synthesis. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdatePronunciationAsResponseAsync( + global::System.Guid uuid, + + global::ResembleAI.UpdatePronunciationRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Toggle pronunciation active status
+ /// Enable or disable a pronunciation without deleting it. Inactive pronunciations are not used during synthesis. + ///
+ /// /// /// Set to false to disable, true to re-enable /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs index 4adf0f6..dbc51e3 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs @@ -51,6 +51,34 @@ public partial interface ISubpackageDeepfakeDetectionClient /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
/// for every file, the request is rejected with 402 and no detects are created. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDetectBatchAsResponseAsync( + + global::ResembleAI.CreateDetectBatchRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a batch deepfake detection job
+ /// Submit up to 50 files in a single request and process them as a single logical
+ /// group. Returns HTTP 202 with a batch UUID; each file is analyzed in the
+ /// background and individual results are available via `GET /detect/{uuid}` for
+ /// each entry in `detect_uuids`.
+ /// Two intake methods:
+ /// - **Multiple media files** — repeated `files[]` form fields.
+ /// - **Single zip archive** — a single `file` form field whose value is a `.zip`
+ /// containing the media files. Non-media entries are skipped.
+ /// Provide one of `files[]` or `file=<...>.zip` per request. Synchronous mode
+ /// (`Prefer: wait`) is not supported and returns 400 if sent.
+ /// Constraints:
+ /// - Maximum 50 files per batch.
+ /// - Maximum 500 MB total upload size across all files.
+ /// - Allowed file types match `POST /detect`'s direct-upload allowlist.
+ /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
+ /// for every file, the request is rejected with 402 and no detects are created. + ///
/// /// One or more media files. Repeat the `files[]` field for each file. Mutually exclusive with `file`. /// @@ -118,5 +146,186 @@ public partial interface ISubpackageDeepfakeDetectionClient bool? zeroRetentionMode = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create a batch deepfake detection job
+ /// Submit up to 50 files in a single request and process them as a single logical
+ /// group. Returns HTTP 202 with a batch UUID; each file is analyzed in the
+ /// background and individual results are available via `GET /detect/{uuid}` for
+ /// each entry in `detect_uuids`.
+ /// Two intake methods:
+ /// - **Multiple media files** — repeated `files[]` form fields.
+ /// - **Single zip archive** — a single `file` form field whose value is a `.zip`
+ /// containing the media files. Non-media entries are skipped.
+ /// Provide one of `files[]` or `file=<...>.zip` per request. Synchronous mode
+ /// (`Prefer: wait`) is not supported and returns 400 if sent.
+ /// Constraints:
+ /// - Maximum 50 files per batch.
+ /// - Maximum 500 MB total upload size across all files.
+ /// - Allowed file types match `POST /detect`'s direct-upload allowlist.
+ /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
+ /// for every file, the request is rejected with 402 and no detects are created. + ///
+ /// + /// One or more media files. Repeat the `files[]` field for each file. Mutually exclusive with `file`. + /// + /// + /// Optional file names to use for the multipart 'files[]' file parts. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// POST destination invoked when the batch reaches a terminal state. + /// + /// + /// Run multimodal intelligence on every file in the batch.
+ /// Default Value: false + /// + /// + /// Run identity search against the team's saved identities (audio/video only).
+ /// Default Value: false + /// + /// + /// Generate visualization artifacts.
+ /// Default Value: true + /// + /// + /// Enable audio source tracing on each audio file.
+ /// Default Value: false + /// + /// + /// Window size in seconds (audio/video). + /// + /// + /// Start of segment to analyze (seconds). + /// + /// + /// End of segment to analyze (seconds). + /// + /// + /// Cap processed video duration. + /// + /// + /// Use LLM-assisted video analysis. + /// + /// + /// Enable Zero Retention Mode for every file in the batch.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateDetectBatchAsync( + global::System.Collections.Generic.IReadOnlyList? files = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::System.IO.Stream? file = default, + string? filename = default, + string? callbackUrl = default, + bool? intelligence = default, + bool? searchIdentity = default, + bool? visualize = default, + bool? audioSourceTracingEnabled = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + bool? useLlm = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a batch deepfake detection job
+ /// Submit up to 50 files in a single request and process them as a single logical
+ /// group. Returns HTTP 202 with a batch UUID; each file is analyzed in the
+ /// background and individual results are available via `GET /detect/{uuid}` for
+ /// each entry in `detect_uuids`.
+ /// Two intake methods:
+ /// - **Multiple media files** — repeated `files[]` form fields.
+ /// - **Single zip archive** — a single `file` form field whose value is a `.zip`
+ /// containing the media files. Non-media entries are skipped.
+ /// Provide one of `files[]` or `file=<...>.zip` per request. Synchronous mode
+ /// (`Prefer: wait`) is not supported and returns 400 if sent.
+ /// Constraints:
+ /// - Maximum 50 files per batch.
+ /// - Maximum 500 MB total upload size across all files.
+ /// - Allowed file types match `POST /detect`'s direct-upload allowlist.
+ /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
+ /// for every file, the request is rejected with 402 and no detects are created. + ///
+ /// + /// One or more media files. Repeat the `files[]` field for each file. Mutually exclusive with `file`. + /// + /// + /// Optional file names to use for the multipart 'files[]' file parts. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// POST destination invoked when the batch reaches a terminal state. + /// + /// + /// Run multimodal intelligence on every file in the batch.
+ /// Default Value: false + /// + /// + /// Run identity search against the team's saved identities (audio/video only).
+ /// Default Value: false + /// + /// + /// Generate visualization artifacts.
+ /// Default Value: true + /// + /// + /// Enable audio source tracing on each audio file.
+ /// Default Value: false + /// + /// + /// Window size in seconds (audio/video). + /// + /// + /// Start of segment to analyze (seconds). + /// + /// + /// End of segment to analyze (seconds). + /// + /// + /// Cap processed video duration. + /// + /// + /// Use LLM-assisted video analysis. + /// + /// + /// Enable Zero Retention Mode for every file in the batch.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDetectBatchAsResponseAsync( + global::System.Collections.Generic.IReadOnlyList? files = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::System.IO.Stream? file = default, + string? filename = default, + string? callbackUrl = default, + bool? intelligence = default, + bool? searchIdentity = default, + bool? visualize = default, + bool? audioSourceTracingEnabled = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + bool? useLlm = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetection.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetection.g.cs index a862deb..94fcb55 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetection.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.CreateDetection.g.cs @@ -31,6 +31,24 @@ public partial interface ISubpackageDeepfakeDetectionClient /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
/// Exactly one of `file`, `url`, or `media_token` must be provided per request. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDetectionAsResponseAsync( + + global::ResembleAI.CreateDetectionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create deepfake detection
+ /// Analyze audio, image, and video for deepfake detection.
+ /// Supply media via one of three intake methods:
+ /// - **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
+ /// - **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
+ /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
+ /// Exactly one of `file`, `url`, or `media_token` must be provided per request. + ///
/// /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. /// @@ -99,5 +117,160 @@ public partial interface ISubpackageDeepfakeDetectionClient bool? zeroRetentionMode = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create deepfake detection
+ /// Analyze audio, image, and video for deepfake detection.
+ /// Supply media via one of three intake methods:
+ /// - **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
+ /// - **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
+ /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
+ /// Exactly one of `file`, `url`, or `media_token` must be provided per request. + ///
+ /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// POST destination when analysis completes + /// + /// + /// Generate visualization artifacts + /// + /// + /// Window size in seconds (audio/video)
+ /// Default Value: 2 + /// + /// + /// Start of segment to analyze (seconds) + /// + /// + /// End of segment to analyze (seconds) + /// + /// + /// Cap processed duration + /// + /// + /// Use talking_head for face-swaps + /// + /// + /// Run multimodal intelligence analysis on the media
+ /// Default Value: false + /// + /// + /// Enable audio source tracing to identify synthetic audio origin
+ /// Default Value: false + /// + /// + /// Enable reverse image search to improve detection accuracy for image files. Only applies to image detections.
+ /// Default Value: false + /// + /// + /// Enable out-of-distribution detection
+ /// Default Value: false + /// + /// + /// Enable Zero Retention Mode to automatically delete submitted media after detection completes.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateDetectionAsync( + global::System.IO.Stream file, + string filename, + string? callbackUrl = default, + bool? visualize = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + global::ResembleAI.DetectPostRequestBodyContentMultipartFormDataSchemaModelTypes? modelTypes = default, + bool? intelligence = default, + bool? audioSourceTracing = default, + bool? useReverseSearch = default, + bool? useOodDetector = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create deepfake detection
+ /// Analyze audio, image, and video for deepfake detection.
+ /// Supply media via one of three intake methods:
+ /// - **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
+ /// - **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
+ /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
+ /// Exactly one of `file`, `url`, or `media_token` must be provided per request. + ///
+ /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// POST destination when analysis completes + /// + /// + /// Generate visualization artifacts + /// + /// + /// Window size in seconds (audio/video)
+ /// Default Value: 2 + /// + /// + /// Start of segment to analyze (seconds) + /// + /// + /// End of segment to analyze (seconds) + /// + /// + /// Cap processed duration + /// + /// + /// Use talking_head for face-swaps + /// + /// + /// Run multimodal intelligence analysis on the media
+ /// Default Value: false + /// + /// + /// Enable audio source tracing to identify synthetic audio origin
+ /// Default Value: false + /// + /// + /// Enable reverse image search to improve detection accuracy for image files. Only applies to image detections.
+ /// Default Value: false + /// + /// + /// Enable out-of-distribution detection
+ /// Default Value: false + /// + /// + /// Enable Zero Retention Mode to automatically delete submitted media after detection completes.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDetectionAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? callbackUrl = default, + bool? visualize = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + global::ResembleAI.DetectPostRequestBodyContentMultipartFormDataSchemaModelTypes? modelTypes = default, + bool? intelligence = default, + bool? audioSourceTracing = default, + bool? useReverseSearch = default, + bool? useOodDetector = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs index ff9a28b..2061031 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs @@ -19,5 +19,20 @@ public partial interface ISubpackageDeepfakeDetectionClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get batch status
+ /// Retrieve the latest aggregate status for a batch. The response shape mirrors
+ /// the create response — `status`, `completed_count`, and `failed_count` update
+ /// as child detects progress. Use the `detect_uuids` array to fetch per-file
+ /// results via `GET /detect/{uuid}`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDetectBatchAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetection.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetection.g.cs index bc6ce8c..701204c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetection.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.GetDetection.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageDeepfakeDetectionClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get deepfake detection result
+ /// Get deepfake detection result by UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDetectionAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.ListDetections.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.ListDetections.g.cs index 00e3208..a791719 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.ListDetections.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDeepfakeDetectionClient.ListDetections.g.cs @@ -20,5 +20,21 @@ public partial interface ISubpackageDeepfakeDetectionClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all detects
+ /// Retrieve a paginated list of all detect objects for the authenticated user's team + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListDetectionsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs index 3cb1454..b842a55 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageDetectIntelligenceClient /// Submit a natural-language question about a completed detection report. Returns 202 Accepted while the answer is generated in the background. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AskDetectIntelligenceQuestionAsResponseAsync( + string uuid, + + global::ResembleAI.AskDetectIntelligenceQuestionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ask a question about a detection
+ /// Submit a natural-language question about a completed detection report. Returns 202 Accepted while the answer is generated in the background. + ///
+ /// /// /// The natural-language question to ask about the detection /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs index 9dce555..38434df 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageDetectIntelligenceClient string questionUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get answer to a detection question
+ /// Retrieve the status and answer for a previously submitted question. Poll until status is completed or failed. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDetectIntelligenceQuestionAsResponseAsync( + string uuid, + string questionUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoice.g.cs index edf0072..54708f2 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoice.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageDuetsClient /// Create custom duet voice
/// Create a custom voice for duet generation /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDuetVoiceAsResponseAsync( + + global::ResembleAI.CreateDuetVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create custom duet voice
+ /// Create a custom voice for duet generation + ///
/// /// Voice name /// @@ -43,5 +56,58 @@ public partial interface ISubpackageDuetsClient string? stylePrompt = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create custom duet voice
+ /// Create a custom voice for duet generation + ///
+ /// + /// Voice name + /// + /// + /// Optional style prompt + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateDuetVoiceAsync( + string name, + global::System.IO.Stream audio, + string audioname, + string? stylePrompt = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create custom duet voice
+ /// Create a custom voice for duet generation + ///
+ /// + /// Voice name + /// + /// + /// Optional style prompt + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDuetVoiceAsResponseAsync( + string name, + global::System.IO.Stream audio, + string audioname, + string? stylePrompt = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoicePair.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoicePair.g.cs index dde16d2..7297799 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoicePair.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.CreateDuetVoicePair.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageDuetsClient /// Create duet voice pair
/// Create a voice pair for duet generation /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateDuetVoicePairAsResponseAsync( + + global::ResembleAI.CreateDuetVoicePairRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create duet voice pair
+ /// Create a voice pair for duet generation + ///
/// /// ID of first voice /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.DeleteDuetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.DeleteDuetVoice.g.cs index 355c25a..647a9ff 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.DeleteDuetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.DeleteDuetVoice.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageDuetsClient int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete duet voice
+ /// Delete a custom duet voice (default voices cannot be deleted) + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteDuetVoiceAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.GenerateDuet.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.GenerateDuet.g.cs index 1406aa0..f7a9860 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.GenerateDuet.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.GenerateDuet.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageDuetsClient /// Generate duet
/// Generate conversational audio with two speakers /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerateDuetAsResponseAsync( + + global::ResembleAI.GenerateDuetRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate duet
+ /// Generate conversational audio with two speakers + ///
/// /// Voice pair ID to use /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoicePairs.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoicePairs.g.cs index 8c92bcc..d1f435f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoicePairs.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoicePairs.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageDuetsClient global::System.Threading.Tasks.Task ListDuetVoicePairsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List duet voice pairs
+ /// List all voice pairs for duet generation + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListDuetVoicePairsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoices.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoices.g.cs index 6112541..238f4c7 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoices.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.ListDuetVoices.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageDuetsClient global::System.Threading.Tasks.Task ListDuetVoicesAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List duet voices
+ /// Returns default and custom duet voices + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListDuetVoicesAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.UpdateDuetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.UpdateDuetVoice.g.cs index 09c34ae..7e15d6b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.UpdateDuetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageDuetsClient.UpdateDuetVoice.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageDuetsClient /// Update a custom duet voice (default voices cannot be modified) /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateDuetVoiceAsResponseAsync( + int id, + + global::ResembleAI.UpdateDuetVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update duet voice
+ /// Update a custom duet voice (default voices cannot be modified) + ///
+ /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.CreateIdentity.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.CreateIdentity.g.cs index 963a68e..1288811 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.CreateIdentity.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.CreateIdentity.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageIdentityClient /// Create identity
/// Create a new speaker identity /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateIdentityAsResponseAsync( + + global::ResembleAI.CreateIdentityRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create identity
+ /// Create a new speaker identity + ///
/// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.ListIdentities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.ListIdentities.g.cs index f8f5cb1..159f888 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.ListIdentities.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.ListIdentities.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageIdentityClient global::System.Threading.Tasks.Task ListIdentitiesAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List identities
+ /// List all speaker identities + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListIdentitiesAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.SearchIdentities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.SearchIdentities.g.cs index f82a123..eeb7de8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.SearchIdentities.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIdentityClient.SearchIdentities.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageIdentityClient /// Search identities
/// Search for matching speaker identities /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SearchIdentitiesAsResponseAsync( + + global::ResembleAI.SearchIdentitiesRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search identities
+ /// Search for matching speaker identities + ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.GetIntelligence.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.GetIntelligence.g.cs index f851ae2..99e6f6c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.GetIntelligence.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.GetIntelligence.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageIntelligenceClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get intelligence
+ /// Retrieve a single intelligence report by its UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetIntelligenceAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.ListIntelligences.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.ListIntelligences.g.cs index 2e0d6e1..fdc6eb1 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.ListIntelligences.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.ListIntelligences.g.cs @@ -20,5 +20,21 @@ public partial interface ISubpackageIntelligenceClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List intelligences
+ /// Retrieve a paginated list of all intelligence reports for the authenticated user's team + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListIntelligencesAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.RunIntelligence.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.RunIntelligence.g.cs index f5b98f2..e922dbb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.RunIntelligence.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageIntelligenceClient.RunIntelligence.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageIntelligenceClient /// Run intelligence
/// Analyze audio, image, or video for comprehensive insights. Optionally reference an existing detect to associate. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunIntelligenceAsResponseAsync( + + global::ResembleAI.RunIntelligenceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run intelligence
+ /// Analyze audio, image, or video for comprehensive insights. Optionally reference an existing detect to associate. + ///
/// /// Token for uploaded media file (from secure upload) /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.CreateProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.CreateProject.g.cs index 9aca885..ee263d8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.CreateProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.CreateProject.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageProjectsClient /// Create project
/// Create a new project /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateProjectAsResponseAsync( + + global::ResembleAI.CreateProjectRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create project
+ /// Create a new project + ///
/// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.DeleteProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.DeleteProject.g.cs index 520995e..34771ee 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.DeleteProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.DeleteProject.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageProjectsClient string projectUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete project
+ /// Delete a project + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteProjectAsResponseAsync( + string projectUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.GetProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.GetProject.g.cs index 04b84e1..8320025 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.GetProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.GetProject.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageProjectsClient string projectUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get project
+ /// Get project details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetProjectAsResponseAsync( + string projectUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.ListProjects.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.ListProjects.g.cs index 3cd4a3e..d5891f3 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.ListProjects.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.ListProjects.g.cs @@ -22,5 +22,23 @@ public partial interface ISubpackageProjectsClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List projects
+ /// List all projects + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListProjectsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.UpdateProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.UpdateProject.g.cs index 7a97560..d0178d2 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.UpdateProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageProjectsClient.UpdateProject.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageProjectsClient /// Update a project /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateProjectAsResponseAsync( + string projectUuid, + + global::ResembleAI.UpdateProjectRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update project
+ /// Update a project + ///
+ /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.CreateRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.CreateRecording.g.cs index 33539b8..b71d084 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.CreateRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.CreateRecording.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageRecordingsClient /// Upload a new recording for voice training /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateRecordingAsResponseAsync( + string voiceUuid, + + global::ResembleAI.CreateRecordingRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create recording
+ /// Upload a new recording for voice training + ///
+ /// /// /// Audio file (WAV recommended, 1-12 seconds) /// @@ -59,5 +74,86 @@ public partial interface ISubpackageRecordingsClient bool? fill = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create recording
+ /// Upload a new recording for voice training + ///
+ /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Display name + /// + /// + /// Transcript of the clip + /// + /// + /// Emotion label + /// + /// + /// Include in training + /// + /// + /// Include for Resemble Fill + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateRecordingAsync( + string voiceUuid, + global::System.IO.Stream file, + string filename, + string name, + string text, + string emotion, + bool isActive, + bool? fill = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create recording
+ /// Upload a new recording for voice training + ///
+ /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Display name + /// + /// + /// Transcript of the clip + /// + /// + /// Emotion label + /// + /// + /// Include in training + /// + /// + /// Include for Resemble Fill + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateRecordingAsResponseAsync( + string voiceUuid, + global::System.IO.Stream file, + string filename, + string name, + string text, + string emotion, + bool isActive, + bool? fill = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.DeleteRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.DeleteRecording.g.cs index ad73193..0695d6e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.DeleteRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.DeleteRecording.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageRecordingsClient string recordingId, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete recording
+ /// Delete a recording + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteRecordingAsResponseAsync( + string voiceUuid, + string recordingId, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.GetRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.GetRecording.g.cs index 8bbe76b..6ca1f57 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.GetRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.GetRecording.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageRecordingsClient string recordingId, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get recording
+ /// Get recording details + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetRecordingAsResponseAsync( + string voiceUuid, + string recordingId, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.ListRecordings.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.ListRecordings.g.cs index 511b5ee..af95d35 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.ListRecordings.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.ListRecordings.g.cs @@ -24,5 +24,25 @@ public partial interface ISubpackageRecordingsClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List recordings
+ /// List all recordings for a voice + ///
+ /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListRecordingsAsResponseAsync( + string voiceUuid, + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.UpdateRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.UpdateRecording.g.cs index 0e94156..67771f5 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.UpdateRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageRecordingsClient.UpdateRecording.g.cs @@ -27,6 +27,23 @@ public partial interface ISubpackageRecordingsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateRecordingAsResponseAsync( + string voiceUuid, + string recordingId, + + global::ResembleAI.UpdateRecordingRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update recording
+ /// Update a recording + ///
+ /// + /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSecureUploadsClient.CreateSecureUpload.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSecureUploadsClient.CreateSecureUpload.g.cs index 130539c..1428164 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSecureUploadsClient.CreateSecureUpload.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSecureUploadsClient.CreateSecureUpload.g.cs @@ -31,6 +31,24 @@ public partial interface ISubpackageSecureUploadsClient /// means you do not need to host files yourself for jobs that only need the API
/// to read them once. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateSecureUploadAsResponseAsync( + + global::ResembleAI.CreateSecureUploadRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload media securely
+ /// Upload a media file and receive a short-lived token that can be passed to
+ /// downstream endpoints (such as `/detect` and `/intelligence`) in place of a
+ /// public URL. The returned token is a JWT that expires 1 hour after issuance.
+ /// Keeping uploads private avoids exposing source media on the open internet and
+ /// means you do not need to host files yourself for jobs that only need the API
+ /// to read them once. + ///
/// /// The media file to upload (audio, image, or video). /// @@ -45,5 +63,52 @@ public partial interface ISubpackageSecureUploadsClient string filename, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload media securely
+ /// Upload a media file and receive a short-lived token that can be passed to
+ /// downstream endpoints (such as `/detect` and `/intelligence`) in place of a
+ /// public URL. The returned token is a JWT that expires 1 hour after issuance.
+ /// Keeping uploads private avoids exposing source media on the open internet and
+ /// means you do not need to host files yourself for jobs that only need the API
+ /// to read them once. + ///
+ /// + /// The media file to upload (audio, image, or video). + /// + /// + /// The media file to upload (audio, image, or video). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateSecureUploadAsync( + global::System.IO.Stream file, + string filename, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload media securely
+ /// Upload a media file and receive a short-lived token that can be passed to
+ /// downstream endpoints (such as `/detect` and `/intelligence`) in place of a
+ /// public URL. The returned token is a JWT that expires 1 hour after issuance.
+ /// Keeping uploads private avoids exposing source media on the open internet and
+ /// means you do not need to host files yourself for jobs that only need the API
+ /// to read them once. + ///
+ /// + /// The media file to upload (audio, image, or video). + /// + /// + /// The media file to upload (audio, image, or video). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateSecureUploadAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs index 74f14ba..aaa60a1 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageSpeechToTextClient /// Submit a question about a completed transcript /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AskTranscriptQuestionAsResponseAsync( + global::System.Guid uuid, + + global::ResembleAI.AskTranscriptQuestionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Ask intelligence question
+ /// Submit a question about a completed transcript + ///
+ /// /// /// Question to ask about the transcript /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.CreateTranscript.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.CreateTranscript.g.cs index 19c3d74..6c3809c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.CreateTranscript.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.CreateTranscript.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageSpeechToTextClient /// Create transcript job
/// Submit audio or video for transcription /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateTranscriptAsResponseAsync( + + global::ResembleAI.CreateTranscriptRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create transcript job
+ /// Submit audio or video for transcription + ///
/// /// Audio or video file (max 500 MB, 20 minutes) /// @@ -39,5 +52,50 @@ public partial interface ISubpackageSpeechToTextClient string? query = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create transcript job
+ /// Submit audio or video for transcription + ///
+ /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Optional intelligence question to evaluate after transcription + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateTranscriptAsync( + global::System.IO.Stream? file = default, + string? filename = default, + string? query = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create transcript job
+ /// Submit audio or video for transcription + ///
+ /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Optional intelligence question to evaluate after transcription + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateTranscriptAsResponseAsync( + global::System.IO.Stream? file = default, + string? filename = default, + string? query = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscript.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscript.g.cs index 4ee239b..3f4b2f5 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscript.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscript.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageSpeechToTextClient global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get transcript
+ /// Retrieve transcript status, text, and timestamps + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTranscriptAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs index 1946024..c60e831 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs @@ -18,5 +18,19 @@ public partial interface ISubpackageSpeechToTextClient global::System.Guid questionUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get intelligence question status
+ /// Check the status of a specific question + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTranscriptQuestionAsResponseAsync( + global::System.Guid uuid, + global::System.Guid questionUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs index e38b370..e3b0845 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs @@ -24,5 +24,25 @@ public partial interface ISubpackageSpeechToTextClient int? perPage = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List intelligence questions
+ /// List all questions asked about a transcript + ///
+ /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 25 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTranscriptQuestionsAsResponseAsync( + global::System.Guid uuid, + int page, + int? perPage = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscripts.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscripts.g.cs index cd70f10..8a3f532 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscripts.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageSpeechToTextClient.ListTranscripts.g.cs @@ -22,5 +22,23 @@ public partial interface ISubpackageSpeechToTextClient int? perPage = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List transcripts
+ /// Retrieve paginated list of transcript jobs + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 25 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTranscriptsAsResponseAsync( + int page, + int? perPage = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs index 061075e..3ba2997 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageTermSubstitutionsClient /// Create term substitution
/// Create a new pronunciation substitution /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateTermSubstitutionAsResponseAsync( + + global::ResembleAI.CreateTermSubstitutionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create term substitution
+ /// Create a new pronunciation substitution + ///
/// /// Original text to substitute /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs index 4c71266..399e6d3 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageTermSubstitutionsClient int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete term substitution
+ /// Delete a term substitution + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteTermSubstitutionAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs index b56a3db..6536ef5 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageTermSubstitutionsClient int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get term substitution
+ /// Get term substitution details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTermSubstitutionAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs index 8b6bd26..a0696b1 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs @@ -22,5 +22,23 @@ public partial interface ISubpackageTermSubstitutionsClient int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List term substitutions
+ /// List all term substitutions + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTermSubstitutionsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.StreamSynthesize.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.StreamSynthesize.g.cs index 4fa838a..4f53e45 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.StreamSynthesize.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.StreamSynthesize.g.cs @@ -21,6 +21,32 @@ public partial interface ISubpackageTextToSpeechClient /// Streaming text-to-speech synthesis (HTTP)
/// Stream audio as it's generated. Returns chunked WAV data for progressive playback. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task StreamSynthesizeAsStreamAsync( + + global::ResembleAI.StreamSynthesizeRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Streaming text-to-speech synthesis (HTTP)
+ /// Stream audio as it's generated. Returns chunked WAV data for progressive playback. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StreamSynthesizeAsResponseAsync( + + global::ResembleAI.StreamSynthesizeRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Streaming text-to-speech synthesis (HTTP)
+ /// Stream audio as it's generated. Returns chunked WAV data for progressive playback. + ///
/// /// Voice UUID to use for synthesis /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.Synthesize.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.Synthesize.g.cs index aae3517..b898d97 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.Synthesize.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageTextToSpeechClient.Synthesize.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageTextToSpeechClient /// Synchronous text-to-speech synthesis
/// Generate speech synchronously from text or SSML. Returns complete audio as base64. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SynthesizeAsResponseAsync( + + global::ResembleAI.SynthesizeRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Synchronous text-to-speech synthesis
+ /// Generate speech synchronously from text or SSML. Returns complete audio as base64. + ///
/// /// Voice UUID to use for synthesis /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs index 388bf07..b62e531 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageVoiceDesignClient /// Create voice from candidate
/// Create a voice from a voice design candidate /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateVoiceFromCandidateAsResponseAsync( + + global::ResembleAI.CreateVoiceFromCandidateRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create voice from candidate
+ /// Create a voice from a voice design candidate + ///
/// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs index bf796a8..670f2a6 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageVoiceDesignClient /// Generate voice candidates
/// Generate three voice candidates from a text prompt /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerateVoiceDesignAsResponseAsync( + + global::ResembleAI.GenerateVoiceDesignRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate voice candidates
+ /// Generate three voice candidates from a text prompt + ///
/// /// Description of desired voice /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs index 2882202..3993181 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageVoiceSettingsPresetsClient /// Create voice settings preset
/// Create a new voice settings preset (max 5 per user) /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateVoiceSettingsPresetAsResponseAsync( + + global::ResembleAI.CreateVoiceSettingsPresetRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create voice settings preset
+ /// Create a new voice settings preset (max 5 per user) + ///
/// /// Preset name (unique, max 30 characters) /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs index ac2ac19..4cf9e79 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageVoiceSettingsPresetsClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete voice settings preset
+ /// Delete a preset + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteVoiceSettingsPresetAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs index 86775a2..aba5afb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageVoiceSettingsPresetsClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get voice settings preset
+ /// Get preset details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVoiceSettingsPresetAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs index 3666f1b..9a0cd8e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs @@ -14,5 +14,15 @@ public partial interface ISubpackageVoiceSettingsPresetsClient global::System.Threading.Tasks.Task ListVoiceSettingsPresetsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List voice settings presets
+ /// List all voice settings presets + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListVoiceSettingsPresetsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs index 9ef809a..1335016 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageVoiceSettingsPresetsClient /// Update a preset /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateVoiceSettingsPresetAsResponseAsync( + string uuid, + + global::ResembleAI.UpdateVoiceSettingsPresetRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update voice settings preset
+ /// Update a preset + ///
+ /// /// /// /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.BuildVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.BuildVoice.g.cs index 50249fe..f492e68 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.BuildVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.BuildVoice.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageVoicesClient /// Start voice training /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BuildVoiceAsResponseAsync( + string voiceUuid, + + global::ResembleAI.BuildVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Build voice
+ /// Start voice training + ///
+ /// /// /// Default Value: false /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.CreateVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.CreateVoice.g.cs index 6ae1a10..e92da13 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.CreateVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.CreateVoice.g.cs @@ -21,6 +21,19 @@ public partial interface ISubpackageVoicesClient /// Create voice
/// Create a new voice /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateVoiceAsResponseAsync( + + global::ResembleAI.CreateVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create voice
+ /// Create a new voice + ///
/// /// /// Default Value: professional diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.DeleteVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.DeleteVoice.g.cs index 222d2ce..c71d9fd 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.DeleteVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.DeleteVoice.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageVoicesClient string voiceUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete voice
+ /// Delete a voice + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteVoiceAsResponseAsync( + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.GetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.GetVoice.g.cs index 9494e11..a408c9e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.GetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.GetVoice.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageVoicesClient string voiceUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get voice
+ /// Get voice details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVoiceAsResponseAsync( + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.ListVoices.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.ListVoices.g.cs index 7c327ec..19b6ea7 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.ListVoices.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageVoicesClient.ListVoices.g.cs @@ -26,5 +26,27 @@ public partial interface ISubpackageVoicesClient bool? advanced = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List voices
+ /// Retrieve voice metadata + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListVoicesAsResponseAsync( + int page, + int? pageSize = default, + bool? advanced = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.ApplyWatermark.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.ApplyWatermark.g.cs index c29e7c7..71e10d0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.ApplyWatermark.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.ApplyWatermark.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageWatermarkClient /// Apply a watermark to an audio, image, or video file. The media type is automatically detected from the file content. Use the `Prefer: wait` header for synchronous processing. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ApplyWatermarkAsResponseAsync( + + global::ResembleAI.ApplyWatermarkRequest request, + global::ResembleAI.WatermarkApplyPostParametersPrefer? prefer = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Apply watermark
+ /// Apply a watermark to an audio, image, or video file. The media type is automatically detected from the file content. Use the `Prefer: wait` header for synchronous processing. + ///
+ /// /// /// HTTPS URL to the media file (audio, image, or video). /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.DetectWatermark.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.DetectWatermark.g.cs index 3556009..771a9a2 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.DetectWatermark.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.DetectWatermark.g.cs @@ -24,6 +24,21 @@ public partial interface ISubpackageWatermarkClient /// Detect a watermark in an audio, image, or video file. The media type is automatically detected from the file content. Use the `Prefer: wait` header for synchronous processing. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetectWatermarkAsResponseAsync( + + global::ResembleAI.DetectWatermarkRequest request, + global::ResembleAI.WatermarkDetectPostParametersPrefer? prefer = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detect watermark
+ /// Detect a watermark in an audio, image, or video file. The media type is automatically detected from the file content. Use the `Prefer: wait` header for synchronous processing. + ///
+ /// /// /// HTTPS URL to the media file (audio, image, or video). /// diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkApplyResult.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkApplyResult.g.cs index e13ffad..f21423c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkApplyResult.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkApplyResult.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageWatermarkClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get watermark apply result
+ /// Retrieve the result of a watermark apply job. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWatermarkApplyResultAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs index f7d06e8..8b9831f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ISubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs @@ -16,5 +16,17 @@ public partial interface ISubpackageWatermarkClient string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get watermark detection result
+ /// Retrieve the result of a watermark detection. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWatermarkDetectionResultAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.OptionsSupport.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.OptionsSupport.g.cs index 45a5445..0688739 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.OptionsSupport.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::ResembleAI.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::ResembleAI.AutoSDKClientOptions clientOptions, global::ResembleAI.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::ResembleAI.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::ResembleAI.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ResembleAIClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ResembleAIClient.g.cs index c1e630f..0e26e33 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.ResembleAIClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.ResembleAIClient.g.cs @@ -45,7 +45,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAccountClient SubpackageAccount => new SubpackageAccountClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAccountClient SubpackageAccount => new SubpackageAccountClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -55,7 +55,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAgentKnowledgeBaseClient SubpackageAgentKnowledgeBase => new SubpackageAgentKnowledgeBaseClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAgentKnowledgeBaseClient SubpackageAgentKnowledgeBase => new SubpackageAgentKnowledgeBaseClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -65,7 +65,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAgentPhoneNumbersClient SubpackageAgentPhoneNumbers => new SubpackageAgentPhoneNumbersClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAgentPhoneNumbersClient SubpackageAgentPhoneNumbers => new SubpackageAgentPhoneNumbersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -75,7 +75,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAgentToolsClient SubpackageAgentTools => new SubpackageAgentToolsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAgentToolsClient SubpackageAgentTools => new SubpackageAgentToolsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -85,7 +85,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAgentWebhooksClient SubpackageAgentWebhooks => new SubpackageAgentWebhooksClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAgentWebhooksClient SubpackageAgentWebhooks => new SubpackageAgentWebhooksClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -95,7 +95,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAgentsClient SubpackageAgents => new SubpackageAgentsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAgentsClient SubpackageAgents => new SubpackageAgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -105,7 +105,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAudioEditClient SubpackageAudioEdit => new SubpackageAudioEditClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAudioEditClient SubpackageAudioEdit => new SubpackageAudioEditClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -115,7 +115,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAudioEnhancementClient SubpackageAudioEnhancement => new SubpackageAudioEnhancementClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAudioEnhancementClient SubpackageAudioEnhancement => new SubpackageAudioEnhancementClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -125,7 +125,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageAudioSourceTracingClient SubpackageAudioSourceTracing => new SubpackageAudioSourceTracingClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageAudioSourceTracingClient SubpackageAudioSourceTracing => new SubpackageAudioSourceTracingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -135,7 +135,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageClipsClient SubpackageClips => new SubpackageClipsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageClipsClient SubpackageClips => new SubpackageClipsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -145,7 +145,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageCustomPronunciationsClient SubpackageCustomPronunciations => new SubpackageCustomPronunciationsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageCustomPronunciationsClient SubpackageCustomPronunciations => new SubpackageCustomPronunciationsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -155,7 +155,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageDeepfakeDetectionClient SubpackageDeepfakeDetection => new SubpackageDeepfakeDetectionClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageDeepfakeDetectionClient SubpackageDeepfakeDetection => new SubpackageDeepfakeDetectionClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -165,7 +165,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageDetectIntelligenceClient SubpackageDetectIntelligence => new SubpackageDetectIntelligenceClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageDetectIntelligenceClient SubpackageDetectIntelligence => new SubpackageDetectIntelligenceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -175,7 +175,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageDuetsClient SubpackageDuets => new SubpackageDuetsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageDuetsClient SubpackageDuets => new SubpackageDuetsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -185,7 +185,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageIdentityClient SubpackageIdentity => new SubpackageIdentityClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageIdentityClient SubpackageIdentity => new SubpackageIdentityClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -195,7 +195,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageIntelligenceClient SubpackageIntelligence => new SubpackageIntelligenceClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageIntelligenceClient SubpackageIntelligence => new SubpackageIntelligenceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -205,7 +205,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageProjectsClient SubpackageProjects => new SubpackageProjectsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageProjectsClient SubpackageProjects => new SubpackageProjectsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -215,7 +215,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageRecordingsClient SubpackageRecordings => new SubpackageRecordingsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageRecordingsClient SubpackageRecordings => new SubpackageRecordingsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -225,7 +225,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageSecureUploadsClient SubpackageSecureUploads => new SubpackageSecureUploadsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageSecureUploadsClient SubpackageSecureUploads => new SubpackageSecureUploadsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -235,7 +235,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageSpeechToTextClient SubpackageSpeechToText => new SubpackageSpeechToTextClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageSpeechToTextClient SubpackageSpeechToText => new SubpackageSpeechToTextClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -245,7 +245,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageTermSubstitutionsClient SubpackageTermSubstitutions => new SubpackageTermSubstitutionsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageTermSubstitutionsClient SubpackageTermSubstitutions => new SubpackageTermSubstitutionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -255,7 +255,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageTextToSpeechClient SubpackageTextToSpeech => new SubpackageTextToSpeechClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageTextToSpeechClient SubpackageTextToSpeech => new SubpackageTextToSpeechClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -265,7 +265,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageVoiceDesignClient SubpackageVoiceDesign => new SubpackageVoiceDesignClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageVoiceDesignClient SubpackageVoiceDesign => new SubpackageVoiceDesignClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -275,7 +275,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageVoiceSettingsPresetsClient SubpackageVoiceSettingsPresets => new SubpackageVoiceSettingsPresetsClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageVoiceSettingsPresetsClient SubpackageVoiceSettingsPresets => new SubpackageVoiceSettingsPresetsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -285,7 +285,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageVoicesClient SubpackageVoices => new SubpackageVoicesClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageVoicesClient SubpackageVoices => new SubpackageVoicesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -295,7 +295,7 @@ public sealed partial class ResembleAIClient : global::ResembleAI.IResembleAICli /// /// /// - public SubpackageWatermarkClient SubpackageWatermark => new SubpackageWatermarkClient(HttpClient, authorizations: Authorizations, options: Options) + public SubpackageWatermarkClient SubpackageWatermark => new SubpackageWatermarkClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -363,10 +363,10 @@ public ResembleAIClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ResembleAIClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.ResponseStream.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.ResponseStream.g.cs new file mode 100644 index 0000000..c1cad25 --- /dev/null +++ b/src/libs/ResembleAI/Generated/ResembleAI.ResponseStream.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace ResembleAI +{ + internal sealed class ResponseStream : global::System.IO.Stream + { + private readonly global::System.Net.Http.HttpResponseMessage _response; + private readonly global::System.IO.Stream _stream; + private bool _disposed; + + public ResponseStream( + global::System.Net.Http.HttpResponseMessage response, + global::System.IO.Stream stream) + { + _response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + _stream = stream ?? throw new global::System.ArgumentNullException(nameof(stream)); + } + + public override bool CanRead => _stream.CanRead; + public override bool CanSeek => _stream.CanSeek; + public override bool CanWrite => _stream.CanWrite; + public override bool CanTimeout => _stream.CanTimeout; + public override long Length => _stream.Length; + + public override long Position + { + get => _stream.Position; + set => _stream.Position = value; + } + + public override int ReadTimeout + { + get => _stream.ReadTimeout; + set => _stream.ReadTimeout = value; + } + + public override int WriteTimeout + { + get => _stream.WriteTimeout; + set => _stream.WriteTimeout = value; + } + + public override void Flush() => _stream.Flush(); + + public override global::System.Threading.Tasks.Task FlushAsync( + global::System.Threading.CancellationToken cancellationToken) => + _stream.FlushAsync(cancellationToken); + + public override int Read(byte[] buffer, int offset, int count) => + _stream.Read(buffer, offset, count); + + public override global::System.Threading.Tasks.Task ReadAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.ReadAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask ReadAsync( + global::System.Memory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.ReadAsync(buffer, cancellationToken); +#endif + + public override long Seek(long offset, global::System.IO.SeekOrigin origin) => + _stream.Seek(offset, origin); + + public override void SetLength(long value) => + _stream.SetLength(value); + + public override void Write(byte[] buffer, int offset, int count) => + _stream.Write(buffer, offset, count); + + public override global::System.Threading.Tasks.Task WriteAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.WriteAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask WriteAsync( + global::System.ReadOnlyMemory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.WriteAsync(buffer, cancellationToken); +#endif + + protected override void Dispose(bool disposing) + { + if (!_disposed && disposing) + { + _disposed = true; + _stream.Dispose(); + _response.Dispose(); + } + + base.Dispose(disposing); + } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override async global::System.Threading.Tasks.ValueTask DisposeAsync() + { + if (_disposed) + { + return; + } + + _disposed = true; + await _stream.DisposeAsync().ConfigureAwait(false); + _response.Dispose(); + await base.DisposeAsync().ConfigureAwait(false); + } +#endif + } +} \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetAccount.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetAccount.g.cs index ba1f097..2aa933e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetAccount.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetAccount.g.cs @@ -62,6 +62,24 @@ partial void ProcessGetAccountResponseContent( public async global::System.Threading.Tasks.Task GetAccountAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAccountAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get account
+ /// Get account information + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAccountAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessGetAccountResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/account", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessGetAccountResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessGetAccountResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessGetAccountResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessGetAccountResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessGetAccountResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessGetAccountResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessGetAccountResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessGetAccountResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessGetAccountResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AccountGetAccountResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AccountGetAccountResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessGetAccountResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AccountGetAccountResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AccountGetAccountResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetBillingUsage.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetBillingUsage.g.cs index fa92926..91bde99 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetBillingUsage.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetBillingUsage.g.cs @@ -62,6 +62,24 @@ partial void ProcessGetBillingUsageResponseContent( public async global::System.Threading.Tasks.Task GetBillingUsageAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetBillingUsageAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get billing usage
+ /// Get billing and usage information + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetBillingUsageAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessGetBillingUsageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/account/billing_usage", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessGetBillingUsageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessGetBillingUsageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessGetBillingUsageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessGetBillingUsageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessGetBillingUsageResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessGetBillingUsageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessGetBillingUsageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessGetBillingUsageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessGetBillingUsageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AccountGetBillingUsageResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AccountGetBillingUsageResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessGetBillingUsageResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AccountGetBillingUsageResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AccountGetBillingUsageResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeam.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeam.g.cs index 0dbd8c6..104ba2f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeam.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeam.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetTeamResponseContent( global::System.Guid teamUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTeamAsResponseAsync( + teamUuid: teamUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get team
+ /// Get specific team information + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTeamAsResponseAsync( + global::System.Guid teamUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetTeamResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/account/teams/{teamUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetTeamResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetTeamResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetTeamResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetTeamResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetTeamResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetTeamResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetTeamResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetTeamResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetTeamResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AccountGetTeamResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AccountGetTeamResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetTeamResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AccountGetTeamResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AccountGetTeamResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeams.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeams.g.cs index 88bf563..5982c6f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeams.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.GetTeams.g.cs @@ -62,6 +62,24 @@ partial void ProcessGetTeamsResponseContent( public async global::System.Threading.Tasks.Task GetTeamsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTeamsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get teams
+ /// Get team information + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTeamsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessGetTeamsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/account/teams", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessGetTeamsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessGetTeamsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessGetTeamsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessGetTeamsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessGetTeamsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessGetTeamsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessGetTeamsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessGetTeamsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessGetTeamsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AccountGetTeamsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AccountGetTeamsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessGetTeamsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AccountGetTeamsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AccountGetTeamsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.g.cs index 11f376c..1cd3597 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAccountClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAccountClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAccountClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs index 189fab0..4225f16 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs @@ -68,6 +68,32 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( public async global::System.Threading.Tasks.Task AttachKnowledgeItemToAgentAsync( global::System.Guid agentUuid, + global::ResembleAI.AttachKnowledgeItemToAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachKnowledgeItemToAgentAsResponseAsync( + agentUuid: agentUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach knowledge item to agent
+ /// Attaches an existing knowledge item to an agent + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachKnowledgeItemToAgentAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AttachKnowledgeItemToAgentRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/knowledge_items", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation error (not ready, already attached, etc.) @@ -376,9 +421,13 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseAttachKnowledgeItemToAgentResponse201.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseAttachKnowledgeItemToAgentResponse201.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessAttachKnowledgeItemToAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseAttachKnowledgeItemToAgentResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseAttachKnowledgeItemToAgentResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs index bd0a999..577e1f7 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.CreateKnowledgeItem.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateKnowledgeItemResponseContent( /// public async global::System.Threading.Tasks.Task CreateKnowledgeItemAsync( + global::ResembleAI.CreateKnowledgeItemRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateKnowledgeItemAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create knowledge item
+ /// Creates a new knowledge item and queues it for ingestion processing + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateKnowledgeItemAsResponseAsync( + global::ResembleAI.CreateKnowledgeItemRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateKnowledgeItemResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/knowledge_items", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateKnowledgeItemResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateKnowledgeItemResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateKnowledgeItemResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation error @@ -370,9 +412,13 @@ partial void ProcessCreateKnowledgeItemResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseCreateKnowledgeItemResponse201.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseCreateKnowledgeItemResponse201.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateKnowledgeItemResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseCreateKnowledgeItemResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseCreateKnowledgeItemResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs index c689561..ad3e6df 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteKnowledgeItemResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteKnowledgeItemAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete knowledge item
+ /// Deletes a knowledge item and cleans up associated data + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteKnowledgeItemAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteKnowledgeItemResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/knowledge_items/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteKnowledgeItemResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteKnowledgeItemResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteKnowledgeItemResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Knowledge item not found @@ -361,9 +401,13 @@ partial void ProcessDeleteKnowledgeItemResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseDeleteKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseDeleteKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessDeleteKnowledgeItemResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseDeleteKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseDeleteKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs index f1de210..d84d759 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.DetachKnowledgeItemFromAgent.g.cs @@ -70,6 +70,30 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( global::System.Guid knowledgeItemUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachKnowledgeItemFromAgentAsResponseAsync( + agentUuid: agentUuid, + knowledgeItemUuid: knowledgeItemUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach knowledge item from agent
+ /// Removes a knowledge item from an agent + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachKnowledgeItemFromAgentAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid knowledgeItemUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/knowledge_items/{knowledgeItemUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent or knowledge item not found @@ -405,9 +448,13 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseDetachKnowledgeItemFromAgentResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseDetachKnowledgeItemFromAgentResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -435,9 +482,13 @@ partial void ProcessDetachKnowledgeItemFromAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseDetachKnowledgeItemFromAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseDetachKnowledgeItemFromAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs index 9db2f01..ad7cfd2 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.GetKnowledgeItem.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetKnowledgeItemResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetKnowledgeItemAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get knowledge item
+ /// Retrieves a single knowledge item with detailed information including attached agents + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetKnowledgeItemAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetKnowledgeItemResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/knowledge_items/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetKnowledgeItemResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetKnowledgeItemResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetKnowledgeItemResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Knowledge item not found @@ -361,9 +401,13 @@ partial void ProcessGetKnowledgeItemResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseGetKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseGetKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessGetKnowledgeItemResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseGetKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseGetKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs index 6837da1..2ad65b3 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListAgentKnowledgeItems.g.cs @@ -66,6 +66,27 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( global::System.Guid agentUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentKnowledgeItemsAsResponseAsync( + agentUuid: agentUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent's knowledge items
+ /// Lists all knowledge items attached to a specific agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAgentKnowledgeItemsAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/knowledge_items", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Agent not found @@ -361,9 +401,13 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseListAgentKnowledgeItemsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseListAgentKnowledgeItemsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessListAgentKnowledgeItemsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseListAgentKnowledgeItemsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseListAgentKnowledgeItemsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs index d4b93e3..807717e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ListKnowledgeItems.g.cs @@ -82,6 +82,40 @@ partial void ProcessListKnowledgeItemsResponseContent( int? perPage = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListKnowledgeItemsAsResponseAsync( + status: status, + sourceType: sourceType, + page: page, + perPage: perPage, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List knowledge items
+ /// List all knowledge items belonging to the authenticated user's team + ///
+ /// + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 20 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListKnowledgeItemsAsResponseAsync( + global::ResembleAI.KnowledgeItemsGetParametersStatus? status = default, + global::ResembleAI.KnowledgeItemsGetParametersSourceType? sourceType = default, + int? page = default, + int? perPage = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -114,16 +148,17 @@ partial void ProcessListKnowledgeItemsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/knowledge_items", baseUri: ResolveBaseUri( servers: s_ListKnowledgeItemsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddOptionalParameter("status", status?.ToValueString()) .AddOptionalParameter("source_type", sourceType?.ToValueString()) .AddOptionalParameter("page", page?.ToString()) - .AddOptionalParameter("per_page", perPage?.ToString()) + .AddOptionalParameter("per_page", perPage?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -198,6 +233,8 @@ partial void ProcessListKnowledgeItemsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +245,11 @@ partial void ProcessListKnowledgeItemsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +267,8 @@ partial void ProcessListKnowledgeItemsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +278,7 @@ partial void ProcessListKnowledgeItemsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +287,11 @@ partial void ProcessListKnowledgeItemsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +308,15 @@ partial void ProcessListKnowledgeItemsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +356,8 @@ partial void ProcessListKnowledgeItemsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +378,8 @@ partial void ProcessListKnowledgeItemsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -351,9 +404,13 @@ partial void ProcessListKnowledgeItemsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseListKnowledgeItemsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseListKnowledgeItemsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -381,9 +438,13 @@ partial void ProcessListKnowledgeItemsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseListKnowledgeItemsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseListKnowledgeItemsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs index 3f7d70f..5924f58 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs @@ -66,6 +66,27 @@ partial void ProcessReingestKnowledgeItemResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReingestKnowledgeItemAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Re-ingest knowledge item
+ /// Re-runs the ingestion pipeline for an existing knowledge item + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReingestKnowledgeItemAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessReingestKnowledgeItemResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/knowledge_items/{uuid}/reingest", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessReingestKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessReingestKnowledgeItemResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessReingestKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessReingestKnowledgeItemResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessReingestKnowledgeItemResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessReingestKnowledgeItemResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessReingestKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessReingestKnowledgeItemResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Cannot reingest (already processing or rate limited) @@ -361,9 +401,13 @@ partial void ProcessReingestKnowledgeItemResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentKnowledgeBaseReingestKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentKnowledgeBaseReingestKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessReingestKnowledgeItemResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentKnowledgeBaseReingestKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentKnowledgeBaseReingestKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.g.cs index ee3360f..6338960 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentKnowledgeBaseClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAgentKnowledgeBaseClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAgentKnowledgeBaseClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs index 51ed59a..8bde087 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.CreatePhoneNumber.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreatePhoneNumberResponseContent( /// public async global::System.Threading.Tasks.Task CreatePhoneNumberAsync( + global::ResembleAI.CreatePhoneNumberRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreatePhoneNumberAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent phone number
+ /// Create a new agent phone number + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreatePhoneNumberAsResponseAsync( + global::ResembleAI.CreatePhoneNumberRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreatePhoneNumberResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/phone_numbers", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreatePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreatePhoneNumberResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreatePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreatePhoneNumberResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreatePhoneNumberResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreatePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreatePhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreatePhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreatePhoneNumberResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentPhoneNumbersCreatePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentPhoneNumbersCreatePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreatePhoneNumberResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentPhoneNumbersCreatePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentPhoneNumbersCreatePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs index 8674213..80f4b0c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.DeletePhoneNumber.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeletePhoneNumberResponseContent( int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeletePhoneNumberAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete agent phone number
+ /// Delete an agent phone number + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeletePhoneNumberAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeletePhoneNumberResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/phone_numbers/{id}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeletePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeletePhoneNumberResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeletePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeletePhoneNumberResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeletePhoneNumberResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeletePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeletePhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeletePhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeletePhoneNumberResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentPhoneNumbersDeletePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentPhoneNumbersDeletePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeletePhoneNumberResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentPhoneNumbersDeletePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentPhoneNumbersDeletePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs index 259da1f..6171b84 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs @@ -66,6 +66,27 @@ partial void ProcessForceDeletePhoneNumberResponseContent( int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ForceDeletePhoneNumberAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Force delete agent phone number
+ /// Force delete an agent phone number even if linked to agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ForceDeletePhoneNumberAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessForceDeletePhoneNumberResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/phone_numbers/{id}/force", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessForceDeletePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessForceDeletePhoneNumberResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessForceDeletePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessForceDeletePhoneNumberResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessForceDeletePhoneNumberResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessForceDeletePhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessForceDeletePhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessForceDeletePhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessForceDeletePhoneNumberResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentPhoneNumbersForceDeletePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentPhoneNumbersForceDeletePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessForceDeletePhoneNumberResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentPhoneNumbersForceDeletePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentPhoneNumbersForceDeletePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs index 9e29b20..dd7ca2a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.GetPhoneNumber.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetPhoneNumberResponseContent( int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetPhoneNumberAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent phone number
+ /// Get agent phone number details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetPhoneNumberAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetPhoneNumberResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/phone_numbers/{id}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetPhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetPhoneNumberResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetPhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetPhoneNumberResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetPhoneNumberResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetPhoneNumberResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetPhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetPhoneNumberResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetPhoneNumberResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentPhoneNumbersGetPhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentPhoneNumbersGetPhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetPhoneNumberResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentPhoneNumbersGetPhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentPhoneNumbersGetPhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs index 997ce62..e911473 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.ListPhoneNumbers.g.cs @@ -62,6 +62,24 @@ partial void ProcessListPhoneNumbersResponseContent( public async global::System.Threading.Tasks.Task ListPhoneNumbersAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListPhoneNumbersAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent phone numbers
+ /// List all agent phone numbers + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListPhoneNumbersAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessListPhoneNumbersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/phone_numbers", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessListPhoneNumbersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessListPhoneNumbersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessListPhoneNumbersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessListPhoneNumbersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessListPhoneNumbersResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessListPhoneNumbersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessListPhoneNumbersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessListPhoneNumbersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessListPhoneNumbersResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentPhoneNumbersListPhoneNumbersResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentPhoneNumbersListPhoneNumbersResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessListPhoneNumbersResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentPhoneNumbersListPhoneNumbersResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentPhoneNumbersListPhoneNumbersResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.g.cs index 3ba4bf1..34a8931 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentPhoneNumbersClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAgentPhoneNumbersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAgentPhoneNumbersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.CreateAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.CreateAgentTool.g.cs index 8d4141f..fa75a4b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.CreateAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.CreateAgentTool.g.cs @@ -68,6 +68,32 @@ partial void ProcessCreateAgentToolResponseContent( public async global::System.Threading.Tasks.Task CreateAgentToolAsync( global::System.Guid agentUuid, + global::ResembleAI.CreateAgentToolRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentToolAsResponseAsync( + agentUuid: agentUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent tool
+ /// Create a new tool for an agent + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.CreateAgentToolRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessCreateAgentToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/tools", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessCreateAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessCreateAgentToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessCreateAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessCreateAgentToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessCreateAgentToolResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessCreateAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessCreateAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessCreateAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessCreateAgentToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentToolsCreateAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentToolsCreateAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessCreateAgentToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentToolsCreateAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentToolsCreateAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.DeleteAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.DeleteAgentTool.g.cs index fa4cbf9..789041e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.DeleteAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.DeleteAgentTool.g.cs @@ -70,6 +70,30 @@ partial void ProcessDeleteAgentToolResponseContent( global::System.Guid toolUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAgentToolAsResponseAsync( + agentUuid: agentUuid, + toolUuid: toolUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete agent tool
+ /// Delete a tool + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid toolUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessDeleteAgentToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/tools/{toolUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessDeleteAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessDeleteAgentToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessDeleteAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessDeleteAgentToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessDeleteAgentToolResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessDeleteAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessDeleteAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessDeleteAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessDeleteAgentToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentToolsDeleteAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentToolsDeleteAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessDeleteAgentToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentToolsDeleteAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentToolsDeleteAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.GetAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.GetAgentTool.g.cs index 9a813e6..2ef1e1e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.GetAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.GetAgentTool.g.cs @@ -70,6 +70,30 @@ partial void ProcessGetAgentToolResponseContent( global::System.Guid toolUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentToolAsResponseAsync( + agentUuid: agentUuid, + toolUuid: toolUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent tool
+ /// Get details of a specific tool + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid toolUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessGetAgentToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/tools/{toolUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessGetAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessGetAgentToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessGetAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessGetAgentToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessGetAgentToolResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessGetAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessGetAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessGetAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessGetAgentToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentToolsGetAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentToolsGetAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessGetAgentToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentToolsGetAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentToolsGetAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.ListAgentTools.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.ListAgentTools.g.cs index 12fb173..4192c11 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.ListAgentTools.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.ListAgentTools.g.cs @@ -66,6 +66,27 @@ partial void ProcessListAgentToolsResponseContent( global::System.Guid agentUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentToolsAsResponseAsync( + agentUuid: agentUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent tools
+ /// List all tools for an agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAgentToolsAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessListAgentToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/tools", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessListAgentToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessListAgentToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessListAgentToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessListAgentToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessListAgentToolsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessListAgentToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessListAgentToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessListAgentToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessListAgentToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentToolsListAgentToolsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentToolsListAgentToolsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessListAgentToolsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentToolsListAgentToolsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentToolsListAgentToolsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.UpdateAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.UpdateAgentTool.g.cs index e1f22da..6ea4038 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.UpdateAgentTool.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.UpdateAgentTool.g.cs @@ -72,6 +72,35 @@ partial void ProcessUpdateAgentToolResponseContent( global::System.Guid agentUuid, global::System.Guid toolUuid, + global::ResembleAI.UpdateAgentToolRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAgentToolAsResponseAsync( + agentUuid: agentUuid, + toolUuid: toolUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent tool
+ /// Update an existing tool + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateAgentToolAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid toolUuid, + global::ResembleAI.UpdateAgentToolRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessUpdateAgentToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/tools/{toolUuid}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessUpdateAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessUpdateAgentToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessUpdateAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessUpdateAgentToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessUpdateAgentToolResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessUpdateAgentToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessUpdateAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessUpdateAgentToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessUpdateAgentToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentToolsUpdateAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentToolsUpdateAgentToolResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessUpdateAgentToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentToolsUpdateAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentToolsUpdateAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.g.cs index 71b06e6..e5c79cf 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentToolsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAgentToolsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAgentToolsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs index 2b9dd7d..af20383 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.CreateAgentWebhook.g.cs @@ -68,6 +68,32 @@ partial void ProcessCreateAgentWebhookResponseContent( public async global::System.Threading.Tasks.Task CreateAgentWebhookAsync( global::System.Guid agentUuid, + global::ResembleAI.CreateAgentWebhookRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentWebhookAsResponseAsync( + agentUuid: agentUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent webhook
+ /// Create a new webhook for an agent + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.CreateAgentWebhookRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessCreateAgentWebhookResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/webhooks", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessCreateAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessCreateAgentWebhookResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessCreateAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessCreateAgentWebhookResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessCreateAgentWebhookResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessCreateAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessCreateAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessCreateAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessCreateAgentWebhookResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentWebhooksCreateAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentWebhooksCreateAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessCreateAgentWebhookResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentWebhooksCreateAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentWebhooksCreateAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs index 2dae17c..2f6e0c0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.DeleteAgentWebhook.g.cs @@ -70,6 +70,30 @@ partial void ProcessDeleteAgentWebhookResponseContent( global::System.Guid webhookUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAgentWebhookAsResponseAsync( + agentUuid: agentUuid, + webhookUuid: webhookUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete agent webhook
+ /// Delete a webhook + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid webhookUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessDeleteAgentWebhookResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/webhooks/{webhookUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessDeleteAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessDeleteAgentWebhookResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessDeleteAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessDeleteAgentWebhookResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessDeleteAgentWebhookResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessDeleteAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessDeleteAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessDeleteAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessDeleteAgentWebhookResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentWebhooksDeleteAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentWebhooksDeleteAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessDeleteAgentWebhookResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentWebhooksDeleteAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentWebhooksDeleteAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.GetAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.GetAgentWebhook.g.cs index f910f6a..fff2b22 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.GetAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.GetAgentWebhook.g.cs @@ -70,6 +70,30 @@ partial void ProcessGetAgentWebhookResponseContent( global::System.Guid webhookUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentWebhookAsResponseAsync( + agentUuid: agentUuid, + webhookUuid: webhookUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent webhook
+ /// Get details of a specific webhook + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid webhookUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessGetAgentWebhookResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/webhooks/{webhookUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessGetAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessGetAgentWebhookResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessGetAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessGetAgentWebhookResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessGetAgentWebhookResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessGetAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessGetAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessGetAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessGetAgentWebhookResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentWebhooksGetAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentWebhooksGetAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessGetAgentWebhookResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentWebhooksGetAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentWebhooksGetAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs index 740176c..2756f7c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.ListAgentWebhooks.g.cs @@ -66,6 +66,27 @@ partial void ProcessListAgentWebhooksResponseContent( global::System.Guid agentUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentWebhooksAsResponseAsync( + agentUuid: agentUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agent webhooks
+ /// List all webhooks for an agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAgentWebhooksAsResponseAsync( + global::System.Guid agentUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessListAgentWebhooksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/webhooks", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessListAgentWebhooksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessListAgentWebhooksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessListAgentWebhooksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessListAgentWebhooksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessListAgentWebhooksResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessListAgentWebhooksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessListAgentWebhooksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessListAgentWebhooksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessListAgentWebhooksResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentWebhooksListAgentWebhooksResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentWebhooksListAgentWebhooksResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessListAgentWebhooksResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentWebhooksListAgentWebhooksResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentWebhooksListAgentWebhooksResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs index 818cbaa..0a6d994 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.UpdateAgentWebhook.g.cs @@ -72,6 +72,35 @@ partial void ProcessUpdateAgentWebhookResponseContent( global::System.Guid agentUuid, global::System.Guid webhookUuid, + global::ResembleAI.UpdateAgentWebhookRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAgentWebhookAsResponseAsync( + agentUuid: agentUuid, + webhookUuid: webhookUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent webhook
+ /// Update an existing webhook + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateAgentWebhookAsResponseAsync( + global::System.Guid agentUuid, + global::System.Guid webhookUuid, + global::ResembleAI.UpdateAgentWebhookRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessUpdateAgentWebhookResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{agentUuid}/webhooks/{webhookUuid}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessUpdateAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessUpdateAgentWebhookResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessUpdateAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessUpdateAgentWebhookResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessUpdateAgentWebhookResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessUpdateAgentWebhookResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessUpdateAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessUpdateAgentWebhookResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessUpdateAgentWebhookResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentWebhooksUpdateAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentWebhooksUpdateAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessUpdateAgentWebhookResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentWebhooksUpdateAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentWebhooksUpdateAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.g.cs index 5ffe25e..bf95aec 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentWebhooksClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAgentWebhooksClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAgentWebhooksClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.CreateAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.CreateAgent.g.cs index e0d9c5f..ee959b8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.CreateAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.CreateAgent.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateAgentResponseContent( /// public async global::System.Threading.Tasks.Task CreateAgentAsync( + global::ResembleAI.CreateAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create agent
+ /// Create a new voice agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentAsResponseAsync( + global::ResembleAI.CreateAgentRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/agents", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation error @@ -370,9 +412,13 @@ partial void ProcessCreateAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsCreateAgentResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsCreateAgentResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsCreateAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsCreateAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DeleteAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DeleteAgent.g.cs index 48bd3ea..5c5bda4 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DeleteAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DeleteAgent.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteAgentResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAgentAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete agent
+ /// Delete an agent and all its configurations + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteAgentAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeleteAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsDeleteAgentResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsDeleteAgentResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeleteAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsDeleteAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsDeleteAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DispatchAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DispatchAgent.g.cs index 091b15d..2f2cbae 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DispatchAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.DispatchAgent.g.cs @@ -68,6 +68,32 @@ partial void ProcessDispatchAgentResponseContent( public async global::System.Threading.Tasks.Task DispatchAgentAsync( global::System.Guid uuid, + global::ResembleAI.DispatchAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DispatchAgentAsResponseAsync( + uuid: uuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Dispatch agent
+ /// Make an outbound call with an agent + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DispatchAgentAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.DispatchAgentRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessDispatchAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{uuid}/dispatch", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessDispatchAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessDispatchAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessDispatchAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessDispatchAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessDispatchAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessDispatchAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessDispatchAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessDispatchAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessDispatchAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsDispatchAgentResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsDispatchAgentResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessDispatchAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsDispatchAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsDispatchAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgent.g.cs index ae1320a..112365a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgent.g.cs @@ -72,6 +72,32 @@ partial void ProcessGetAgentResponseContent( bool? advanced = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentAsResponseAsync( + uuid: uuid, + advanced: advanced, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get agent
+ /// Retrieve a specific agent's details + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentAsResponseAsync( + global::System.Guid uuid, + bool? advanced = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,13 +128,14 @@ partial void ProcessGetAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{uuid}", baseUri: ResolveBaseUri( servers: s_GetAgentServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder - .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant()) + .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -181,6 +208,8 @@ partial void ProcessGetAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +220,11 @@ partial void ProcessGetAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +242,8 @@ partial void ProcessGetAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +253,7 @@ partial void ProcessGetAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +262,11 @@ partial void ProcessGetAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +283,15 @@ partial void ProcessGetAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +331,8 @@ partial void ProcessGetAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +353,8 @@ partial void ProcessGetAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -334,9 +379,13 @@ partial void ProcessGetAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsGetAgentResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsGetAgentResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -364,9 +413,13 @@ partial void ProcessGetAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsGetAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsGetAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgentCapabilities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgentCapabilities.g.cs index 14bf087..2971c55 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgentCapabilities.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetAgentCapabilities.g.cs @@ -62,6 +62,24 @@ partial void ProcessGetAgentCapabilitiesResponseContent( public async global::System.Threading.Tasks.Task GetAgentCapabilitiesAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAgentCapabilitiesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get capabilities
+ /// List supported ASR and LLM providers and models + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAgentCapabilitiesAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessGetAgentCapabilitiesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/agents/capabilities", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessGetAgentCapabilitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessGetAgentCapabilitiesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessGetAgentCapabilitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessGetAgentCapabilitiesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessGetAgentCapabilitiesResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessGetAgentCapabilitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessGetAgentCapabilitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessGetAgentCapabilitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessGetAgentCapabilitiesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsGetAgentCapabilitiesResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsGetAgentCapabilitiesResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessGetAgentCapabilitiesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsGetAgentCapabilitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsGetAgentCapabilitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetSystemTools.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetSystemTools.g.cs index 1c3ae56..7ee6ffb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetSystemTools.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.GetSystemTools.g.cs @@ -62,6 +62,24 @@ partial void ProcessGetSystemToolsResponseContent( public async global::System.Threading.Tasks.Task GetSystemToolsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSystemToolsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get system tools
+ /// List available system tools + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetSystemToolsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessGetSystemToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/agents/system-tools", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessGetSystemToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessGetSystemToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessGetSystemToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessGetSystemToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessGetSystemToolsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessGetSystemToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessGetSystemToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessGetSystemToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessGetSystemToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsGetSystemToolsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsGetSystemToolsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessGetSystemToolsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsGetSystemToolsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsGetSystemToolsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.ListAgents.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.ListAgents.g.cs index eb9b134..3bcbf51 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.ListAgents.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.ListAgents.g.cs @@ -72,6 +72,32 @@ partial void ProcessListAgentsResponseContent( bool? advanced = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsAsResponseAsync( + phoneNumber: phoneNumber, + advanced: advanced, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List agents
+ /// Retrieve all agents for the authenticated team + ///
+ /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAgentsAsResponseAsync( + string? phoneNumber = default, + bool? advanced = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,14 +128,15 @@ partial void ProcessListAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/agents", baseUri: ResolveBaseUri( servers: s_ListAgentsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddOptionalParameter("phone_number", phoneNumber) - .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant()) + .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -182,6 +209,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +221,11 @@ partial void ProcessListAgentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +243,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +254,7 @@ partial void ProcessListAgentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +263,11 @@ partial void ProcessListAgentsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +284,15 @@ partial void ProcessListAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +332,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +354,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -335,9 +380,13 @@ partial void ProcessListAgentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsListAgentsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsListAgentsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -365,9 +414,13 @@ partial void ProcessListAgentsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsListAgentsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsListAgentsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.UpdateAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.UpdateAgent.g.cs index 5d833df..1b446f8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.UpdateAgent.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.UpdateAgent.g.cs @@ -68,6 +68,32 @@ partial void ProcessUpdateAgentResponseContent( public async global::System.Threading.Tasks.Task UpdateAgentAsync( global::System.Guid uuid, + global::ResembleAI.UpdateAgentRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateAgentAsResponseAsync( + uuid: uuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update agent
+ /// Update an existing agent's configuration + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateAgentAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.UpdateAgentRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessUpdateAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/agents/{uuid}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessUpdateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessUpdateAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessUpdateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessUpdateAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessUpdateAgentResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessUpdateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessUpdateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessUpdateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessUpdateAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AgentsUpdateAgentResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AgentsUpdateAgentResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessUpdateAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AgentsUpdateAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AgentsUpdateAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.g.cs index ac2ac03..1215795 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAgentsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAgentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAgentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.CreateAudioEdit.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.CreateAudioEdit.g.cs index 7aedd33..c9278f8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.CreateAudioEdit.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.CreateAudioEdit.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateAudioEditResponseContent( /// public async global::System.Threading.Tasks.Task CreateAudioEditAsync( + global::ResembleAI.CreateAudioEditRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAudioEditAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create audio edit
+ /// Edit audio segments using voice synthesis + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAudioEditAsResponseAsync( + global::ResembleAI.CreateAudioEditRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,10 +117,11 @@ partial void ProcessCreateAudioEditResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/edit", baseUri: ResolveBaseUri( @@ -132,6 +156,7 @@ partial void ProcessCreateAudioEditResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentInputAudio = new global::System.Net.Http.ByteArrayContent(request.InputAudio ?? global::System.Array.Empty()); __contentInputAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -170,16 +195,21 @@ request.InputAudioname is null { __contentInputAudio.Headers.ContentDisposition.FileNameStar = null; } + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.OriginalTranscript ?? string.Empty), name: "\"original_transcript\""); + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.TargetTranscript ?? string.Empty), name: "\"target_transcript\""); + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.VoiceUuid ?? string.Empty), name: "\"voice_uuid\""); + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -221,6 +251,8 @@ request.InputAudioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -231,6 +263,11 @@ request.InputAudioname is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -248,6 +285,8 @@ request.InputAudioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -257,8 +296,7 @@ request.InputAudioname is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -267,6 +305,11 @@ request.InputAudioname is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -283,14 +326,15 @@ request.InputAudioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -330,6 +374,8 @@ request.InputAudioname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -350,6 +396,8 @@ request.InputAudioname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -374,9 +422,13 @@ request.InputAudioname is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,9 +456,13 @@ request.InputAudioname is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -489,5 +545,894 @@ request.InputAudioname is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create audio edit
+ /// Edit audio segments using voice synthesis + ///
+ /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// Accurate transcript of the uploaded audio + /// + /// + /// Desired replacement text + /// + /// + /// Voice used to render the edited segment + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateAudioEditAsync( + global::System.IO.Stream inputAudio, + string inputAudioname, + string originalTranscript, + string targetTranscript, + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + inputAudio = inputAudio ?? throw new global::System.ArgumentNullException(nameof(inputAudio)); + var request = new global::ResembleAI.CreateAudioEditRequest + { + InputAudio = global::System.Array.Empty(), + InputAudioname = inputAudioname, + OriginalTranscript = originalTranscript, + TargetTranscript = targetTranscript, + VoiceUuid = voiceUuid, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateAudioEditArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAudioEditSecurityRequirements, + operationName: "CreateAudioEditAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/edit", + baseUri: ResolveBaseUri( + servers: s_CreateAudioEditServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentInputAudio = new global::System.Net.Http.StreamContent(inputAudio); + __contentInputAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.InputAudioname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.InputAudioname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentInputAudio, + name: "\"input_audio\"", + fileName: request.InputAudioname != null ? $"\"{request.InputAudioname}\"" : string.Empty); + if (__contentInputAudio.Headers.ContentDisposition != null) + { + __contentInputAudio.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OriginalTranscript ?? string.Empty), + name: "\"original_transcript\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TargetTranscript ?? string.Empty), + name: "\"target_transcript\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VoiceUuid ?? string.Empty), + name: "\"voice_uuid\""); + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAudioEditRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAudioEditResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAudioEditResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create audio edit
+ /// Edit audio segments using voice synthesis + ///
+ /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// WAV, MP3, M4A, or WMA file (< 20 seconds) + /// + /// + /// Accurate transcript of the uploaded audio + /// + /// + /// Desired replacement text + /// + /// + /// Voice used to render the edited segment + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAudioEditAsResponseAsync( + global::System.IO.Stream inputAudio, + string inputAudioname, + string originalTranscript, + string targetTranscript, + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + inputAudio = inputAudio ?? throw new global::System.ArgumentNullException(nameof(inputAudio)); + var request = new global::ResembleAI.CreateAudioEditRequest + { + InputAudio = global::System.Array.Empty(), + InputAudioname = inputAudioname, + OriginalTranscript = originalTranscript, + TargetTranscript = targetTranscript, + VoiceUuid = voiceUuid, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateAudioEditArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAudioEditSecurityRequirements, + operationName: "CreateAudioEditAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/edit", + baseUri: ResolveBaseUri( + servers: s_CreateAudioEditServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentInputAudio = new global::System.Net.Http.StreamContent(inputAudio); + __contentInputAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.InputAudioname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.InputAudioname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentInputAudio, + name: "\"input_audio\"", + fileName: request.InputAudioname != null ? $"\"{request.InputAudioname}\"" : string.Empty); + if (__contentInputAudio.Headers.ContentDisposition != null) + { + __contentInputAudio.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OriginalTranscript ?? string.Empty), + name: "\"original_transcript\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TargetTranscript ?? string.Empty), + name: "\"target_transcript\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.VoiceUuid ?? string.Empty), + name: "\"voice_uuid\""); + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAudioEditRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAudioEditResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEdit", + methodName: "CreateAudioEditAsync", + pathTemplate: "\"/edit\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAudioEditResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.AudioEditCreateAudioEditResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.GetAudioEdit.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.GetAudioEdit.g.cs index 3a46f8f..c333dd1 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.GetAudioEdit.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.GetAudioEdit.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetAudioEditResponseContent( string audioEditUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAudioEditAsResponseAsync( + audioEditUuid: audioEditUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get audio edit
+ /// Get status and result of an audio edit + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAudioEditAsResponseAsync( + string audioEditUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetAudioEditResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/edit/{audioEditUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetAudioEditResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetAudioEditResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetAudioEditResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetAudioEditResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetAudioEditResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetAudioEditResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetAudioEditResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetAudioEditResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetAudioEditResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioEditGetAudioEditResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioEditGetAudioEditResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetAudioEditResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioEditGetAudioEditResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioEditGetAudioEditResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.ListAudioEdits.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.ListAudioEdits.g.cs index a9fa670..2375d83 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.ListAudioEdits.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.ListAudioEdits.g.cs @@ -68,6 +68,29 @@ partial void ProcessListAudioEditsResponseContent( int page, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAudioEditsAsResponseAsync( + page: page, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List audio edits
+ /// Retrieve paginated list of audio edits + ///
+ /// + /// Default Value: 1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAudioEditsAsResponseAsync( + int page, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,13 +120,14 @@ partial void ProcessListAudioEditsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/edit", baseUri: ResolveBaseUri( servers: s_ListAudioEditsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder - .AddRequiredParameter("page", page.ToString()!) + .AddRequiredParameter("page", page.ToString()!) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -175,6 +199,8 @@ partial void ProcessListAudioEditsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +211,11 @@ partial void ProcessListAudioEditsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +233,8 @@ partial void ProcessListAudioEditsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +244,7 @@ partial void ProcessListAudioEditsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +253,11 @@ partial void ProcessListAudioEditsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +274,15 @@ partial void ProcessListAudioEditsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +322,8 @@ partial void ProcessListAudioEditsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +344,8 @@ partial void ProcessListAudioEditsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -328,9 +370,13 @@ partial void ProcessListAudioEditsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioEditListAudioEditsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioEditListAudioEditsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -358,9 +404,13 @@ partial void ProcessListAudioEditsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioEditListAudioEditsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioEditListAudioEditsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.g.cs index d8dd583..39e8179 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEditClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAudioEditClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAudioEditClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs index d484950..2d1c52f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.CreateAudioEnhancement.g.cs @@ -65,6 +65,30 @@ partial void ProcessCreateAudioEnhancementResponseContent( /// public async global::System.Threading.Tasks.Task CreateAudioEnhancementAsync( + global::ResembleAI.CreateAudioEnhancementRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAudioEnhancementAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create audio enhancement
+ /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
+ /// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAudioEnhancementAsResponseAsync( + global::ResembleAI.CreateAudioEnhancementRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -95,10 +119,11 @@ partial void ProcessCreateAudioEnhancementResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/audio_enhancements", baseUri: ResolveBaseUri( @@ -133,6 +158,7 @@ partial void ProcessCreateAudioEnhancementResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentAudioFile = new global::System.Net.Http.ByteArrayContent(request.AudioFile ?? global::System.Array.Empty()); __contentAudioFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -171,56 +197,66 @@ request.AudioFilename is null { __contentAudioFile.Headers.ContentDisposition.FileNameStar = null; } + if (request.EnhancementEngine != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((request.EnhancementEngine).HasValue ? (request.EnhancementEngine).GetValueOrDefault().ToValueString() : string.Empty), name: "\"enhancement_engine\""); - } + + } if (request.RemoveNoise != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.RemoveNoise, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"remove_noise\""); - } + + } if (request.Normalize != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Normalize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"normalize\""); - } + + } if (request.StudioSound != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StudioSound, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"studio_sound\""); - } + + } if (request.EnhancementLevel != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EnhancementLevel, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"enhancement_level\""); - } + + } if (request.LoudnessTargetLevel != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.LoudnessTargetLevel, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"loudness_target_level\""); - } + + } if (request.LoudnessPeakLimit != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.LoudnessPeakLimit, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"loudness_peak_limit\""); + } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -262,6 +298,8 @@ request.AudioFilename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -272,6 +310,11 @@ request.AudioFilename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -289,6 +332,8 @@ request.AudioFilename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -298,8 +343,7 @@ request.AudioFilename is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +352,11 @@ request.AudioFilename is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -324,14 +373,15 @@ request.AudioFilename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -371,6 +421,8 @@ request.AudioFilename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -391,6 +443,8 @@ request.AudioFilename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request @@ -491,9 +545,13 @@ request.AudioFilename is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -521,9 +579,13 @@ request.AudioFilename is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -633,5 +695,1190 @@ request.AudioFilename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create audio enhancement
+ /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
+ /// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. + ///
+ /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Enhancement engine to use. Default is v2.
+ /// Default Value: v2 + /// + /// + /// Remove background noise. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Normalize audio levels. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Apply studio-quality enhancement. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Enhancement intensity (0.0 to 1.0). Engine v1 only (legacy). + /// + /// + /// Target loudness in LUFS. Engine v1 only (legacy).
+ /// Default Value: -14 + /// + /// + /// Peak limit in dBTP. Engine v1 only (legacy).
+ /// Default Value: -1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateAudioEnhancementAsync( + global::System.IO.Stream audioFile, + string audioFilename, + global::ResembleAI.AudioEnhancementsPostRequestBodyContentMultipartFormDataSchemaEnhancementEngine? enhancementEngine = default, + bool? removeNoise = default, + bool? normalize = default, + bool? studioSound = default, + double? enhancementLevel = default, + int? loudnessTargetLevel = default, + int? loudnessPeakLimit = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + audioFile = audioFile ?? throw new global::System.ArgumentNullException(nameof(audioFile)); + var request = new global::ResembleAI.CreateAudioEnhancementRequest + { + AudioFile = global::System.Array.Empty(), + AudioFilename = audioFilename, + EnhancementEngine = enhancementEngine, + RemoveNoise = removeNoise, + Normalize = normalize, + StudioSound = studioSound, + EnhancementLevel = enhancementLevel, + LoudnessTargetLevel = loudnessTargetLevel, + LoudnessPeakLimit = loudnessPeakLimit, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateAudioEnhancementArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAudioEnhancementSecurityRequirements, + operationName: "CreateAudioEnhancementAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/audio_enhancements", + baseUri: ResolveBaseUri( + servers: s_CreateAudioEnhancementServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentAudioFile = new global::System.Net.Http.StreamContent(audioFile); + __contentAudioFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.AudioFilename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.AudioFilename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentAudioFile, + name: "\"audio_file\"", + fileName: request.AudioFilename != null ? $"\"{request.AudioFilename}\"" : string.Empty); + if (__contentAudioFile.Headers.ContentDisposition != null) + { + __contentAudioFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.EnhancementEngine != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.EnhancementEngine).HasValue ? (request.EnhancementEngine).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"enhancement_engine\""); + + } + if (request.RemoveNoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.RemoveNoise, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"remove_noise\""); + + } + if (request.Normalize != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Normalize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"normalize\""); + + } + if (request.StudioSound != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StudioSound, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"studio_sound\""); + + } + if (request.EnhancementLevel != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EnhancementLevel, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"enhancement_level\""); + + } + if (request.LoudnessTargetLevel != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.LoudnessTargetLevel, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"loudness_target_level\""); + + } + if (request.LoudnessPeakLimit != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.LoudnessPeakLimit, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"loudness_peak_limit\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAudioEnhancementRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAudioEnhancementResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.CreateAudioEnhancementRequestBadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.CreateAudioEnhancementRequestBadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.CreateAudioEnhancementRequestBadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ResembleAI.CreateAudioEnhancementRequestForbiddenError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ResembleAI.CreateAudioEnhancementRequestForbiddenError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ResembleAI.CreateAudioEnhancementRequestForbiddenError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAudioEnhancementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create audio enhancement
+ /// Submit an audio file for enhancement. Processing happens asynchronously in the background.
+ /// The API defaults to the v2 enhancement engine. The v1 engine is legacy and will be sunset in a future release. + ///
+ /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Audio file to enhance (WAV, MP3, M4A, MP4, OGG, AAC, FLAC). Max 150 MB. + /// + /// + /// Enhancement engine to use. Default is v2.
+ /// Default Value: v2 + /// + /// + /// Remove background noise. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Normalize audio levels. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Apply studio-quality enhancement. Engine v2 only.
+ /// Default Value: true + /// + /// + /// Enhancement intensity (0.0 to 1.0). Engine v1 only (legacy). + /// + /// + /// Target loudness in LUFS. Engine v1 only (legacy).
+ /// Default Value: -14 + /// + /// + /// Peak limit in dBTP. Engine v1 only (legacy).
+ /// Default Value: -1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAudioEnhancementAsResponseAsync( + global::System.IO.Stream audioFile, + string audioFilename, + global::ResembleAI.AudioEnhancementsPostRequestBodyContentMultipartFormDataSchemaEnhancementEngine? enhancementEngine = default, + bool? removeNoise = default, + bool? normalize = default, + bool? studioSound = default, + double? enhancementLevel = default, + int? loudnessTargetLevel = default, + int? loudnessPeakLimit = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + audioFile = audioFile ?? throw new global::System.ArgumentNullException(nameof(audioFile)); + var request = new global::ResembleAI.CreateAudioEnhancementRequest + { + AudioFile = global::System.Array.Empty(), + AudioFilename = audioFilename, + EnhancementEngine = enhancementEngine, + RemoveNoise = removeNoise, + Normalize = normalize, + StudioSound = studioSound, + EnhancementLevel = enhancementLevel, + LoudnessTargetLevel = loudnessTargetLevel, + LoudnessPeakLimit = loudnessPeakLimit, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateAudioEnhancementArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateAudioEnhancementSecurityRequirements, + operationName: "CreateAudioEnhancementAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/audio_enhancements", + baseUri: ResolveBaseUri( + servers: s_CreateAudioEnhancementServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentAudioFile = new global::System.Net.Http.StreamContent(audioFile); + __contentAudioFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.AudioFilename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.AudioFilename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentAudioFile, + name: "\"audio_file\"", + fileName: request.AudioFilename != null ? $"\"{request.AudioFilename}\"" : string.Empty); + if (__contentAudioFile.Headers.ContentDisposition != null) + { + __contentAudioFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.EnhancementEngine != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.EnhancementEngine).HasValue ? (request.EnhancementEngine).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"enhancement_engine\""); + + } + if (request.RemoveNoise != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.RemoveNoise, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"remove_noise\""); + + } + if (request.Normalize != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Normalize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"normalize\""); + + } + if (request.StudioSound != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StudioSound, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"studio_sound\""); + + } + if (request.EnhancementLevel != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EnhancementLevel, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"enhancement_level\""); + + } + if (request.LoudnessTargetLevel != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.LoudnessTargetLevel, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"loudness_target_level\""); + + } + if (request.LoudnessPeakLimit != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.LoudnessPeakLimit, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"loudness_peak_limit\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateAudioEnhancementRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateAudioEnhancementResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateAudioEnhancement", + methodName: "CreateAudioEnhancementAsync", + pathTemplate: "\"/audio_enhancements\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.CreateAudioEnhancementRequestBadRequestError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.CreateAudioEnhancementRequestBadRequestError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.CreateAudioEnhancementRequestBadRequestError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ResembleAI.CreateAudioEnhancementRequestForbiddenError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ResembleAI.CreateAudioEnhancementRequestForbiddenError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ResembleAI.CreateAudioEnhancementRequestForbiddenError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateAudioEnhancementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.AudioEnhancementCreateAudioEnhancementResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs index 7a1b399..b6dc74f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.GetAudioEnhancement.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetAudioEnhancementResponseContent( string enhancementUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAudioEnhancementAsResponseAsync( + enhancementUuid: enhancementUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get audio enhancement
+ /// Poll this endpoint to check the status of an enhancement job and retrieve the download URL when complete. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAudioEnhancementAsResponseAsync( + string enhancementUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetAudioEnhancementResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/audio_enhancements/{enhancementUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetAudioEnhancementResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetAudioEnhancementResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetAudioEnhancementResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetAudioEnhancementResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetAudioEnhancementResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetAudioEnhancementResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetAudioEnhancementResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetAudioEnhancementResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Not found @@ -361,9 +401,13 @@ partial void ProcessGetAudioEnhancementResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioEnhancementGetAudioEnhancementResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioEnhancementGetAudioEnhancementResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessGetAudioEnhancementResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioEnhancementGetAudioEnhancementResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioEnhancementGetAudioEnhancementResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs index 2fbf1f7..961869f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.ListAudioEnhancements.g.cs @@ -72,6 +72,32 @@ partial void ProcessListAudioEnhancementsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAudioEnhancementsAsResponseAsync( + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List audio enhancements
+ /// Returns a paginated list of all audio enhancements for your team, ordered by most recent first. + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAudioEnhancementsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,14 +128,15 @@ partial void ProcessListAudioEnhancementsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/audio_enhancements", baseUri: ResolveBaseUri( servers: s_ListAudioEnhancementsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -182,6 +209,8 @@ partial void ProcessListAudioEnhancementsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +221,11 @@ partial void ProcessListAudioEnhancementsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +243,8 @@ partial void ProcessListAudioEnhancementsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +254,7 @@ partial void ProcessListAudioEnhancementsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +263,11 @@ partial void ProcessListAudioEnhancementsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +284,15 @@ partial void ProcessListAudioEnhancementsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +332,8 @@ partial void ProcessListAudioEnhancementsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +354,8 @@ partial void ProcessListAudioEnhancementsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request @@ -373,9 +418,13 @@ partial void ProcessListAudioEnhancementsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioEnhancementListAudioEnhancementsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioEnhancementListAudioEnhancementsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -403,9 +452,13 @@ partial void ProcessListAudioEnhancementsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioEnhancementListAudioEnhancementsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioEnhancementListAudioEnhancementsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.g.cs index 788a1b1..4e26633 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioEnhancementClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAudioEnhancementClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAudioEnhancementClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs index 4d39e28..34066cd 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.GetAudioSourceTracing.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetAudioSourceTracingResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAudioSourceTracingAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get audio source tracing
+ /// Retrieve a single source tracing report by its UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetAudioSourceTracingAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetAudioSourceTracingResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/audio_source_tracings/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetAudioSourceTracingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetAudioSourceTracingResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetAudioSourceTracingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetAudioSourceTracingResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetAudioSourceTracingResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetAudioSourceTracingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetAudioSourceTracingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetAudioSourceTracingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Source tracing report not found @@ -361,9 +401,13 @@ partial void ProcessGetAudioSourceTracingResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioSourceTracingGetAudioSourceTracingResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioSourceTracingGetAudioSourceTracingResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessGetAudioSourceTracingResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioSourceTracingGetAudioSourceTracingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioSourceTracingGetAudioSourceTracingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs index 480545e..509e8ba 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.ListAudioSourceTracings.g.cs @@ -72,6 +72,32 @@ partial void ProcessListAudioSourceTracingsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAudioSourceTracingsAsResponseAsync( + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List audio source tracings
+ /// Retrieve a paginated list of all source tracing reports for the authenticated user's team + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAudioSourceTracingsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,14 +128,15 @@ partial void ProcessListAudioSourceTracingsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/audio_source_tracings", baseUri: ResolveBaseUri( servers: s_ListAudioSourceTracingsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -182,6 +209,8 @@ partial void ProcessListAudioSourceTracingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +221,11 @@ partial void ProcessListAudioSourceTracingsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +243,8 @@ partial void ProcessListAudioSourceTracingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +254,7 @@ partial void ProcessListAudioSourceTracingsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +263,11 @@ partial void ProcessListAudioSourceTracingsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +284,15 @@ partial void ProcessListAudioSourceTracingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +332,8 @@ partial void ProcessListAudioSourceTracingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +354,8 @@ partial void ProcessListAudioSourceTracingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -335,9 +380,13 @@ partial void ProcessListAudioSourceTracingsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.AudioSourceTracingListAudioSourceTracingsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.AudioSourceTracingListAudioSourceTracingsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -365,9 +414,13 @@ partial void ProcessListAudioSourceTracingsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.AudioSourceTracingListAudioSourceTracingsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.AudioSourceTracingListAudioSourceTracingsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.g.cs index eb7e085..b4e6f76 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageAudioSourceTracingClient.g.cs @@ -103,10 +103,10 @@ public SubpackageAudioSourceTracingClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageAudioSourceTracingClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.DeleteClip.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.DeleteClip.g.cs index 9615419..5f3f366 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.DeleteClip.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.DeleteClip.g.cs @@ -70,6 +70,30 @@ partial void ProcessDeleteClipResponseContent( string clipUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteClipAsResponseAsync( + projectUuid: projectUuid, + clipUuid: clipUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete clip
+ /// Delete a clip + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteClipAsResponseAsync( + string projectUuid, + string clipUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessDeleteClipResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}/clips/{clipUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessDeleteClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessDeleteClipResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessDeleteClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessDeleteClipResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessDeleteClipResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessDeleteClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessDeleteClipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessDeleteClipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessDeleteClipResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ClipsDeleteClipResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ClipsDeleteClipResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessDeleteClipResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ClipsDeleteClipResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ClipsDeleteClipResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.GetClip.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.GetClip.g.cs index 1fdea48..b9a6b6c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.GetClip.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.GetClip.g.cs @@ -70,6 +70,30 @@ partial void ProcessGetClipResponseContent( string clipUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetClipAsResponseAsync( + projectUuid: projectUuid, + clipUuid: clipUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get clip
+ /// Get clip details + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetClipAsResponseAsync( + string projectUuid, + string clipUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessGetClipResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}/clips/{clipUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessGetClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessGetClipResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessGetClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessGetClipResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessGetClipResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessGetClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessGetClipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessGetClipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessGetClipResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ClipsGetClipResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ClipsGetClipResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessGetClipResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ClipsGetClipResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ClipsGetClipResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.ListClips.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.ListClips.g.cs index d3555f4..1ef79be 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.ListClips.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.ListClips.g.cs @@ -78,6 +78,37 @@ partial void ProcessListClipsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListClipsAsResponseAsync( + projectUuid: projectUuid, + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List clips
+ /// List clips in a project + ///
+ /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListClipsAsResponseAsync( + string projectUuid, + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,14 +140,15 @@ partial void ProcessListClipsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}/clips", baseUri: ResolveBaseUri( servers: s_ListClipsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -190,6 +222,8 @@ partial void ProcessListClipsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -200,6 +234,11 @@ partial void ProcessListClipsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -217,6 +256,8 @@ partial void ProcessListClipsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -226,8 +267,7 @@ partial void ProcessListClipsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -236,6 +276,11 @@ partial void ProcessListClipsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -252,14 +297,15 @@ partial void ProcessListClipsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +345,8 @@ partial void ProcessListClipsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -319,6 +367,8 @@ partial void ProcessListClipsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -343,9 +393,13 @@ partial void ProcessListClipsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ClipsListClipsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ClipsListClipsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -373,9 +427,13 @@ partial void ProcessListClipsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ClipsListClipsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ClipsListClipsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.UpdateClip.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.UpdateClip.g.cs index 1002ca6..9188b97 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.UpdateClip.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.UpdateClip.g.cs @@ -72,6 +72,35 @@ partial void ProcessUpdateClipResponseContent( string projectUuid, string clipUuid, + global::ResembleAI.UpdateClipRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateClipAsResponseAsync( + projectUuid: projectUuid, + clipUuid: clipUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update clip
+ /// Update a clip + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateClipAsResponseAsync( + string projectUuid, + string clipUuid, + global::ResembleAI.UpdateClipRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessUpdateClipResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}/clips/{clipUuid}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessUpdateClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessUpdateClipResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessUpdateClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessUpdateClipResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessUpdateClipResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessUpdateClipResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessUpdateClipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessUpdateClipResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessUpdateClipResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ClipsUpdateClipResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ClipsUpdateClipResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessUpdateClipResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ClipsUpdateClipResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ClipsUpdateClipResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.g.cs index 79fed10..7aadacd 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageClipsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageClipsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageClipsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs index 964c5a4..d5ac263 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.BulkCreatePronunciations.g.cs @@ -64,6 +64,29 @@ partial void ProcessBulkCreatePronunciationsResponseContent( /// public async global::System.Threading.Tasks.Task BulkCreatePronunciationsAsync( + global::ResembleAI.BulkCreatePronunciationsRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BulkCreatePronunciationsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Bulk create pronunciations from ZIP
+ /// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> BulkCreatePronunciationsAsResponseAsync( + global::ResembleAI.BulkCreatePronunciationsRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,10 +117,11 @@ partial void ProcessBulkCreatePronunciationsResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/pronunciations/bulk", baseUri: ResolveBaseUri( @@ -132,6 +156,7 @@ partial void ProcessBulkCreatePronunciationsResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentZip = new global::System.Net.Http.ByteArrayContent(request.Zip ?? global::System.Array.Empty()); __contentZip.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -170,7 +195,9 @@ request.Zipname is null { __contentZip.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -212,6 +239,8 @@ request.Zipname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -222,6 +251,11 @@ request.Zipname is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -239,6 +273,8 @@ request.Zipname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -248,8 +284,7 @@ request.Zipname is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +293,11 @@ request.Zipname is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -274,14 +314,15 @@ request.Zipname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -321,6 +362,8 @@ request.Zipname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -341,6 +384,8 @@ request.Zipname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -365,9 +410,13 @@ request.Zipname is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -395,9 +444,13 @@ request.Zipname is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -465,5 +518,840 @@ request.Zipname is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Bulk create pronunciations from ZIP
+ /// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. + ///
+ /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BulkCreatePronunciationsAsync( + global::System.IO.Stream zip, + string zipname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + zip = zip ?? throw new global::System.ArgumentNullException(nameof(zip)); + var request = new global::ResembleAI.BulkCreatePronunciationsRequest + { + Zip = global::System.Array.Empty(), + Zipname = zipname, + }; + PrepareArguments( + client: HttpClient); + PrepareBulkCreatePronunciationsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BulkCreatePronunciationsSecurityRequirements, + operationName: "BulkCreatePronunciationsAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/pronunciations/bulk", + baseUri: ResolveBaseUri( + servers: s_BulkCreatePronunciationsServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentZip = new global::System.Net.Http.StreamContent(zip); + __contentZip.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Zipname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Zipname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentZip, + name: "\"zip\"", + fileName: request.Zipname != null ? $"\"{request.Zipname}\"" : string.Empty); + if (__contentZip.Headers.ContentDisposition != null) + { + __contentZip.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBulkCreatePronunciationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBulkCreatePronunciationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBulkCreatePronunciationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Bulk create pronunciations from ZIP
+ /// Upload multiple pronunciations at once. Each audio file in the ZIP becomes a pronunciation — the filename (without extension) is used as the word. + ///
+ /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// + /// ZIP file containing audio files. Max 50 files, max 100MB total. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> BulkCreatePronunciationsAsResponseAsync( + global::System.IO.Stream zip, + string zipname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + zip = zip ?? throw new global::System.ArgumentNullException(nameof(zip)); + var request = new global::ResembleAI.BulkCreatePronunciationsRequest + { + Zip = global::System.Array.Empty(), + Zipname = zipname, + }; + PrepareArguments( + client: HttpClient); + PrepareBulkCreatePronunciationsArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BulkCreatePronunciationsSecurityRequirements, + operationName: "BulkCreatePronunciationsAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/pronunciations/bulk", + baseUri: ResolveBaseUri( + servers: s_BulkCreatePronunciationsServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentZip = new global::System.Net.Http.StreamContent(zip); + __contentZip.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Zipname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Zipname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentZip, + name: "\"zip\"", + fileName: request.Zipname != null ? $"\"{request.Zipname}\"" : string.Empty); + if (__contentZip.Headers.ContentDisposition != null) + { + __contentZip.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBulkCreatePronunciationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBulkCreatePronunciationsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkCreatePronunciations", + methodName: "BulkCreatePronunciationsAsync", + pathTemplate: "\"/pronunciations/bulk\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBulkCreatePronunciationsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.CustomPronunciationsBulkCreatePronunciationsResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.CreatePronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.CreatePronunciation.g.cs index 073a4a1..cefdcef 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.CreatePronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.CreatePronunciation.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreatePronunciationResponseContent( /// public async global::System.Threading.Tasks.Task CreatePronunciationAsync( + global::ResembleAI.CreatePronunciationRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreatePronunciationAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create custom pronunciation
+ /// Upload a single pronunciation with a reference audio file. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreatePronunciationAsResponseAsync( + global::ResembleAI.CreatePronunciationRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,10 +117,11 @@ partial void ProcessCreatePronunciationResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/pronunciations", baseUri: ResolveBaseUri( @@ -132,10 +156,12 @@ partial void ProcessCreatePronunciationResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Word ?? string.Empty), name: "\"word\""); + var __contentAudio = new global::System.Net.Http.ByteArrayContent(request.Audio ?? global::System.Array.Empty()); __contentAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( request.Audioname is null @@ -173,7 +199,9 @@ request.Audioname is null { __contentAudio.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -215,6 +243,8 @@ request.Audioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -225,6 +255,11 @@ request.Audioname is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -242,6 +277,8 @@ request.Audioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -251,8 +288,7 @@ request.Audioname is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -261,6 +297,11 @@ request.Audioname is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -277,14 +318,15 @@ request.Audioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +366,8 @@ request.Audioname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -344,6 +388,8 @@ request.Audioname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation error (e.g., duplicate word) @@ -406,9 +452,13 @@ request.Audioname is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -436,9 +486,13 @@ request.Audioname is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,5 +565,934 @@ request.Audioname is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create custom pronunciation
+ /// Upload a single pronunciation with a reference audio file. + ///
+ /// + /// The word or phrase (2-100 characters). Letters, accented characters, apostrophes, hyphens, and spaces only. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreatePronunciationAsync( + string word, + global::System.IO.Stream audio, + string audioname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + audio = audio ?? throw new global::System.ArgumentNullException(nameof(audio)); + var request = new global::ResembleAI.CreatePronunciationRequest + { + Word = word, + Audio = global::System.Array.Empty(), + Audioname = audioname, + }; + PrepareArguments( + client: HttpClient); + PrepareCreatePronunciationArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreatePronunciationSecurityRequirements, + operationName: "CreatePronunciationAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/pronunciations", + baseUri: ResolveBaseUri( + servers: s_CreatePronunciationServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Word ?? string.Empty), + name: "\"word\""); + + var __contentAudio = new global::System.Net.Http.StreamContent(audio); + __contentAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Audioname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Audioname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentAudio, + name: "\"audio\"", + fileName: request.Audioname != null ? $"\"{request.Audioname}\"" : string.Empty); + if (__contentAudio.Headers.ContentDisposition != null) + { + __contentAudio.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreatePronunciationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreatePronunciationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation error (e.g., duplicate word) + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::ResembleAI.Error? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::ResembleAI.ApiException( + 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( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreatePronunciationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create custom pronunciation
+ /// Upload a single pronunciation with a reference audio file. + ///
+ /// + /// The word or phrase (2-100 characters). Letters, accented characters, apostrophes, hyphens, and spaces only. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// + /// Reference audio file (wav, flac, mp3, m4a, ogg, webm, aac). Duration 200ms-10s. Max 10MB. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreatePronunciationAsResponseAsync( + string word, + global::System.IO.Stream audio, + string audioname, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + audio = audio ?? throw new global::System.ArgumentNullException(nameof(audio)); + var request = new global::ResembleAI.CreatePronunciationRequest + { + Word = word, + Audio = global::System.Array.Empty(), + Audioname = audioname, + }; + PrepareArguments( + client: HttpClient); + PrepareCreatePronunciationArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreatePronunciationSecurityRequirements, + operationName: "CreatePronunciationAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/pronunciations", + baseUri: ResolveBaseUri( + servers: s_CreatePronunciationServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Word ?? string.Empty), + name: "\"word\""); + + var __contentAudio = new global::System.Net.Http.StreamContent(audio); + __contentAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Audioname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Audioname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentAudio, + name: "\"audio\"", + fileName: request.Audioname != null ? $"\"{request.Audioname}\"" : string.Empty); + if (__contentAudio.Headers.ContentDisposition != null) + { + __contentAudio.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreatePronunciationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreatePronunciationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePronunciation", + methodName: "CreatePronunciationAsync", + pathTemplate: "\"/pronunciations\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation error (e.g., duplicate word) + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::ResembleAI.Error? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::ResembleAI.ApiException( + 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( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreatePronunciationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.CustomPronunciationsCreatePronunciationResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.DeletePronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.DeletePronunciation.g.cs index b0fbffb..aad581e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.DeletePronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.DeletePronunciation.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeletePronunciationResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeletePronunciationAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete custom pronunciation
+ /// Permanently remove a custom pronunciation. Takes effect immediately. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeletePronunciationAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeletePronunciationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/pronunciations/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeletePronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeletePronunciationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeletePronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeletePronunciationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeletePronunciationResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeletePronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeletePronunciationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeletePronunciationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeletePronunciationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.CustomPronunciationsDeletePronunciationResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.CustomPronunciationsDeletePronunciationResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeletePronunciationResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.CustomPronunciationsDeletePronunciationResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.CustomPronunciationsDeletePronunciationResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.GetPronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.GetPronunciation.g.cs index aa058d4..07dd5c8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.GetPronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.GetPronunciation.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetPronunciationResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetPronunciationAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get custom pronunciation
+ /// Retrieve a single custom pronunciation by UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetPronunciationAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetPronunciationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/pronunciations/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetPronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetPronunciationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetPronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetPronunciationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetPronunciationResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetPronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetPronunciationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetPronunciationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Not found @@ -361,9 +401,13 @@ partial void ProcessGetPronunciationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.CustomPronunciationsGetPronunciationResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.CustomPronunciationsGetPronunciationResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessGetPronunciationResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.CustomPronunciationsGetPronunciationResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.CustomPronunciationsGetPronunciationResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.ListPronunciations.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.ListPronunciations.g.cs index f23603e..8ab9ac3 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.ListPronunciations.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.ListPronunciations.g.cs @@ -78,6 +78,36 @@ partial void ProcessListPronunciationsResponseContent( bool? active = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListPronunciationsAsResponseAsync( + language: language, + domain: domain, + status: status, + active: active, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List custom pronunciations
+ /// Retrieve all custom pronunciations for your team, with optional filters. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListPronunciationsAsResponseAsync( + string? language = default, + string? domain = default, + global::ResembleAI.PronunciationsGetParametersStatus? status = default, + bool? active = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,16 +140,17 @@ partial void ProcessListPronunciationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/pronunciations", baseUri: ResolveBaseUri( servers: s_ListPronunciationsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddOptionalParameter("language", language) .AddOptionalParameter("domain", domain) .AddOptionalParameter("status", status?.ToValueString()) - .AddOptionalParameter("active", active?.ToString().ToLowerInvariant()) + .AddOptionalParameter("active", active?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -194,6 +225,8 @@ partial void ProcessListPronunciationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +237,11 @@ partial void ProcessListPronunciationsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +259,8 @@ partial void ProcessListPronunciationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +270,7 @@ partial void ProcessListPronunciationsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +279,11 @@ partial void ProcessListPronunciationsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +300,15 @@ partial void ProcessListPronunciationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +348,8 @@ partial void ProcessListPronunciationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +370,8 @@ partial void ProcessListPronunciationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -347,9 +396,13 @@ partial void ProcessListPronunciationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.CustomPronunciationsListPronunciationsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.CustomPronunciationsListPronunciationsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -377,9 +430,13 @@ partial void ProcessListPronunciationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.CustomPronunciationsListPronunciationsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.CustomPronunciationsListPronunciationsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs index 334f6e9..d8cf68a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.UpdatePronunciation.g.cs @@ -68,6 +68,32 @@ partial void ProcessUpdatePronunciationResponseContent( public async global::System.Threading.Tasks.Task UpdatePronunciationAsync( global::System.Guid uuid, + global::ResembleAI.UpdatePronunciationRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdatePronunciationAsResponseAsync( + uuid: uuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Toggle pronunciation active status
+ /// Enable or disable a pronunciation without deleting it. Inactive pronunciations are not used during synthesis. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdatePronunciationAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.UpdatePronunciationRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessUpdatePronunciationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/pronunciations/{uuid}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessUpdatePronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessUpdatePronunciationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessUpdatePronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessUpdatePronunciationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessUpdatePronunciationResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessUpdatePronunciationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessUpdatePronunciationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessUpdatePronunciationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessUpdatePronunciationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.CustomPronunciationsUpdatePronunciationResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.CustomPronunciationsUpdatePronunciationResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessUpdatePronunciationResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.CustomPronunciationsUpdatePronunciationResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.CustomPronunciationsUpdatePronunciationResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.g.cs index a0bef9b..50a115a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageCustomPronunciationsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageCustomPronunciationsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageCustomPronunciationsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs index d5f8e73..845e3ef 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetectBatch.g.cs @@ -79,6 +79,44 @@ partial void ProcessCreateDetectBatchResponseContent( /// public async global::System.Threading.Tasks.Task CreateDetectBatchAsync( + global::ResembleAI.CreateDetectBatchRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDetectBatchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a batch deepfake detection job
+ /// Submit up to 50 files in a single request and process them as a single logical
+ /// group. Returns HTTP 202 with a batch UUID; each file is analyzed in the
+ /// background and individual results are available via `GET /detect/{uuid}` for
+ /// each entry in `detect_uuids`.
+ /// Two intake methods:
+ /// - **Multiple media files** — repeated `files[]` form fields.
+ /// - **Single zip archive** — a single `file` form field whose value is a `.zip`
+ /// containing the media files. Non-media entries are skipped.
+ /// Provide one of `files[]` or `file=<...>.zip` per request. Synchronous mode
+ /// (`Prefer: wait`) is not supported and returns 400 if sent.
+ /// Constraints:
+ /// - Maximum 50 files per batch.
+ /// - Maximum 500 MB total upload size across all files.
+ /// - Allowed file types match `POST /detect`'s direct-upload allowlist.
+ /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
+ /// for every file, the request is rejected with 402 and no detects are created. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDetectBatchAsResponseAsync( + global::ResembleAI.CreateDetectBatchRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -109,10 +147,11 @@ partial void ProcessCreateDetectBatchResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/detect/batch", baseUri: ResolveBaseUri( @@ -147,6 +186,7 @@ partial void ProcessCreateDetectBatchResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); if (request.Files != default) { @@ -164,7 +204,8 @@ partial void ProcessCreateDetectBatchResponseContent( __contentFiles.Headers.ContentDisposition.FileNameStar = null; } } - } + + } if (request.File != default) { @@ -205,85 +246,99 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } - } + + } if (request.CallbackUrl != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty), name: "\"callback_url\""); - } + + } if (request.Intelligence != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Intelligence, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"intelligence\""); - } + + } if (request.SearchIdentity != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.SearchIdentity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"search_identity\""); - } + + } if (request.Visualize != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Visualize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"visualize\""); - } + + } if (request.AudioSourceTracingEnabled != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AudioSourceTracingEnabled, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"audio_source_tracing_enabled\""); - } + + } if (request.FrameLength != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrameLength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"frame_length\""); - } + + } if (request.StartRegion != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.StartRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"start_region\""); - } + + } if (request.EndRegion != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EndRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"end_region\""); - } + + } if (request.MaxVideoSecs != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxVideoSecs, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"max_video_secs\""); - } + + } if (request.UseLlm != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseLlm, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"use_llm\""); - } + + } if (request.ZeroRetentionMode != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"zero_retention_mode\""); + } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -325,6 +380,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -335,6 +392,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -352,6 +414,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -361,8 +425,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -371,6 +434,11 @@ request.Filename is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -387,14 +455,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -434,6 +503,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -454,6 +525,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid batch request (missing files, both file and files[] supplied, file count or size exceeded, unsupported file type, or `Prefer: wait` header sent) @@ -592,9 +665,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -622,9 +699,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -772,5 +853,1520 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create a batch deepfake detection job
+ /// Submit up to 50 files in a single request and process them as a single logical
+ /// group. Returns HTTP 202 with a batch UUID; each file is analyzed in the
+ /// background and individual results are available via `GET /detect/{uuid}` for
+ /// each entry in `detect_uuids`.
+ /// Two intake methods:
+ /// - **Multiple media files** — repeated `files[]` form fields.
+ /// - **Single zip archive** — a single `file` form field whose value is a `.zip`
+ /// containing the media files. Non-media entries are skipped.
+ /// Provide one of `files[]` or `file=<...>.zip` per request. Synchronous mode
+ /// (`Prefer: wait`) is not supported and returns 400 if sent.
+ /// Constraints:
+ /// - Maximum 50 files per batch.
+ /// - Maximum 500 MB total upload size across all files.
+ /// - Allowed file types match `POST /detect`'s direct-upload allowlist.
+ /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
+ /// for every file, the request is rejected with 402 and no detects are created. + ///
+ /// + /// One or more media files. Repeat the `files[]` field for each file. Mutually exclusive with `file`. + /// + /// + /// Optional file names to use for the multipart 'files[]' file parts. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// POST destination invoked when the batch reaches a terminal state. + /// + /// + /// Run multimodal intelligence on every file in the batch.
+ /// Default Value: false + /// + /// + /// Run identity search against the team's saved identities (audio/video only).
+ /// Default Value: false + /// + /// + /// Generate visualization artifacts.
+ /// Default Value: true + /// + /// + /// Enable audio source tracing on each audio file.
+ /// Default Value: false + /// + /// + /// Window size in seconds (audio/video). + /// + /// + /// Start of segment to analyze (seconds). + /// + /// + /// End of segment to analyze (seconds). + /// + /// + /// Cap processed video duration. + /// + /// + /// Use LLM-assisted video analysis. + /// + /// + /// Enable Zero Retention Mode for every file in the batch.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateDetectBatchAsync( + global::System.Collections.Generic.IReadOnlyList? files = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::System.IO.Stream? file = default, + string? filename = default, + string? callbackUrl = default, + bool? intelligence = default, + bool? searchIdentity = default, + bool? visualize = default, + bool? audioSourceTracingEnabled = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + bool? useLlm = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + var request = new global::ResembleAI.CreateDetectBatchRequest + { + Files = new global::System.Collections.Generic.List(), + File = global::System.Array.Empty(), + Filename = filename, + CallbackUrl = callbackUrl, + Intelligence = intelligence, + SearchIdentity = searchIdentity, + Visualize = visualize, + AudioSourceTracingEnabled = audioSourceTracingEnabled, + FrameLength = frameLength, + StartRegion = startRegion, + EndRegion = endRegion, + MaxVideoSecs = maxVideoSecs, + UseLlm = useLlm, + ZeroRetentionMode = zeroRetentionMode, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateDetectBatchArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDetectBatchSecurityRequirements, + operationName: "CreateDetectBatchAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/detect/batch", + baseUri: ResolveBaseUri( + servers: s_CreateDetectBatchServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (files != default) + { + + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files[]\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (file != default) + { + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.CallbackUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty), + name: "\"callback_url\""); + + } + if (request.Intelligence != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Intelligence, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"intelligence\""); + + } + if (request.SearchIdentity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.SearchIdentity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"search_identity\""); + + } + if (request.Visualize != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Visualize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"visualize\""); + + } + if (request.AudioSourceTracingEnabled != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AudioSourceTracingEnabled, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"audio_source_tracing_enabled\""); + + } + if (request.FrameLength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrameLength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"frame_length\""); + + } + if (request.StartRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.StartRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"start_region\""); + + } + if (request.EndRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EndRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"end_region\""); + + } + if (request.MaxVideoSecs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxVideoSecs, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"max_video_secs\""); + + } + if (request.UseLlm != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseLlm, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"use_llm\""); + + } + if (request.ZeroRetentionMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"zero_retention_mode\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDetectBatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateDetectBatchResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid batch request (missing files, both file and files[] supplied, file count or size exceeded, unsupported file type, or `Prefer: wait` header sent) + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Insufficient balance for the projected batch cost. Response `details` includes per-file estimates. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::ResembleAI.Error? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::ResembleAI.Error.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::ResembleAI.Error.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + statusCode: __response.StatusCode) + { + ResponseBody = __content_402, + ResponseObject = __value_402, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Intelligence detect limit reached (Default plan). + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ResembleAI.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ResembleAI.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ResembleAI.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDetectBatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a batch deepfake detection job
+ /// Submit up to 50 files in a single request and process them as a single logical
+ /// group. Returns HTTP 202 with a batch UUID; each file is analyzed in the
+ /// background and individual results are available via `GET /detect/{uuid}` for
+ /// each entry in `detect_uuids`.
+ /// Two intake methods:
+ /// - **Multiple media files** — repeated `files[]` form fields.
+ /// - **Single zip archive** — a single `file` form field whose value is a `.zip`
+ /// containing the media files. Non-media entries are skipped.
+ /// Provide one of `files[]` or `file=<...>.zip` per request. Synchronous mode
+ /// (`Prefer: wait`) is not supported and returns 400 if sent.
+ /// Constraints:
+ /// - Maximum 50 files per batch.
+ /// - Maximum 500 MB total upload size across all files.
+ /// - Allowed file types match `POST /detect`'s direct-upload allowlist.
+ /// - All-or-nothing billing: if the team's wallet cannot cover the projected cost
+ /// for every file, the request is rejected with 402 and no detects are created. + ///
+ /// + /// One or more media files. Repeat the `files[]` field for each file. Mutually exclusive with `file`. + /// + /// + /// Optional file names to use for the multipart 'files[]' file parts. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// A single `.zip` archive containing media files. Mutually exclusive with `files[]`. + /// + /// + /// POST destination invoked when the batch reaches a terminal state. + /// + /// + /// Run multimodal intelligence on every file in the batch.
+ /// Default Value: false + /// + /// + /// Run identity search against the team's saved identities (audio/video only).
+ /// Default Value: false + /// + /// + /// Generate visualization artifacts.
+ /// Default Value: true + /// + /// + /// Enable audio source tracing on each audio file.
+ /// Default Value: false + /// + /// + /// Window size in seconds (audio/video). + /// + /// + /// Start of segment to analyze (seconds). + /// + /// + /// End of segment to analyze (seconds). + /// + /// + /// Cap processed video duration. + /// + /// + /// Use LLM-assisted video analysis. + /// + /// + /// Enable Zero Retention Mode for every file in the batch.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDetectBatchAsResponseAsync( + global::System.Collections.Generic.IReadOnlyList? files = default, + global::System.Collections.Generic.IReadOnlyList? filesFileNames = default, + global::System.IO.Stream? file = default, + string? filename = default, + string? callbackUrl = default, + bool? intelligence = default, + bool? searchIdentity = default, + bool? visualize = default, + bool? audioSourceTracingEnabled = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + bool? useLlm = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + var request = new global::ResembleAI.CreateDetectBatchRequest + { + Files = new global::System.Collections.Generic.List(), + File = global::System.Array.Empty(), + Filename = filename, + CallbackUrl = callbackUrl, + Intelligence = intelligence, + SearchIdentity = searchIdentity, + Visualize = visualize, + AudioSourceTracingEnabled = audioSourceTracingEnabled, + FrameLength = frameLength, + StartRegion = startRegion, + EndRegion = endRegion, + MaxVideoSecs = maxVideoSecs, + UseLlm = useLlm, + ZeroRetentionMode = zeroRetentionMode, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateDetectBatchArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDetectBatchSecurityRequirements, + operationName: "CreateDetectBatchAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/detect/batch", + baseUri: ResolveBaseUri( + servers: s_CreateDetectBatchServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (files != default) + { + + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files[]\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + } + if (file != default) + { + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.CallbackUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty), + name: "\"callback_url\""); + + } + if (request.Intelligence != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Intelligence, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"intelligence\""); + + } + if (request.SearchIdentity != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.SearchIdentity, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"search_identity\""); + + } + if (request.Visualize != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Visualize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"visualize\""); + + } + if (request.AudioSourceTracingEnabled != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AudioSourceTracingEnabled, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"audio_source_tracing_enabled\""); + + } + if (request.FrameLength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrameLength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"frame_length\""); + + } + if (request.StartRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.StartRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"start_region\""); + + } + if (request.EndRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EndRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"end_region\""); + + } + if (request.MaxVideoSecs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxVideoSecs, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"max_video_secs\""); + + } + if (request.UseLlm != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseLlm, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"use_llm\""); + + } + if (request.ZeroRetentionMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"zero_retention_mode\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDetectBatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateDetectBatchResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetectBatch", + methodName: "CreateDetectBatchAsync", + pathTemplate: "\"/detect/batch\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid batch request (missing files, both file and files[] supplied, file count or size exceeded, unsupported file type, or `Prefer: wait` header sent) + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Insufficient balance for the projected batch cost. Response `details` includes per-file estimates. + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::ResembleAI.Error? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::ResembleAI.Error.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::ResembleAI.Error.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + statusCode: __response.StatusCode) + { + ResponseBody = __content_402, + ResponseObject = __value_402, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Intelligence detect limit reached (Default plan). + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::ResembleAI.Error? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::ResembleAI.Error.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::ResembleAI.Error.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDetectBatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.DeepfakeDetectionCreateDetectBatchResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetection.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetection.g.cs index 770bf50..5d9eca6 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetection.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.CreateDetection.g.cs @@ -69,6 +69,34 @@ partial void ProcessCreateDetectionResponseContent( /// public async global::System.Threading.Tasks.Task CreateDetectionAsync( + global::ResembleAI.CreateDetectionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDetectionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create deepfake detection
+ /// Analyze audio, image, and video for deepfake detection.
+ /// Supply media via one of three intake methods:
+ /// - **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
+ /// - **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
+ /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
+ /// Exactly one of `file`, `url`, or `media_token` must be provided per request. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDetectionAsResponseAsync( + global::ResembleAI.CreateDetectionRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -99,10 +127,11 @@ partial void ProcessCreateDetectionResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/detect", baseUri: ResolveBaseUri( @@ -137,6 +166,7 @@ partial void ProcessCreateDetectionResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -175,91 +205,106 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + if (request.CallbackUrl != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty), name: "\"callback_url\""); - } + + } if (request.Visualize != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Visualize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"visualize\""); - } + + } if (request.FrameLength != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrameLength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"frame_length\""); - } + + } if (request.StartRegion != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.StartRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"start_region\""); - } + + } if (request.EndRegion != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EndRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"end_region\""); - } + + } if (request.MaxVideoSecs != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxVideoSecs, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"max_video_secs\""); - } + + } if (request.ModelTypes != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((request.ModelTypes).HasValue ? (request.ModelTypes).GetValueOrDefault().ToValueString() : string.Empty), name: "\"model_types\""); - } + + } if (request.Intelligence != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Intelligence, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"intelligence\""); - } + + } if (request.AudioSourceTracing != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AudioSourceTracing, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"audio_source_tracing\""); - } + + } if (request.UseReverseSearch != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseReverseSearch, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"use_reverse_search\""); - } + + } if (request.UseOodDetector != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseOodDetector, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"use_ood_detector\""); - } + + } if (request.ZeroRetentionMode != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"zero_retention_mode\""); + } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -301,6 +346,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -311,6 +358,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -328,6 +380,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -337,8 +391,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -347,6 +400,11 @@ request.Filename is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -363,14 +421,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -410,6 +469,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -430,6 +491,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -454,9 +517,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -484,9 +551,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -625,5 +696,1176 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create deepfake detection
+ /// Analyze audio, image, and video for deepfake detection.
+ /// Supply media via one of three intake methods:
+ /// - **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
+ /// - **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
+ /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
+ /// Exactly one of `file`, `url`, or `media_token` must be provided per request. + ///
+ /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// POST destination when analysis completes + /// + /// + /// Generate visualization artifacts + /// + /// + /// Window size in seconds (audio/video)
+ /// Default Value: 2 + /// + /// + /// Start of segment to analyze (seconds) + /// + /// + /// End of segment to analyze (seconds) + /// + /// + /// Cap processed duration + /// + /// + /// Use talking_head for face-swaps + /// + /// + /// Run multimodal intelligence analysis on the media
+ /// Default Value: false + /// + /// + /// Enable audio source tracing to identify synthetic audio origin
+ /// Default Value: false + /// + /// + /// Enable reverse image search to improve detection accuracy for image files. Only applies to image detections.
+ /// Default Value: false + /// + /// + /// Enable out-of-distribution detection
+ /// Default Value: false + /// + /// + /// Enable Zero Retention Mode to automatically delete submitted media after detection completes.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateDetectionAsync( + global::System.IO.Stream file, + string filename, + string? callbackUrl = default, + bool? visualize = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + global::ResembleAI.DetectPostRequestBodyContentMultipartFormDataSchemaModelTypes? modelTypes = default, + bool? intelligence = default, + bool? audioSourceTracing = default, + bool? useReverseSearch = default, + bool? useOodDetector = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ResembleAI.CreateDetectionRequest + { + File = global::System.Array.Empty(), + Filename = filename, + CallbackUrl = callbackUrl, + Visualize = visualize, + FrameLength = frameLength, + StartRegion = startRegion, + EndRegion = endRegion, + MaxVideoSecs = maxVideoSecs, + ModelTypes = modelTypes, + Intelligence = intelligence, + AudioSourceTracing = audioSourceTracing, + UseReverseSearch = useReverseSearch, + UseOodDetector = useOodDetector, + ZeroRetentionMode = zeroRetentionMode, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateDetectionArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDetectionSecurityRequirements, + operationName: "CreateDetectionAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/detect", + baseUri: ResolveBaseUri( + servers: s_CreateDetectionServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.CallbackUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty), + name: "\"callback_url\""); + + } + if (request.Visualize != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Visualize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"visualize\""); + + } + if (request.FrameLength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrameLength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"frame_length\""); + + } + if (request.StartRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.StartRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"start_region\""); + + } + if (request.EndRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EndRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"end_region\""); + + } + if (request.MaxVideoSecs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxVideoSecs, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"max_video_secs\""); + + } + if (request.ModelTypes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ModelTypes).HasValue ? (request.ModelTypes).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"model_types\""); + + } + if (request.Intelligence != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Intelligence, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"intelligence\""); + + } + if (request.AudioSourceTracing != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AudioSourceTracing, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"audio_source_tracing\""); + + } + if (request.UseReverseSearch != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseReverseSearch, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"use_reverse_search\""); + + } + if (request.UseOodDetector != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseOodDetector, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"use_ood_detector\""); + + } + if (request.ZeroRetentionMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"zero_retention_mode\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDetectionRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateDetectionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDetectionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create deepfake detection
+ /// Analyze audio, image, and video for deepfake detection.
+ /// Supply media via one of three intake methods:
+ /// - **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
+ /// - **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
+ /// - **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.
+ /// Exactly one of `file`, `url`, or `media_token` must be provided per request. + ///
+ /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// The media file to analyze (audio, video, or image). Must be 150 MB or smaller. + /// + /// + /// POST destination when analysis completes + /// + /// + /// Generate visualization artifacts + /// + /// + /// Window size in seconds (audio/video)
+ /// Default Value: 2 + /// + /// + /// Start of segment to analyze (seconds) + /// + /// + /// End of segment to analyze (seconds) + /// + /// + /// Cap processed duration + /// + /// + /// Use talking_head for face-swaps + /// + /// + /// Run multimodal intelligence analysis on the media
+ /// Default Value: false + /// + /// + /// Enable audio source tracing to identify synthetic audio origin
+ /// Default Value: false + /// + /// + /// Enable reverse image search to improve detection accuracy for image files. Only applies to image detections.
+ /// Default Value: false + /// + /// + /// Enable out-of-distribution detection
+ /// Default Value: false + /// + /// + /// Enable Zero Retention Mode to automatically delete submitted media after detection completes.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDetectionAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? callbackUrl = default, + bool? visualize = default, + int? frameLength = default, + double? startRegion = default, + double? endRegion = default, + double? maxVideoSecs = default, + global::ResembleAI.DetectPostRequestBodyContentMultipartFormDataSchemaModelTypes? modelTypes = default, + bool? intelligence = default, + bool? audioSourceTracing = default, + bool? useReverseSearch = default, + bool? useOodDetector = default, + bool? zeroRetentionMode = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ResembleAI.CreateDetectionRequest + { + File = global::System.Array.Empty(), + Filename = filename, + CallbackUrl = callbackUrl, + Visualize = visualize, + FrameLength = frameLength, + StartRegion = startRegion, + EndRegion = endRegion, + MaxVideoSecs = maxVideoSecs, + ModelTypes = modelTypes, + Intelligence = intelligence, + AudioSourceTracing = audioSourceTracing, + UseReverseSearch = useReverseSearch, + UseOodDetector = useOodDetector, + ZeroRetentionMode = zeroRetentionMode, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateDetectionArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDetectionSecurityRequirements, + operationName: "CreateDetectionAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/detect", + baseUri: ResolveBaseUri( + servers: s_CreateDetectionServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.CallbackUrl != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.CallbackUrl ?? string.Empty), + name: "\"callback_url\""); + + } + if (request.Visualize != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Visualize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"visualize\""); + + } + if (request.FrameLength != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.FrameLength, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"frame_length\""); + + } + if (request.StartRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.StartRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"start_region\""); + + } + if (request.EndRegion != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.EndRegion, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"end_region\""); + + } + if (request.MaxVideoSecs != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.MaxVideoSecs, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"max_video_secs\""); + + } + if (request.ModelTypes != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.ModelTypes).HasValue ? (request.ModelTypes).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"model_types\""); + + } + if (request.Intelligence != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Intelligence, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"intelligence\""); + + } + if (request.AudioSourceTracing != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AudioSourceTracing, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"audio_source_tracing\""); + + } + if (request.UseReverseSearch != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseReverseSearch, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"use_reverse_search\""); + + } + if (request.UseOodDetector != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.UseOodDetector, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"use_ood_detector\""); + + } + if (request.ZeroRetentionMode != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.ZeroRetentionMode, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"zero_retention_mode\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDetectionRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateDetectionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDetection", + methodName: "CreateDetectionAsync", + pathTemplate: "\"/detect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDetectionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.DeepfakeDetectionCreateDetectionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs index 2cbd24b..a5770f0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetectBatch.g.cs @@ -69,6 +69,30 @@ partial void ProcessGetDetectBatchResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDetectBatchAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get batch status
+ /// Retrieve the latest aggregate status for a batch. The response shape mirrors
+ /// the create response — `status`, `completed_count`, and `failed_count` update
+ /// as child detects progress. Use the `detect_uuids` array to fetch per-file
+ /// results via `GET /detect/{uuid}`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetDetectBatchAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -98,6 +122,7 @@ partial void ProcessGetDetectBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/detect/batch/{uuid}", baseUri: ResolveBaseUri( @@ -173,6 +198,8 @@ partial void ProcessGetDetectBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +210,11 @@ partial void ProcessGetDetectBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +232,8 @@ partial void ProcessGetDetectBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +243,7 @@ partial void ProcessGetDetectBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +252,11 @@ partial void ProcessGetDetectBatchResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +273,15 @@ partial void ProcessGetDetectBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +321,8 @@ partial void ProcessGetDetectBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +343,8 @@ partial void ProcessGetDetectBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Batch not found (or not accessible by the authenticated team). @@ -364,9 +407,13 @@ partial void ProcessGetDetectBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DeepfakeDetectionGetDetectBatchResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DeepfakeDetectionGetDetectBatchResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -394,9 +441,13 @@ partial void ProcessGetDetectBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DeepfakeDetectionGetDetectBatchResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DeepfakeDetectionGetDetectBatchResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetection.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetection.g.cs index 0b7d874..625d750 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetection.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.GetDetection.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetDetectionResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDetectionAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get deepfake detection result
+ /// Get deepfake detection result by UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetDetectionAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetDetectionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/detect/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetDetectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetDetectionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetDetectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetDetectionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetDetectionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetDetectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetDetectionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetDetectionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Detect not found @@ -361,9 +401,13 @@ partial void ProcessGetDetectionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DeepfakeDetectionGetDetectionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DeepfakeDetectionGetDetectionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessGetDetectionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DeepfakeDetectionGetDetectionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DeepfakeDetectionGetDetectionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.ListDetections.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.ListDetections.g.cs index c1125f6..14fe0eb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.ListDetections.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.ListDetections.g.cs @@ -72,6 +72,32 @@ partial void ProcessListDetectionsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDetectionsAsResponseAsync( + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all detects
+ /// Retrieve a paginated list of all detect objects for the authenticated user's team + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListDetectionsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,14 +128,15 @@ partial void ProcessListDetectionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/detect", baseUri: ResolveBaseUri( servers: s_ListDetectionsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -182,6 +209,8 @@ partial void ProcessListDetectionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +221,11 @@ partial void ProcessListDetectionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +243,8 @@ partial void ProcessListDetectionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +254,7 @@ partial void ProcessListDetectionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +263,11 @@ partial void ProcessListDetectionsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +284,15 @@ partial void ProcessListDetectionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +332,8 @@ partial void ProcessListDetectionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +354,8 @@ partial void ProcessListDetectionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -335,9 +380,13 @@ partial void ProcessListDetectionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DeepfakeDetectionListDetectionsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DeepfakeDetectionListDetectionsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -365,9 +414,13 @@ partial void ProcessListDetectionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DeepfakeDetectionListDetectionsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DeepfakeDetectionListDetectionsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.g.cs index 0f8f945..512b496 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDeepfakeDetectionClient.g.cs @@ -103,10 +103,10 @@ public SubpackageDeepfakeDetectionClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageDeepfakeDetectionClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs index 9ac7ee3..29cf508 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.AskDetectIntelligenceQuestion.g.cs @@ -68,6 +68,32 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( public async global::System.Threading.Tasks.Task AskDetectIntelligenceQuestionAsync( string uuid, + global::ResembleAI.AskDetectIntelligenceQuestionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AskDetectIntelligenceQuestionAsResponseAsync( + uuid: uuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ask a question about a detection
+ /// Submit a natural-language question about a completed detection report. Returns 202 Accepted while the answer is generated in the background. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AskDetectIntelligenceQuestionAsResponseAsync( + string uuid, + global::ResembleAI.AskDetectIntelligenceQuestionRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/detects/{uuid}/intelligence", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request (missing query) @@ -452,9 +497,13 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DetectIntelligenceAskDetectIntelligenceQuestionResponse202.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DetectIntelligenceAskDetectIntelligenceQuestionResponse202.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -482,9 +531,13 @@ partial void ProcessAskDetectIntelligenceQuestionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DetectIntelligenceAskDetectIntelligenceQuestionResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DetectIntelligenceAskDetectIntelligenceQuestionResponse202.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs index ca575a9..3cb6b2d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.GetDetectIntelligenceQuestion.g.cs @@ -70,6 +70,30 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( string questionUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDetectIntelligenceQuestionAsResponseAsync( + uuid: uuid, + questionUuid: questionUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get answer to a detection question
+ /// Retrieve the status and answer for a previously submitted question. Poll until status is completed or failed. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetDetectIntelligenceQuestionAsResponseAsync( + string uuid, + string questionUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/detects/{uuid}/intelligence/{questionUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Question not found @@ -367,9 +410,13 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DetectIntelligenceGetDetectIntelligenceQuestionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DetectIntelligenceGetDetectIntelligenceQuestionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,9 +444,13 @@ partial void ProcessGetDetectIntelligenceQuestionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DetectIntelligenceGetDetectIntelligenceQuestionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DetectIntelligenceGetDetectIntelligenceQuestionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.g.cs index e9edaae..aeaa09d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDetectIntelligenceClient.g.cs @@ -103,10 +103,10 @@ public SubpackageDetectIntelligenceClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageDetectIntelligenceClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoice.g.cs index 37e1f75..7801bdf 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoice.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateDuetVoiceResponseContent( /// public async global::System.Threading.Tasks.Task CreateDuetVoiceAsync( + global::ResembleAI.CreateDuetVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDuetVoiceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create custom duet voice
+ /// Create a custom voice for duet generation + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDuetVoiceAsResponseAsync( + global::ResembleAI.CreateDuetVoiceRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,10 +117,11 @@ partial void ProcessCreateDuetVoiceResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/duet_voices", baseUri: ResolveBaseUri( @@ -132,16 +156,19 @@ partial void ProcessCreateDuetVoiceResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), name: "\"name\""); + if (request.StylePrompt != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.StylePrompt ?? string.Empty), name: "\"style_prompt\""); + } var __contentAudio = new global::System.Net.Http.ByteArrayContent(request.Audio ?? global::System.Array.Empty()); __contentAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -180,7 +207,9 @@ request.Audioname is null { __contentAudio.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -222,6 +251,8 @@ request.Audioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +263,11 @@ request.Audioname is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +285,8 @@ request.Audioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +296,7 @@ request.Audioname is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +305,11 @@ request.Audioname is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +326,15 @@ request.Audioname is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +374,8 @@ request.Audioname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +396,8 @@ request.Audioname is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -375,9 +422,13 @@ request.Audioname is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -405,9 +456,13 @@ request.Audioname is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -485,5 +540,884 @@ request.Audioname is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create custom duet voice
+ /// Create a custom voice for duet generation + ///
+ /// + /// Voice name + /// + /// + /// Optional style prompt + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateDuetVoiceAsync( + string name, + global::System.IO.Stream audio, + string audioname, + string? stylePrompt = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + audio = audio ?? throw new global::System.ArgumentNullException(nameof(audio)); + var request = new global::ResembleAI.CreateDuetVoiceRequest + { + Name = name, + StylePrompt = stylePrompt, + Audio = global::System.Array.Empty(), + Audioname = audioname, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateDuetVoiceArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDuetVoiceSecurityRequirements, + operationName: "CreateDuetVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/duet_voices", + baseUri: ResolveBaseUri( + servers: s_CreateDuetVoiceServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + if (request.StylePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.StylePrompt ?? string.Empty), + name: "\"style_prompt\""); + + } + var __contentAudio = new global::System.Net.Http.StreamContent(audio); + __contentAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Audioname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Audioname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentAudio, + name: "\"audio\"", + fileName: request.Audioname != null ? $"\"{request.Audioname}\"" : string.Empty); + if (__contentAudio.Headers.ContentDisposition != null) + { + __contentAudio.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDuetVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateDuetVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDuetVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create custom duet voice
+ /// Create a custom voice for duet generation + ///
+ /// + /// Voice name + /// + /// + /// Optional style prompt + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// + /// Audio file (MP3/WAV/M4A/OGG/AAC/FLAC max 10 MB) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDuetVoiceAsResponseAsync( + string name, + global::System.IO.Stream audio, + string audioname, + string? stylePrompt = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + audio = audio ?? throw new global::System.ArgumentNullException(nameof(audio)); + var request = new global::ResembleAI.CreateDuetVoiceRequest + { + Name = name, + StylePrompt = stylePrompt, + Audio = global::System.Array.Empty(), + Audioname = audioname, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateDuetVoiceArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDuetVoiceSecurityRequirements, + operationName: "CreateDuetVoiceAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/duet_voices", + baseUri: ResolveBaseUri( + servers: s_CreateDuetVoiceServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + if (request.StylePrompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.StylePrompt ?? string.Empty), + name: "\"style_prompt\""); + + } + var __contentAudio = new global::System.Net.Http.StreamContent(audio); + __contentAudio.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Audioname is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Audioname) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentAudio, + name: "\"audio\"", + fileName: request.Audioname != null ? $"\"{request.Audioname}\"" : string.Empty); + if (__contentAudio.Headers.ContentDisposition != null) + { + __contentAudio.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDuetVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateDuetVoiceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDuetVoice", + methodName: "CreateDuetVoiceAsync", + pathTemplate: "\"/duet_voices\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateDuetVoiceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.DuetsCreateDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoicePair.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoicePair.g.cs index 3822076..a6d605e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoicePair.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.CreateDuetVoicePair.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateDuetVoicePairResponseContent( /// public async global::System.Threading.Tasks.Task CreateDuetVoicePairAsync( + global::ResembleAI.CreateDuetVoicePairRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDuetVoicePairAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create duet voice pair
+ /// Create a voice pair for duet generation + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateDuetVoicePairAsResponseAsync( + global::ResembleAI.CreateDuetVoicePairRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateDuetVoicePairResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/duet_voice_pairs", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateDuetVoicePairResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateDuetVoicePairResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateDuetVoicePairResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateDuetVoicePairResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateDuetVoicePairResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateDuetVoicePairResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateDuetVoicePairResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateDuetVoicePairResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateDuetVoicePairResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsCreateDuetVoicePairResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsCreateDuetVoicePairResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateDuetVoicePairResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsCreateDuetVoicePairResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsCreateDuetVoicePairResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.DeleteDuetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.DeleteDuetVoice.g.cs index e08e71a..ae591fb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.DeleteDuetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.DeleteDuetVoice.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteDuetVoiceResponseContent( int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDuetVoiceAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete duet voice
+ /// Delete a custom duet voice (default voices cannot be deleted) + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteDuetVoiceAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteDuetVoiceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/duet_voices/{id}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteDuetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteDuetVoiceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteDuetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteDuetVoiceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteDuetVoiceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteDuetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteDuetVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteDuetVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeleteDuetVoiceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsDeleteDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsDeleteDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeleteDuetVoiceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsDeleteDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsDeleteDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.GenerateDuet.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.GenerateDuet.g.cs index 296a4e7..dd3940f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.GenerateDuet.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.GenerateDuet.g.cs @@ -64,6 +64,29 @@ partial void ProcessGenerateDuetResponseContent( /// public async global::System.Threading.Tasks.Task GenerateDuetAsync( + global::ResembleAI.GenerateDuetRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateDuetAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate duet
+ /// Generate conversational audio with two speakers + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerateDuetAsResponseAsync( + global::ResembleAI.GenerateDuetRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessGenerateDuetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/duet", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessGenerateDuetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessGenerateDuetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessGenerateDuetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessGenerateDuetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessGenerateDuetResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessGenerateDuetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessGenerateDuetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessGenerateDuetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessGenerateDuetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsGenerateDuetResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsGenerateDuetResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessGenerateDuetResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsGenerateDuetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsGenerateDuetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoicePairs.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoicePairs.g.cs index d554421..0bfbb6b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoicePairs.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoicePairs.g.cs @@ -62,6 +62,24 @@ partial void ProcessListDuetVoicePairsResponseContent( public async global::System.Threading.Tasks.Task ListDuetVoicePairsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDuetVoicePairsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List duet voice pairs
+ /// List all voice pairs for duet generation + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListDuetVoicePairsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessListDuetVoicePairsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/duet_voice_pairs", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessListDuetVoicePairsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessListDuetVoicePairsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessListDuetVoicePairsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessListDuetVoicePairsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessListDuetVoicePairsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessListDuetVoicePairsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessListDuetVoicePairsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessListDuetVoicePairsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessListDuetVoicePairsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsListDuetVoicePairsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsListDuetVoicePairsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessListDuetVoicePairsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsListDuetVoicePairsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsListDuetVoicePairsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoices.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoices.g.cs index 9e532e7..d908e47 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoices.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.ListDuetVoices.g.cs @@ -62,6 +62,24 @@ partial void ProcessListDuetVoicesResponseContent( public async global::System.Threading.Tasks.Task ListDuetVoicesAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDuetVoicesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List duet voices
+ /// Returns default and custom duet voices + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListDuetVoicesAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessListDuetVoicesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/duet_voices", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessListDuetVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessListDuetVoicesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessListDuetVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessListDuetVoicesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessListDuetVoicesResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessListDuetVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessListDuetVoicesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessListDuetVoicesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessListDuetVoicesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsListDuetVoicesResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsListDuetVoicesResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessListDuetVoicesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsListDuetVoicesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsListDuetVoicesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.UpdateDuetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.UpdateDuetVoice.g.cs index 4aa89eb..5b6c835 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.UpdateDuetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.UpdateDuetVoice.g.cs @@ -68,6 +68,32 @@ partial void ProcessUpdateDuetVoiceResponseContent( public async global::System.Threading.Tasks.Task UpdateDuetVoiceAsync( int id, + global::ResembleAI.UpdateDuetVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateDuetVoiceAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update duet voice
+ /// Update a custom duet voice (default voices cannot be modified) + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateDuetVoiceAsResponseAsync( + int id, + global::ResembleAI.UpdateDuetVoiceRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessUpdateDuetVoiceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/duet_voices/{id}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessUpdateDuetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessUpdateDuetVoiceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessUpdateDuetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessUpdateDuetVoiceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessUpdateDuetVoiceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessUpdateDuetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessUpdateDuetVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessUpdateDuetVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessUpdateDuetVoiceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.DuetsUpdateDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.DuetsUpdateDuetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessUpdateDuetVoiceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.DuetsUpdateDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.DuetsUpdateDuetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.g.cs index 9f1bba9..e9ef6fe 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageDuetsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageDuetsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageDuetsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.CreateIdentity.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.CreateIdentity.g.cs index 0cf15ea..ba3beec 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.CreateIdentity.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.CreateIdentity.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateIdentityResponseContent( /// public async global::System.Threading.Tasks.Task CreateIdentityAsync( + global::ResembleAI.CreateIdentityRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateIdentityAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create identity
+ /// Create a new speaker identity + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateIdentityAsResponseAsync( + global::ResembleAI.CreateIdentityRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateIdentityResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/identity", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateIdentityResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateIdentityResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateIdentityResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateIdentityResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateIdentityResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateIdentityResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateIdentityResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.IdentityCreateIdentityResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.IdentityCreateIdentityResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateIdentityResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.IdentityCreateIdentityResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.IdentityCreateIdentityResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.ListIdentities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.ListIdentities.g.cs index 2e81790..0173f3b 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.ListIdentities.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.ListIdentities.g.cs @@ -62,6 +62,24 @@ partial void ProcessListIdentitiesResponseContent( public async global::System.Threading.Tasks.Task ListIdentitiesAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListIdentitiesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List identities
+ /// List all speaker identities + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListIdentitiesAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessListIdentitiesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/identity", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessListIdentitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessListIdentitiesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessListIdentitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessListIdentitiesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessListIdentitiesResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessListIdentitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessListIdentitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessListIdentitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessListIdentitiesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.IdentityListIdentitiesResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.IdentityListIdentitiesResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessListIdentitiesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.IdentityListIdentitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.IdentityListIdentitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.SearchIdentities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.SearchIdentities.g.cs index ff515f3..23d7ab8 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.SearchIdentities.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.SearchIdentities.g.cs @@ -64,6 +64,29 @@ partial void ProcessSearchIdentitiesResponseContent( /// public async global::System.Threading.Tasks.Task SearchIdentitiesAsync( + global::ResembleAI.SearchIdentitiesRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchIdentitiesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search identities
+ /// Search for matching speaker identities + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SearchIdentitiesAsResponseAsync( + global::ResembleAI.SearchIdentitiesRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessSearchIdentitiesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/identity/search", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessSearchIdentitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessSearchIdentitiesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessSearchIdentitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessSearchIdentitiesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessSearchIdentitiesResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessSearchIdentitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessSearchIdentitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessSearchIdentitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessSearchIdentitiesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.IdentitySearchIdentitiesResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.IdentitySearchIdentitiesResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessSearchIdentitiesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.IdentitySearchIdentitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.IdentitySearchIdentitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.g.cs index cfd86fe..dd61328 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIdentityClient.g.cs @@ -103,10 +103,10 @@ public SubpackageIdentityClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageIdentityClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.GetIntelligence.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.GetIntelligence.g.cs index ed63ef5..f649c27 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.GetIntelligence.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.GetIntelligence.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetIntelligenceResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetIntelligenceAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get intelligence
+ /// Retrieve a single intelligence report by its UUID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetIntelligenceAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetIntelligenceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/intelligences/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetIntelligenceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetIntelligenceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetIntelligenceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetIntelligenceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetIntelligenceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetIntelligenceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetIntelligenceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetIntelligenceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Intelligence not found @@ -361,9 +401,13 @@ partial void ProcessGetIntelligenceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.IntelligenceGetIntelligenceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.IntelligenceGetIntelligenceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessGetIntelligenceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.IntelligenceGetIntelligenceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.IntelligenceGetIntelligenceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.ListIntelligences.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.ListIntelligences.g.cs index 818efc0..38912e0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.ListIntelligences.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.ListIntelligences.g.cs @@ -72,6 +72,32 @@ partial void ProcessListIntelligencesResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListIntelligencesAsResponseAsync( + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List intelligences
+ /// Retrieve a paginated list of all intelligence reports for the authenticated user's team + ///
+ /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListIntelligencesAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,14 +128,15 @@ partial void ProcessListIntelligencesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/intelligences", baseUri: ResolveBaseUri( servers: s_ListIntelligencesServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -182,6 +209,8 @@ partial void ProcessListIntelligencesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +221,11 @@ partial void ProcessListIntelligencesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +243,8 @@ partial void ProcessListIntelligencesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +254,7 @@ partial void ProcessListIntelligencesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +263,11 @@ partial void ProcessListIntelligencesResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +284,15 @@ partial void ProcessListIntelligencesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +332,8 @@ partial void ProcessListIntelligencesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +354,8 @@ partial void ProcessListIntelligencesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -335,9 +380,13 @@ partial void ProcessListIntelligencesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.IntelligenceListIntelligencesResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.IntelligenceListIntelligencesResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -365,9 +414,13 @@ partial void ProcessListIntelligencesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.IntelligenceListIntelligencesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.IntelligenceListIntelligencesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.RunIntelligence.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.RunIntelligence.g.cs index b3c01f4..4b409cb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.RunIntelligence.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.RunIntelligence.g.cs @@ -64,6 +64,29 @@ partial void ProcessRunIntelligenceResponseContent( /// public async global::System.Threading.Tasks.Task RunIntelligenceAsync( + global::ResembleAI.RunIntelligenceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunIntelligenceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run intelligence
+ /// Analyze audio, image, or video for comprehensive insights. Optionally reference an existing detect to associate. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RunIntelligenceAsResponseAsync( + global::ResembleAI.RunIntelligenceRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessRunIntelligenceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/intelligence", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessRunIntelligenceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessRunIntelligenceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessRunIntelligenceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessRunIntelligenceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessRunIntelligenceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessRunIntelligenceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessRunIntelligenceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessRunIntelligenceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessRunIntelligenceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.IntelligenceRunIntelligenceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.IntelligenceRunIntelligenceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessRunIntelligenceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.IntelligenceRunIntelligenceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.IntelligenceRunIntelligenceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.g.cs index ab3b310..2b2658c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageIntelligenceClient.g.cs @@ -103,10 +103,10 @@ public SubpackageIntelligenceClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageIntelligenceClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.CreateProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.CreateProject.g.cs index c11e2eb..ad39b9a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.CreateProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.CreateProject.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateProjectResponseContent( /// public async global::System.Threading.Tasks.Task CreateProjectAsync( + global::ResembleAI.CreateProjectRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateProjectAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create project
+ /// Create a new project + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateProjectAsResponseAsync( + global::ResembleAI.CreateProjectRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/projects", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateProjectResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ProjectsCreateProjectResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ProjectsCreateProjectResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ProjectsCreateProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ProjectsCreateProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.DeleteProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.DeleteProject.g.cs index 26555fd..882f456 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.DeleteProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.DeleteProject.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteProjectResponseContent( string projectUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteProjectAsResponseAsync( + projectUuid: projectUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete project
+ /// Delete a project + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteProjectAsResponseAsync( + string projectUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteProjectResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeleteProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ProjectsDeleteProjectResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ProjectsDeleteProjectResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeleteProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ProjectsDeleteProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ProjectsDeleteProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.GetProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.GetProject.g.cs index 8e3c897..2ae1750 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.GetProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.GetProject.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetProjectResponseContent( string projectUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectAsResponseAsync( + projectUuid: projectUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get project
+ /// Get project details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetProjectAsResponseAsync( + string projectUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetProjectResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ProjectsGetProjectResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ProjectsGetProjectResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ProjectsGetProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ProjectsGetProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.ListProjects.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.ListProjects.g.cs index a7032b0..bb77282 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.ListProjects.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.ListProjects.g.cs @@ -74,6 +74,34 @@ partial void ProcessListProjectsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListProjectsAsResponseAsync( + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List projects
+ /// List all projects + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListProjectsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,14 +132,15 @@ partial void ProcessListProjectsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/projects", baseUri: ResolveBaseUri( servers: s_ListProjectsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -184,6 +213,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +225,11 @@ partial void ProcessListProjectsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +247,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +258,7 @@ partial void ProcessListProjectsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +267,11 @@ partial void ProcessListProjectsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +288,15 @@ partial void ProcessListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +336,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +358,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -337,9 +384,13 @@ partial void ProcessListProjectsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ProjectsListProjectsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ProjectsListProjectsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -367,9 +418,13 @@ partial void ProcessListProjectsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ProjectsListProjectsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ProjectsListProjectsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.UpdateProject.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.UpdateProject.g.cs index 1dcae10..4532807 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.UpdateProject.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.UpdateProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessUpdateProjectResponseContent( public async global::System.Threading.Tasks.Task UpdateProjectAsync( string projectUuid, + global::ResembleAI.UpdateProjectRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateProjectAsResponseAsync( + projectUuid: projectUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update project
+ /// Update a project + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateProjectAsResponseAsync( + string projectUuid, + global::ResembleAI.UpdateProjectRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessUpdateProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/projects/{projectUuid}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessUpdateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessUpdateProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessUpdateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessUpdateProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessUpdateProjectResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessUpdateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessUpdateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessUpdateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessUpdateProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.ProjectsUpdateProjectResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.ProjectsUpdateProjectResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessUpdateProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.ProjectsUpdateProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.ProjectsUpdateProjectResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.g.cs index c39d873..ad32609 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageProjectsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageProjectsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageProjectsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.CreateRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.CreateRecording.g.cs index d5b7e74..5ac2829 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.CreateRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.CreateRecording.g.cs @@ -68,6 +68,32 @@ partial void ProcessCreateRecordingResponseContent( public async global::System.Threading.Tasks.Task CreateRecordingAsync( string voiceUuid, + global::ResembleAI.CreateRecordingRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateRecordingAsResponseAsync( + voiceUuid: voiceUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create recording
+ /// Upload a new recording for voice training + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateRecordingAsResponseAsync( + string voiceUuid, + global::ResembleAI.CreateRecordingRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -99,10 +125,11 @@ partial void ProcessCreateRecordingResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}/recordings", baseUri: ResolveBaseUri( @@ -137,10 +164,12 @@ partial void ProcessCreateRecordingResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(voiceUuid ?? string.Empty), name: "\"voice_uuid\""); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( request.Filename is null @@ -178,26 +207,34 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), name: "\"name\""); + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Text ?? string.Empty), name: "\"text\""); + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Emotion ?? string.Empty), name: "\"emotion\""); + __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IsActive, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"is_active\""); + if (request.Fill != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Fill, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"fill\""); + } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -240,6 +277,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -250,6 +289,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -267,6 +311,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -276,8 +322,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -286,6 +331,11 @@ request.Filename is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -302,14 +352,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -349,6 +400,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -369,6 +422,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -393,9 +448,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.RecordingsCreateRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.RecordingsCreateRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -423,9 +482,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.RecordingsCreateRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.RecordingsCreateRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -521,5 +584,956 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create recording
+ /// Upload a new recording for voice training + ///
+ /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Display name + /// + /// + /// Transcript of the clip + /// + /// + /// Emotion label + /// + /// + /// Include in training + /// + /// + /// Include for Resemble Fill + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateRecordingAsync( + string voiceUuid, + global::System.IO.Stream file, + string filename, + string name, + string text, + string emotion, + bool isActive, + bool? fill = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ResembleAI.CreateRecordingRequest + { + File = global::System.Array.Empty(), + Filename = filename, + Name = name, + Text = text, + Emotion = emotion, + IsActive = isActive, + Fill = fill, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateRecordingArguments( + httpClient: HttpClient, + voiceUuid: ref voiceUuid, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateRecordingSecurityRequirements, + operationName: "CreateRecordingAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: $"/voices/{voiceUuid}/recordings", + baseUri: ResolveBaseUri( + servers: s_CreateRecordingServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(voiceUuid ?? string.Empty), + name: "\"voice_uuid\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Text ?? string.Empty), + name: "\"text\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Emotion ?? string.Empty), + name: "\"emotion\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IsActive, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"is_active\""); + + if (request.Fill != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Fill, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"fill\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateRecordingRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceUuid: voiceUuid!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateRecordingResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateRecordingResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.RecordingsCreateRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.RecordingsCreateRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create recording
+ /// Upload a new recording for voice training + ///
+ /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Audio file (WAV recommended, 1-12 seconds) + /// + /// + /// Display name + /// + /// + /// Transcript of the clip + /// + /// + /// Emotion label + /// + /// + /// Include in training + /// + /// + /// Include for Resemble Fill + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateRecordingAsResponseAsync( + string voiceUuid, + global::System.IO.Stream file, + string filename, + string name, + string text, + string emotion, + bool isActive, + bool? fill = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ResembleAI.CreateRecordingRequest + { + File = global::System.Array.Empty(), + Filename = filename, + Name = name, + Text = text, + Emotion = emotion, + IsActive = isActive, + Fill = fill, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateRecordingArguments( + httpClient: HttpClient, + voiceUuid: ref voiceUuid, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateRecordingSecurityRequirements, + operationName: "CreateRecordingAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: $"/voices/{voiceUuid}/recordings", + baseUri: ResolveBaseUri( + servers: s_CreateRecordingServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(voiceUuid ?? string.Empty), + name: "\"voice_uuid\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Text ?? string.Empty), + name: "\"text\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Emotion ?? string.Empty), + name: "\"emotion\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.IsActive, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"is_active\""); + + if (request.Fill != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Fill, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"fill\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateRecordingRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceUuid: voiceUuid!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateRecordingResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateRecording", + methodName: "CreateRecordingAsync", + pathTemplate: "$\"/voices/{voiceUuid}/recordings\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateRecordingResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.RecordingsCreateRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.RecordingsCreateRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.DeleteRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.DeleteRecording.g.cs index ec6f8b2..364fbf0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.DeleteRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.DeleteRecording.g.cs @@ -70,6 +70,30 @@ partial void ProcessDeleteRecordingResponseContent( string recordingId, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteRecordingAsResponseAsync( + voiceUuid: voiceUuid, + recordingId: recordingId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete recording
+ /// Delete a recording + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteRecordingAsResponseAsync( + string voiceUuid, + string recordingId, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessDeleteRecordingResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}/recordings/{recordingId}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessDeleteRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessDeleteRecordingResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessDeleteRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessDeleteRecordingResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessDeleteRecordingResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessDeleteRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessDeleteRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessDeleteRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessDeleteRecordingResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.RecordingsDeleteRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.RecordingsDeleteRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessDeleteRecordingResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.RecordingsDeleteRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.RecordingsDeleteRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.GetRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.GetRecording.g.cs index 3cf4791..63d4e72 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.GetRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.GetRecording.g.cs @@ -70,6 +70,30 @@ partial void ProcessGetRecordingResponseContent( string recordingId, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRecordingAsResponseAsync( + voiceUuid: voiceUuid, + recordingId: recordingId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get recording
+ /// Get recording details + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetRecordingAsResponseAsync( + string voiceUuid, + string recordingId, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessGetRecordingResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}/recordings/{recordingId}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessGetRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessGetRecordingResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessGetRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessGetRecordingResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessGetRecordingResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessGetRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessGetRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessGetRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessGetRecordingResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.RecordingsGetRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.RecordingsGetRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessGetRecordingResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.RecordingsGetRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.RecordingsGetRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.ListRecordings.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.ListRecordings.g.cs index 8e6fbbb..edf9c5c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.ListRecordings.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.ListRecordings.g.cs @@ -78,6 +78,37 @@ partial void ProcessListRecordingsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListRecordingsAsResponseAsync( + voiceUuid: voiceUuid, + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List recordings
+ /// List all recordings for a voice + ///
+ /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListRecordingsAsResponseAsync( + string voiceUuid, + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,14 +140,15 @@ partial void ProcessListRecordingsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}/recordings", baseUri: ResolveBaseUri( servers: s_ListRecordingsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -190,6 +222,8 @@ partial void ProcessListRecordingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -200,6 +234,11 @@ partial void ProcessListRecordingsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -217,6 +256,8 @@ partial void ProcessListRecordingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -226,8 +267,7 @@ partial void ProcessListRecordingsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -236,6 +276,11 @@ partial void ProcessListRecordingsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -252,14 +297,15 @@ partial void ProcessListRecordingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +345,8 @@ partial void ProcessListRecordingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -319,6 +367,8 @@ partial void ProcessListRecordingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -343,9 +393,13 @@ partial void ProcessListRecordingsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.RecordingsListRecordingsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.RecordingsListRecordingsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -373,9 +427,13 @@ partial void ProcessListRecordingsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.RecordingsListRecordingsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.RecordingsListRecordingsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.UpdateRecording.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.UpdateRecording.g.cs index e19a0c0..ed7470f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.UpdateRecording.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.UpdateRecording.g.cs @@ -72,6 +72,35 @@ partial void ProcessUpdateRecordingResponseContent( string voiceUuid, string recordingId, + global::ResembleAI.UpdateRecordingRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateRecordingAsResponseAsync( + voiceUuid: voiceUuid, + recordingId: recordingId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update recording
+ /// Update a recording + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateRecordingAsResponseAsync( + string voiceUuid, + string recordingId, + global::ResembleAI.UpdateRecordingRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessUpdateRecordingResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}/recordings/{recordingId}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessUpdateRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessUpdateRecordingResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessUpdateRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessUpdateRecordingResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessUpdateRecordingResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessUpdateRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessUpdateRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessUpdateRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessUpdateRecordingResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.RecordingsUpdateRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.RecordingsUpdateRecordingResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessUpdateRecordingResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.RecordingsUpdateRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.RecordingsUpdateRecordingResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.g.cs index 86b2e53..5f2d8b1 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageRecordingsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageRecordingsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageRecordingsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.CreateSecureUpload.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.CreateSecureUpload.g.cs index 682cd99..206c2e4 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.CreateSecureUpload.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.CreateSecureUpload.g.cs @@ -69,6 +69,34 @@ partial void ProcessCreateSecureUploadResponseContent( /// public async global::System.Threading.Tasks.Task CreateSecureUploadAsync( + global::ResembleAI.CreateSecureUploadRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSecureUploadAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload media securely
+ /// Upload a media file and receive a short-lived token that can be passed to
+ /// downstream endpoints (such as `/detect` and `/intelligence`) in place of a
+ /// public URL. The returned token is a JWT that expires 1 hour after issuance.
+ /// Keeping uploads private avoids exposing source media on the open internet and
+ /// means you do not need to host files yourself for jobs that only need the API
+ /// to read them once. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateSecureUploadAsResponseAsync( + global::ResembleAI.CreateSecureUploadRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -99,10 +127,11 @@ partial void ProcessCreateSecureUploadResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/secure_uploads", baseUri: ResolveBaseUri( @@ -137,6 +166,7 @@ partial void ProcessCreateSecureUploadResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -175,7 +205,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -217,6 +249,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -227,6 +261,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -244,6 +283,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -253,8 +294,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +303,11 @@ request.Filename is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -279,14 +324,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -326,6 +372,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -346,6 +394,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request @@ -446,9 +496,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -476,9 +530,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -551,5 +609,1002 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload media securely
+ /// Upload a media file and receive a short-lived token that can be passed to
+ /// downstream endpoints (such as `/detect` and `/intelligence`) in place of a
+ /// public URL. The returned token is a JWT that expires 1 hour after issuance.
+ /// Keeping uploads private avoids exposing source media on the open internet and
+ /// means you do not need to host files yourself for jobs that only need the API
+ /// to read them once. + ///
+ /// + /// The media file to upload (audio, image, or video). + /// + /// + /// The media file to upload (audio, image, or video). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateSecureUploadAsync( + global::System.IO.Stream file, + string filename, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ResembleAI.CreateSecureUploadRequest + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateSecureUploadArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateSecureUploadSecurityRequirements, + operationName: "CreateSecureUploadAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/secure_uploads", + baseUri: ResolveBaseUri( + servers: s_CreateSecureUploadServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateSecureUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateSecureUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ResembleAI.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ResembleAI.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ResembleAI.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateSecureUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upload media securely
+ /// Upload a media file and receive a short-lived token that can be passed to
+ /// downstream endpoints (such as `/detect` and `/intelligence`) in place of a
+ /// public URL. The returned token is a JWT that expires 1 hour after issuance.
+ /// Keeping uploads private avoids exposing source media on the open internet and
+ /// means you do not need to host files yourself for jobs that only need the API
+ /// to read them once. + ///
+ /// + /// The media file to upload (audio, image, or video). + /// + /// + /// The media file to upload (audio, image, or video). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateSecureUploadAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ResembleAI.CreateSecureUploadRequest + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateSecureUploadArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateSecureUploadSecurityRequirements, + operationName: "CreateSecureUploadAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/secure_uploads", + baseUri: ResolveBaseUri( + servers: s_CreateSecureUploadServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateSecureUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateSecureUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSecureUpload", + methodName: "CreateSecureUploadAsync", + pathTemplate: "\"/secure_uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::ResembleAI.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::ResembleAI.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::ResembleAI.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateSecureUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.SecureUploadsCreateSecureUploadResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.g.cs index 361756c..06b9706 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSecureUploadsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageSecureUploadsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageSecureUploadsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs index daaa21a..40f177c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.AskTranscriptQuestion.g.cs @@ -68,6 +68,32 @@ partial void ProcessAskTranscriptQuestionResponseContent( public async global::System.Threading.Tasks.Task AskTranscriptQuestionAsync( global::System.Guid uuid, + global::ResembleAI.AskTranscriptQuestionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AskTranscriptQuestionAsResponseAsync( + uuid: uuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Ask intelligence question
+ /// Submit a question about a completed transcript + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AskTranscriptQuestionAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AskTranscriptQuestionRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessAskTranscriptQuestionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/speech-to-text/{uuid}/ask", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessAskTranscriptQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessAskTranscriptQuestionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessAskTranscriptQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessAskTranscriptQuestionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessAskTranscriptQuestionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessAskTranscriptQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessAskTranscriptQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessAskTranscriptQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessAskTranscriptQuestionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SpeechToTextAskTranscriptQuestionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SpeechToTextAskTranscriptQuestionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessAskTranscriptQuestionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SpeechToTextAskTranscriptQuestionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SpeechToTextAskTranscriptQuestionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.CreateTranscript.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.CreateTranscript.g.cs index 6aacaeb..c60e50a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.CreateTranscript.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.CreateTranscript.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateTranscriptResponseContent( /// public async global::System.Threading.Tasks.Task CreateTranscriptAsync( + global::ResembleAI.CreateTranscriptRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateTranscriptAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create transcript job
+ /// Submit audio or video for transcription + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateTranscriptAsResponseAsync( + global::ResembleAI.CreateTranscriptRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,10 +117,11 @@ partial void ProcessCreateTranscriptResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/speech-to-text", baseUri: ResolveBaseUri( @@ -132,6 +156,7 @@ partial void ProcessCreateTranscriptResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); if (request.File != default) { @@ -173,15 +198,19 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } - } + + } if (request.Query != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Query ?? string.Empty), name: "\"query\""); + } + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -223,6 +252,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +264,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +286,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +297,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +306,11 @@ request.Filename is null __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +327,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +375,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +397,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request @@ -414,9 +461,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +495,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -519,5 +574,950 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create transcript job
+ /// Submit audio or video for transcription + ///
+ /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Optional intelligence question to evaluate after transcription + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateTranscriptAsync( + global::System.IO.Stream? file = default, + string? filename = default, + string? query = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + var request = new global::ResembleAI.CreateTranscriptRequest + { + File = global::System.Array.Empty(), + Filename = filename, + Query = query, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateTranscriptArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateTranscriptSecurityRequirements, + operationName: "CreateTranscriptAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/speech-to-text", + baseUri: ResolveBaseUri( + servers: s_CreateTranscriptServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (file != default) + { + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Query != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Query ?? string.Empty), + name: "\"query\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateTranscriptRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateTranscriptResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateTranscriptResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create transcript job
+ /// Submit audio or video for transcription + ///
+ /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Audio or video file (max 500 MB, 20 minutes) + /// + /// + /// Optional intelligence question to evaluate after transcription + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateTranscriptAsResponseAsync( + global::System.IO.Stream? file = default, + string? filename = default, + string? query = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + var request = new global::ResembleAI.CreateTranscriptRequest + { + File = global::System.Array.Empty(), + Filename = filename, + Query = query, + }; + PrepareArguments( + client: HttpClient); + PrepareCreateTranscriptArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateTranscriptSecurityRequirements, + operationName: "CreateTranscriptAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/speech-to-text", + baseUri: ResolveBaseUri( + servers: s_CreateTranscriptServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (file != default) + { + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + } + if (request.Query != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Query ?? string.Empty), + name: "\"query\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateTranscriptRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateTranscriptResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateTranscript", + methodName: "CreateTranscriptAsync", + pathTemplate: "\"/speech-to-text\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateTranscriptResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ResembleAI.SpeechToTextCreateTranscriptResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscript.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscript.g.cs index dd92883..777293c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscript.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscript.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetTranscriptResponseContent( global::System.Guid uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTranscriptAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get transcript
+ /// Retrieve transcript status, text, and timestamps + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTranscriptAsResponseAsync( + global::System.Guid uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetTranscriptResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/speech-to-text/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetTranscriptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetTranscriptResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetTranscriptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetTranscriptResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetTranscriptResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetTranscriptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetTranscriptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetTranscriptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetTranscriptResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SpeechToTextGetTranscriptResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SpeechToTextGetTranscriptResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetTranscriptResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SpeechToTextGetTranscriptResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SpeechToTextGetTranscriptResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs index 4f46bc6..18314aa 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.GetTranscriptQuestion.g.cs @@ -70,6 +70,30 @@ partial void ProcessGetTranscriptQuestionResponseContent( global::System.Guid questionUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTranscriptQuestionAsResponseAsync( + uuid: uuid, + questionUuid: questionUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get intelligence question status
+ /// Check the status of a specific question + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTranscriptQuestionAsResponseAsync( + global::System.Guid uuid, + global::System.Guid questionUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessGetTranscriptQuestionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/speech-to-text/{uuid}/questions/{questionUuid}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessGetTranscriptQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessGetTranscriptQuestionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessGetTranscriptQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessGetTranscriptQuestionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessGetTranscriptQuestionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessGetTranscriptQuestionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessGetTranscriptQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessGetTranscriptQuestionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessGetTranscriptQuestionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SpeechToTextGetTranscriptQuestionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SpeechToTextGetTranscriptQuestionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessGetTranscriptQuestionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SpeechToTextGetTranscriptQuestionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SpeechToTextGetTranscriptQuestionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs index 1b59cd2..ab983be 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscriptQuestions.g.cs @@ -78,6 +78,37 @@ partial void ProcessListTranscriptQuestionsResponseContent( int? perPage = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTranscriptQuestionsAsResponseAsync( + uuid: uuid, + page: page, + perPage: perPage, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List intelligence questions
+ /// List all questions asked about a transcript + ///
+ /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 25 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListTranscriptQuestionsAsResponseAsync( + global::System.Guid uuid, + int page, + int? perPage = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,14 +140,15 @@ partial void ProcessListTranscriptQuestionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/speech-to-text/{uuid}/questions", baseUri: ResolveBaseUri( servers: s_ListTranscriptQuestionsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("per_page", perPage?.ToString()) + .AddOptionalParameter("per_page", perPage?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -190,6 +222,8 @@ partial void ProcessListTranscriptQuestionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -200,6 +234,11 @@ partial void ProcessListTranscriptQuestionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -217,6 +256,8 @@ partial void ProcessListTranscriptQuestionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -226,8 +267,7 @@ partial void ProcessListTranscriptQuestionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -236,6 +276,11 @@ partial void ProcessListTranscriptQuestionsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -252,14 +297,15 @@ partial void ProcessListTranscriptQuestionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +345,8 @@ partial void ProcessListTranscriptQuestionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -319,6 +367,8 @@ partial void ProcessListTranscriptQuestionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -343,9 +393,13 @@ partial void ProcessListTranscriptQuestionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SpeechToTextListTranscriptQuestionsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SpeechToTextListTranscriptQuestionsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -373,9 +427,13 @@ partial void ProcessListTranscriptQuestionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SpeechToTextListTranscriptQuestionsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SpeechToTextListTranscriptQuestionsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscripts.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscripts.g.cs index 9fc0a3b..f1987e5 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscripts.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.ListTranscripts.g.cs @@ -74,6 +74,34 @@ partial void ProcessListTranscriptsResponseContent( int? perPage = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTranscriptsAsResponseAsync( + page: page, + perPage: perPage, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List transcripts
+ /// Retrieve paginated list of transcript jobs + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 25 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListTranscriptsAsResponseAsync( + int page, + int? perPage = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,14 +132,15 @@ partial void ProcessListTranscriptsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/speech-to-text", baseUri: ResolveBaseUri( servers: s_ListTranscriptsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("per_page", perPage?.ToString()) + .AddOptionalParameter("per_page", perPage?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -184,6 +213,8 @@ partial void ProcessListTranscriptsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +225,11 @@ partial void ProcessListTranscriptsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +247,8 @@ partial void ProcessListTranscriptsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +258,7 @@ partial void ProcessListTranscriptsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +267,11 @@ partial void ProcessListTranscriptsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +288,15 @@ partial void ProcessListTranscriptsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +336,8 @@ partial void ProcessListTranscriptsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +358,8 @@ partial void ProcessListTranscriptsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -337,9 +384,13 @@ partial void ProcessListTranscriptsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.SpeechToTextListTranscriptsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.SpeechToTextListTranscriptsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -367,9 +418,13 @@ partial void ProcessListTranscriptsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.SpeechToTextListTranscriptsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.SpeechToTextListTranscriptsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.g.cs index ea15e2a..e5e72d0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageSpeechToTextClient.g.cs @@ -103,10 +103,10 @@ public SubpackageSpeechToTextClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageSpeechToTextClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs index c55a7d6..bf480cc 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.CreateTermSubstitution.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateTermSubstitutionResponseContent( /// public async global::System.Threading.Tasks.Task CreateTermSubstitutionAsync( + global::ResembleAI.CreateTermSubstitutionRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateTermSubstitutionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create term substitution
+ /// Create a new pronunciation substitution + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateTermSubstitutionAsResponseAsync( + global::ResembleAI.CreateTermSubstitutionRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateTermSubstitutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/term_substitutions", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateTermSubstitutionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateTermSubstitutionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateTermSubstitutionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateTermSubstitutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateTermSubstitutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateTermSubstitutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.TermSubstitutionsCreateTermSubstitutionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.TermSubstitutionsCreateTermSubstitutionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateTermSubstitutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.TermSubstitutionsCreateTermSubstitutionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.TermSubstitutionsCreateTermSubstitutionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs index 84496c8..9227a28 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.DeleteTermSubstitution.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteTermSubstitutionResponseContent( int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteTermSubstitutionAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete term substitution
+ /// Delete a term substitution + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteTermSubstitutionAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteTermSubstitutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/term_substitutions/{id}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteTermSubstitutionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteTermSubstitutionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteTermSubstitutionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteTermSubstitutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteTermSubstitutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeleteTermSubstitutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.TermSubstitutionsDeleteTermSubstitutionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.TermSubstitutionsDeleteTermSubstitutionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeleteTermSubstitutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.TermSubstitutionsDeleteTermSubstitutionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.TermSubstitutionsDeleteTermSubstitutionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs index 7767b43..5c04abd 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.GetTermSubstitution.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetTermSubstitutionResponseContent( int id, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTermSubstitutionAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get term substitution
+ /// Get term substitution details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTermSubstitutionAsResponseAsync( + int id, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetTermSubstitutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/term_substitutions/{id}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetTermSubstitutionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetTermSubstitutionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetTermSubstitutionResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetTermSubstitutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetTermSubstitutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetTermSubstitutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetTermSubstitutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.TermSubstitutionsGetTermSubstitutionResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.TermSubstitutionsGetTermSubstitutionResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetTermSubstitutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.TermSubstitutionsGetTermSubstitutionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.TermSubstitutionsGetTermSubstitutionResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs index 2dd1c86..55d27d9 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.ListTermSubstitutions.g.cs @@ -74,6 +74,34 @@ partial void ProcessListTermSubstitutionsResponseContent( int? pageSize = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTermSubstitutionsAsResponseAsync( + page: page, + pageSize: pageSize, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List term substitutions
+ /// List all term substitutions + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListTermSubstitutionsAsResponseAsync( + int page, + int? pageSize = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,14 +132,15 @@ partial void ProcessListTermSubstitutionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/term_substitutions", baseUri: ResolveBaseUri( servers: s_ListTermSubstitutionsServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) - .AddOptionalParameter("page_size", pageSize?.ToString()) + .AddOptionalParameter("page_size", pageSize?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -184,6 +213,8 @@ partial void ProcessListTermSubstitutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +225,11 @@ partial void ProcessListTermSubstitutionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +247,8 @@ partial void ProcessListTermSubstitutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +258,7 @@ partial void ProcessListTermSubstitutionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +267,11 @@ partial void ProcessListTermSubstitutionsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +288,15 @@ partial void ProcessListTermSubstitutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +336,8 @@ partial void ProcessListTermSubstitutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +358,8 @@ partial void ProcessListTermSubstitutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -337,9 +384,13 @@ partial void ProcessListTermSubstitutionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.TermSubstitutionsListTermSubstitutionsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.TermSubstitutionsListTermSubstitutionsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -367,9 +418,13 @@ partial void ProcessListTermSubstitutionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.TermSubstitutionsListTermSubstitutionsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.TermSubstitutionsListTermSubstitutionsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.g.cs index 7db65cb..35f0330 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTermSubstitutionsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageTermSubstitutionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageTermSubstitutionsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.StreamSynthesize.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.StreamSynthesize.g.cs index e35aae3..f7b9ab4 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.StreamSynthesize.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.StreamSynthesize.g.cs @@ -64,6 +64,29 @@ partial void ProcessStreamSynthesizeResponseContent( /// public async global::System.Threading.Tasks.Task StreamSynthesizeAsync( + global::ResembleAI.StreamSynthesizeRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StreamSynthesizeAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Streaming text-to-speech synthesis (HTTP)
+ /// Stream audio as it's generated. Returns chunked WAV data for progressive playback. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task StreamSynthesizeAsStreamAsync( + global::ResembleAI.StreamSynthesizeRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessStreamSynthesizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/stream", baseUri: ResolveBaseUri( @@ -179,16 +203,23 @@ partial void ProcessStreamSynthesizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { __response = await HttpClient.SendAsync( request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessStreamSynthesizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessStreamSynthesizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessStreamSynthesizeResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,381 @@ partial void ProcessStreamSynthesizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + try + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessStreamSynthesizeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSynthesize", + methodName: "StreamSynthesizeAsync", + pathTemplate: "\"/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSynthesize", + methodName: "StreamSynthesizeAsync", + pathTemplate: "\"/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::ResembleAI.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::ResembleAI.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + try + { + __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::ResembleAI.ResponseStream(__response, __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ResembleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + } + catch + { + __response.Dispose(); + throw; + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Streaming text-to-speech synthesis (HTTP)
+ /// Stream audio as it's generated. Returns chunked WAV data for progressive playback. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> StreamSynthesizeAsResponseAsync( + + global::ResembleAI.StreamSynthesizeRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareStreamSynthesizeArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StreamSynthesizeSecurityRequirements, + operationName: "StreamSynthesizeAsync"); + + using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ResembleAI.PathBuilder( + path: "/stream", + baseUri: ResolveBaseUri( + servers: s_StreamSynthesizeServers, + defaultBaseUrl: "https://f.cluster.resemble.ai/")); + var __path = __pathBuilder.ToString(); + __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStreamSynthesizeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSynthesize", + methodName: "StreamSynthesizeAsync", + pathTemplate: "\"/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSynthesize", + methodName: "StreamSynthesizeAsync", + pathTemplate: "\"/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( clientOptions: Options, requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSynthesize", + methodName: "StreamSynthesizeAsync", + pathTemplate: "\"/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +692,8 @@ partial void ProcessStreamSynthesizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +714,8 @@ partial void ProcessStreamSynthesizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request @@ -366,7 +774,11 @@ partial void ProcessStreamSynthesizeResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -393,7 +805,11 @@ partial void ProcessStreamSynthesizeResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.Synthesize.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.Synthesize.g.cs index c863956..14aa6a7 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.Synthesize.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.Synthesize.g.cs @@ -64,6 +64,29 @@ partial void ProcessSynthesizeResponseContent( /// public async global::System.Threading.Tasks.Task SynthesizeAsync( + global::ResembleAI.SynthesizeRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SynthesizeAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Synchronous text-to-speech synthesis
+ /// Generate speech synchronously from text or SSML. Returns complete audio as base64. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SynthesizeAsResponseAsync( + global::ResembleAI.SynthesizeRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessSynthesizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/synthesize", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessSynthesizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessSynthesizeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessSynthesizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessSynthesizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessSynthesizeResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessSynthesizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessSynthesizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessSynthesizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad request @@ -408,9 +450,13 @@ partial void ProcessSynthesizeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.TextToSpeechSynthesizeResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.TextToSpeechSynthesizeResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -438,9 +484,13 @@ partial void ProcessSynthesizeResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.TextToSpeechSynthesizeResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.TextToSpeechSynthesizeResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.g.cs index 4a560d5..d7feff0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageTextToSpeechClient.g.cs @@ -103,10 +103,10 @@ public SubpackageTextToSpeechClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageTextToSpeechClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs index 8dce3fc..f8d3baa 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.CreateVoiceFromCandidate.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( /// public async global::System.Threading.Tasks.Task CreateVoiceFromCandidateAsync( + global::ResembleAI.CreateVoiceFromCandidateRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVoiceFromCandidateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create voice from candidate
+ /// Create a voice from a voice design candidate + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateVoiceFromCandidateAsResponseAsync( + global::ResembleAI.CreateVoiceFromCandidateRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/voice-design/create", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceDesignCreateVoiceFromCandidateResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceDesignCreateVoiceFromCandidateResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateVoiceFromCandidateResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceDesignCreateVoiceFromCandidateResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceDesignCreateVoiceFromCandidateResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs index 5145da3..12a1a6e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.GenerateVoiceDesign.g.cs @@ -64,6 +64,29 @@ partial void ProcessGenerateVoiceDesignResponseContent( /// public async global::System.Threading.Tasks.Task GenerateVoiceDesignAsync( + global::ResembleAI.GenerateVoiceDesignRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateVoiceDesignAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate voice candidates
+ /// Generate three voice candidates from a text prompt + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerateVoiceDesignAsResponseAsync( + global::ResembleAI.GenerateVoiceDesignRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,10 +117,11 @@ partial void ProcessGenerateVoiceDesignResponseContent( var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/voice-design", baseUri: ResolveBaseUri( @@ -132,11 +156,14 @@ partial void ProcessGenerateVoiceDesignResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.UserPrompt ?? string.Empty), name: "\"user_prompt\""); + __httpRequest.Content = __httpRequestContent; + global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -178,6 +205,8 @@ partial void ProcessGenerateVoiceDesignResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessGenerateVoiceDesignResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessGenerateVoiceDesignResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessGenerateVoiceDesignResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessGenerateVoiceDesignResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessGenerateVoiceDesignResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessGenerateVoiceDesignResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessGenerateVoiceDesignResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -331,9 +376,13 @@ partial void ProcessGenerateVoiceDesignResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceDesignGenerateVoiceDesignResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceDesignGenerateVoiceDesignResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -361,9 +410,13 @@ partial void ProcessGenerateVoiceDesignResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceDesignGenerateVoiceDesignResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceDesignGenerateVoiceDesignResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.g.cs index 804ce71..4bb811a 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceDesignClient.g.cs @@ -103,10 +103,10 @@ public SubpackageVoiceDesignClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageVoiceDesignClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs index 6b69784..c217ecd 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.CreateVoiceSettingsPreset.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( /// public async global::System.Threading.Tasks.Task CreateVoiceSettingsPresetAsync( + global::ResembleAI.CreateVoiceSettingsPresetRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVoiceSettingsPresetAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create voice settings preset
+ /// Create a new voice settings preset (max 5 per user) + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateVoiceSettingsPresetAsResponseAsync( + global::ResembleAI.CreateVoiceSettingsPresetRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/voice_settings_presets", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceSettingsPresetsCreateVoiceSettingsPresetResponse201.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceSettingsPresetsCreateVoiceSettingsPresetResponse201.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateVoiceSettingsPresetResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceSettingsPresetsCreateVoiceSettingsPresetResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceSettingsPresetsCreateVoiceSettingsPresetResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs index eddc4e0..ee00d75 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.DeleteVoiceSettingsPreset.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteVoiceSettingsPresetAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete voice settings preset
+ /// Delete a preset + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteVoiceSettingsPresetAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voice_settings_presets/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceSettingsPresetsDeleteVoiceSettingsPresetResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceSettingsPresetsDeleteVoiceSettingsPresetResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeleteVoiceSettingsPresetResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceSettingsPresetsDeleteVoiceSettingsPresetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceSettingsPresetsDeleteVoiceSettingsPresetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs index 25aade7..45a56d0 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.GetVoiceSettingsPreset.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVoiceSettingsPresetAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get voice settings preset
+ /// Get preset details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVoiceSettingsPresetAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voice_settings_presets/{uuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceSettingsPresetsGetVoiceSettingsPresetResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceSettingsPresetsGetVoiceSettingsPresetResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetVoiceSettingsPresetResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceSettingsPresetsGetVoiceSettingsPresetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceSettingsPresetsGetVoiceSettingsPresetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs index 699a02e..631e44d 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.ListVoiceSettingsPresets.g.cs @@ -62,6 +62,24 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( public async global::System.Threading.Tasks.Task ListVoiceSettingsPresetsAsync( global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListVoiceSettingsPresetsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List voice settings presets
+ /// List all voice settings presets + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListVoiceSettingsPresetsAsResponseAsync( + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/voice_settings_presets", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceSettingsPresetsListVoiceSettingsPresetsResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceSettingsPresetsListVoiceSettingsPresetsResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessListVoiceSettingsPresetsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceSettingsPresetsListVoiceSettingsPresetsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceSettingsPresetsListVoiceSettingsPresetsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs index b700216..c61ad80 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.UpdateVoiceSettingsPreset.g.cs @@ -68,6 +68,32 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( public async global::System.Threading.Tasks.Task UpdateVoiceSettingsPresetAsync( string uuid, + global::ResembleAI.UpdateVoiceSettingsPresetRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateVoiceSettingsPresetAsResponseAsync( + uuid: uuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update voice settings preset
+ /// Update a preset + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateVoiceSettingsPresetAsResponseAsync( + string uuid, + global::ResembleAI.UpdateVoiceSettingsPresetRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voice_settings_presets/{uuid}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoiceSettingsPresetsUpdateVoiceSettingsPresetResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoiceSettingsPresetsUpdateVoiceSettingsPresetResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessUpdateVoiceSettingsPresetResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoiceSettingsPresetsUpdateVoiceSettingsPresetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoiceSettingsPresetsUpdateVoiceSettingsPresetResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.g.cs index 749bbdf..f9edea5 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoiceSettingsPresetsClient.g.cs @@ -103,10 +103,10 @@ public SubpackageVoiceSettingsPresetsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageVoiceSettingsPresetsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.BuildVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.BuildVoice.g.cs index af10d65..633d902 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.BuildVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.BuildVoice.g.cs @@ -68,6 +68,32 @@ partial void ProcessBuildVoiceResponseContent( public async global::System.Threading.Tasks.Task BuildVoiceAsync( string voiceUuid, + global::ResembleAI.BuildVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BuildVoiceAsResponseAsync( + voiceUuid: voiceUuid, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Build voice
+ /// Start voice training + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> BuildVoiceAsResponseAsync( + string voiceUuid, + global::ResembleAI.BuildVoiceRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessBuildVoiceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}/build", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessBuildVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessBuildVoiceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessBuildVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessBuildVoiceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessBuildVoiceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessBuildVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessBuildVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessBuildVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessBuildVoiceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoicesBuildVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoicesBuildVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessBuildVoiceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoicesBuildVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoicesBuildVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.CreateVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.CreateVoice.g.cs index d9431cc..f670d55 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.CreateVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.CreateVoice.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateVoiceResponseContent( /// public async global::System.Threading.Tasks.Task CreateVoiceAsync( + global::ResembleAI.CreateVoiceRequest request, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVoiceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create voice
+ /// Create a new voice + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateVoiceAsResponseAsync( + global::ResembleAI.CreateVoiceRequest request, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateVoiceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/voices", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateVoiceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateVoiceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateVoiceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessCreateVoiceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoicesCreateVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoicesCreateVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessCreateVoiceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoicesCreateVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoicesCreateVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.DeleteVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.DeleteVoice.g.cs index 85c3e7d..c84c24f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.DeleteVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.DeleteVoice.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteVoiceResponseContent( string voiceUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteVoiceAsResponseAsync( + voiceUuid: voiceUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete voice
+ /// Delete a voice + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteVoiceAsResponseAsync( + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteVoiceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteVoiceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteVoiceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteVoiceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessDeleteVoiceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoicesDeleteVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoicesDeleteVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessDeleteVoiceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoicesDeleteVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoicesDeleteVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.GetVoice.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.GetVoice.g.cs index 36ac6ea..9271e6e 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.GetVoice.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.GetVoice.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetVoiceResponseContent( string voiceUuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVoiceAsResponseAsync( + voiceUuid: voiceUuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get voice
+ /// Get voice details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVoiceAsResponseAsync( + string voiceUuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetVoiceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/voices/{voiceUuid}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetVoiceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetVoiceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetVoiceResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetVoiceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetVoiceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetVoiceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoicesGetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoicesGetVoiceResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetVoiceResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoicesGetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoicesGetVoiceResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.ListVoices.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.ListVoices.g.cs index 827431e..d3d266f 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.ListVoices.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.ListVoices.g.cs @@ -80,6 +80,39 @@ partial void ProcessListVoicesResponseContent( bool? advanced = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListVoicesAsResponseAsync( + page: page, + pageSize: pageSize, + advanced: advanced, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List voices
+ /// Retrieve voice metadata + ///
+ /// + /// Default Value: 1 + /// + /// + /// Default Value: 10 + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListVoicesAsResponseAsync( + int page, + int? pageSize = default, + bool? advanced = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -111,15 +144,16 @@ partial void ProcessListVoicesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/voices", baseUri: ResolveBaseUri( servers: s_ListVoicesServers, - defaultBaseUrl: "https://f.cluster.resemble.ai/")); + defaultBaseUrl: "https://f.cluster.resemble.ai/")); __pathBuilder .AddRequiredParameter("page", page.ToString()!) .AddOptionalParameter("page_size", pageSize?.ToString()) - .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant()) + .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::ResembleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -193,6 +227,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +239,11 @@ partial void ProcessListVoicesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +261,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +272,7 @@ partial void ProcessListVoicesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +281,11 @@ partial void ProcessListVoicesResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +302,15 @@ partial void ProcessListVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +350,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +372,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -346,9 +398,13 @@ partial void ProcessListVoicesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.VoicesListVoicesResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.VoicesListVoicesResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -376,9 +432,13 @@ partial void ProcessListVoicesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.VoicesListVoicesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.VoicesListVoicesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.g.cs index ff51dae..335cdd6 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageVoicesClient.g.cs @@ -103,10 +103,10 @@ public SubpackageVoicesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageVoicesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.ApplyWatermark.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.ApplyWatermark.g.cs index 53d0732..14517ac 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.ApplyWatermark.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.ApplyWatermark.g.cs @@ -67,6 +67,32 @@ partial void ProcessApplyWatermarkResponseContent( /// public async global::System.Threading.Tasks.Task ApplyWatermarkAsync( + global::ResembleAI.ApplyWatermarkRequest request, + global::ResembleAI.WatermarkApplyPostParametersPrefer? prefer = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ApplyWatermarkAsResponseAsync( + + request: request, + prefer: prefer, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Apply watermark
+ /// Apply a watermark to an audio, image, or video file. The media type is automatically detected from the file content. Use the `Prefer: wait` header for synchronous processing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ApplyWatermarkAsResponseAsync( + global::ResembleAI.ApplyWatermarkRequest request, global::ResembleAI.WatermarkApplyPostParametersPrefer? prefer = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, @@ -103,6 +129,7 @@ partial void ProcessApplyWatermarkResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/watermark/apply", baseUri: ResolveBaseUri( @@ -191,6 +218,8 @@ partial void ProcessApplyWatermarkResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +230,11 @@ partial void ProcessApplyWatermarkResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +252,8 @@ partial void ProcessApplyWatermarkResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +263,7 @@ partial void ProcessApplyWatermarkResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +272,11 @@ partial void ProcessApplyWatermarkResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +293,15 @@ partial void ProcessApplyWatermarkResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +341,8 @@ partial void ProcessApplyWatermarkResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +363,8 @@ partial void ProcessApplyWatermarkResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +389,13 @@ partial void ProcessApplyWatermarkResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.WatermarkApplyWatermarkResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.WatermarkApplyWatermarkResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +423,13 @@ partial void ProcessApplyWatermarkResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.WatermarkApplyWatermarkResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.WatermarkApplyWatermarkResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.DetectWatermark.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.DetectWatermark.g.cs index ea87ec1..1006b57 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.DetectWatermark.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.DetectWatermark.g.cs @@ -67,6 +67,32 @@ partial void ProcessDetectWatermarkResponseContent( /// public async global::System.Threading.Tasks.Task DetectWatermarkAsync( + global::ResembleAI.DetectWatermarkRequest request, + global::ResembleAI.WatermarkDetectPostParametersPrefer? prefer = default, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetectWatermarkAsResponseAsync( + + request: request, + prefer: prefer, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detect watermark
+ /// Detect a watermark in an audio, image, or video file. The media type is automatically detected from the file content. Use the `Prefer: wait` header for synchronous processing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetectWatermarkAsResponseAsync( + global::ResembleAI.DetectWatermarkRequest request, global::ResembleAI.WatermarkDetectPostParametersPrefer? prefer = default, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, @@ -103,6 +129,7 @@ partial void ProcessDetectWatermarkResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: "/watermark/detect", baseUri: ResolveBaseUri( @@ -191,6 +218,8 @@ partial void ProcessDetectWatermarkResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +230,11 @@ partial void ProcessDetectWatermarkResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +252,8 @@ partial void ProcessDetectWatermarkResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +263,7 @@ partial void ProcessDetectWatermarkResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +272,11 @@ partial void ProcessDetectWatermarkResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +293,15 @@ partial void ProcessDetectWatermarkResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +341,8 @@ partial void ProcessDetectWatermarkResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +363,8 @@ partial void ProcessDetectWatermarkResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +389,13 @@ partial void ProcessDetectWatermarkResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.WatermarkDetectWatermarkResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.WatermarkDetectWatermarkResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +423,13 @@ partial void ProcessDetectWatermarkResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.WatermarkDetectWatermarkResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.WatermarkDetectWatermarkResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkApplyResult.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkApplyResult.g.cs index 479bb4a..51f682c 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkApplyResult.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkApplyResult.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetWatermarkApplyResultResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWatermarkApplyResultAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get watermark apply result
+ /// Retrieve the result of a watermark apply job. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWatermarkApplyResultAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetWatermarkApplyResultResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/watermark/apply/{uuid}/result", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetWatermarkApplyResultResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetWatermarkApplyResultResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetWatermarkApplyResultResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetWatermarkApplyResultResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetWatermarkApplyResultResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetWatermarkApplyResultResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetWatermarkApplyResultResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetWatermarkApplyResultResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetWatermarkApplyResultResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.WatermarkGetWatermarkApplyResultResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.WatermarkGetWatermarkApplyResultResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetWatermarkApplyResultResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.WatermarkGetWatermarkApplyResultResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.WatermarkGetWatermarkApplyResultResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs index 7e5c0ec..a6367f6 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.GetWatermarkDetectionResult.g.cs @@ -66,6 +66,27 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( string uuid, global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWatermarkDetectionResultAsResponseAsync( + uuid: uuid, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get watermark detection result
+ /// Retrieve the result of a watermark detection. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWatermarkDetectionResultAsResponseAsync( + string uuid, + global::ResembleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ResembleAI.PathBuilder( path: $"/watermark/detect/{uuid}/result", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( __attempt < __maxAttempts && global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ResembleAI.WatermarkGetWatermarkDetectionResultResponse200.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ResembleAI.WatermarkGetWatermarkDetectionResultResponse200.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessGetWatermarkDetectionResultResponseContent( #endif ).ConfigureAwait(false); - return - await global::ResembleAI.WatermarkGetWatermarkDetectionResultResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ResembleAI.WatermarkGetWatermarkDetectionResultResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ResembleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.g.cs index 495c0d1..3cf73cb 100644 --- a/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.g.cs +++ b/src/libs/ResembleAI/Generated/ResembleAI.SubpackageWatermarkClient.g.cs @@ -103,10 +103,10 @@ public SubpackageWatermarkClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SubpackageWatermarkClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ResembleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ResembleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) {