diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.AgentEditJob.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.AgentEditJob.g.cs index 5d7c5fb..a26c043 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.AgentEditJob.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.AgentEditJob.g.cs @@ -65,6 +65,43 @@ partial void ProcessAgentEditJobResponseContent( /// public async global::System.Threading.Tasks.Task AgentEditJobAsync( + global::Descript.AgentEditJobRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentEditJobAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Agent edit
+ /// Use a background agent to create and edit projects using a natural language prompt.
+ /// - **Edit existing project**: Provide a `project_id` to edit an existing project
+ /// - **Target a specific composition**: Provide both `project_id` and `composition_id` to direct the agent to a specific composition within the project
+ /// - **Create new project**: Provide a `project_name` instead of `project_id` to create a new project
+ /// ### Common use cases
+ /// - Create new content: "create a 30-second video about cooking tips"
+ /// - Apply audio effects: "add studio sound to every clip"
+ /// - Remove filler words: "remove all filler words from the transcript"
+ /// - Create highlights: "create a 30-second highlight reel"
+ /// - Content editing: "remove the section from 1:30 to 2:15"
+ /// ### Async Operations
+ /// Agent edits run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// 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> AgentEditJobAsResponseAsync( + global::Descript.AgentEditJobRequest request, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -99,6 +136,7 @@ partial void ProcessAgentEditJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/jobs/agent", baseUri: HttpClient.BaseAddress); @@ -178,6 +216,8 @@ partial void ProcessAgentEditJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +228,11 @@ partial void ProcessAgentEditJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +250,8 @@ partial void ProcessAgentEditJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +261,7 @@ partial void ProcessAgentEditJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +270,11 @@ partial void ProcessAgentEditJobResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +291,15 @@ partial void ProcessAgentEditJobResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +339,8 @@ partial void ProcessAgentEditJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +361,8 @@ partial void ProcessAgentEditJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid input: - Malformed request body - Invalid project_id or composition_id - Empty or invalid prompt @@ -521,9 +577,13 @@ partial void ProcessAgentEditJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.AgentEditJobResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.AgentEditJobResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -551,9 +611,13 @@ partial void ProcessAgentEditJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.AgentEditJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.AgentEditJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.CancelJob.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.CancelJob.g.cs index ee8cecb..f657708 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.CancelJob.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.CancelJob.g.cs @@ -48,6 +48,25 @@ partial void ProcessCancelJobResponse( global::System.Guid jobId, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await CancelJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Cancel job
+ /// Cancel a running 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 CancelJobAsResponseAsync( + global::System.Guid jobId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -77,6 +96,7 @@ partial void ProcessCancelJobResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: $"/jobs/{jobId}", baseUri: HttpClient.BaseAddress); @@ -150,6 +170,8 @@ partial void ProcessCancelJobResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -160,6 +182,11 @@ partial void ProcessCancelJobResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -177,6 +204,8 @@ partial void ProcessCancelJobResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -186,8 +215,7 @@ partial void ProcessCancelJobResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -196,6 +224,11 @@ partial void ProcessCancelJobResponse( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -212,14 +245,15 @@ partial void ProcessCancelJobResponse( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -259,6 +293,8 @@ partial void ProcessCancelJobResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -279,6 +315,8 @@ partial void ProcessCancelJobResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - invalid or missing authentication token @@ -451,6 +489,10 @@ partial void ProcessCancelJobResponse( { __response.EnsureSuccessStatusCode(); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -472,6 +514,10 @@ partial void ProcessCancelJobResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetJob.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetJob.g.cs index 45f802a..a944569 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetJob.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetJob.g.cs @@ -54,6 +54,28 @@ partial void ProcessGetJobResponseContent( global::System.Guid jobId, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get job status
+ /// Retrieve the status of any job.
+ /// The response format varies based on job type and includes type-specific fields. + ///
+ /// + /// 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> GetJobAsResponseAsync( + global::System.Guid jobId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -83,6 +105,7 @@ partial void ProcessGetJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: $"/jobs/{jobId}", baseUri: HttpClient.BaseAddress); @@ -156,6 +179,8 @@ partial void ProcessGetJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -166,6 +191,11 @@ partial void ProcessGetJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -183,6 +213,8 @@ partial void ProcessGetJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -192,8 +224,7 @@ partial void ProcessGetJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -202,6 +233,11 @@ partial void ProcessGetJobResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -218,14 +254,15 @@ partial void ProcessGetJobResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -265,6 +302,8 @@ partial void ProcessGetJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -285,6 +324,8 @@ partial void ProcessGetJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - invalid or missing authentication token @@ -461,9 +502,13 @@ partial void ProcessGetJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.JobStatus.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.JobStatus.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -491,9 +536,13 @@ partial void ProcessGetJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.JobStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.JobStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs index 445f33e..91a1c6a 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetProject.g.cs @@ -57,6 +57,31 @@ partial void ProcessGetProjectResponseContent( global::System.Guid projectId, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get project details
+ /// Get a detailed project summary including all media files and compositions.
+ /// Returns the project's id, name, drive_id, a map of media files (keyed by
+ /// display path) with type and duration, and a list of compositions with id,
+ /// name, duration, and media type.
+ /// Use this to inspect a project's contents before editing or importing media. + ///
+ /// + /// 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( + global::System.Guid projectId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +111,7 @@ partial void ProcessGetProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: $"/projects/{projectId}", baseUri: HttpClient.BaseAddress); @@ -159,6 +185,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -169,6 +197,11 @@ partial void ProcessGetProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -186,6 +219,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) { @@ -195,8 +230,7 @@ partial void ProcessGetProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -205,6 +239,11 @@ partial void ProcessGetProjectResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -221,14 +260,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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +308,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -288,6 +330,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - invalid or missing authentication token @@ -464,9 +508,13 @@ partial void ProcessGetProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.GetProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.GetProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -494,9 +542,13 @@ partial void ProcessGetProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.GetProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.GetProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetStatus.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetStatus.g.cs index 5cc503c..7b49b6a 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetStatus.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.GetStatus.g.cs @@ -54,6 +54,29 @@ partial void ProcessGetStatusResponseContent( public async global::System.Threading.Tasks.Task GetStatusAsync( global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetStatusAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Check API status
+ /// > **Work in progress** — This endpoint is not yet available and will return an error if called.
+ /// Check API availability and validate authentication token.
+ /// This endpoint can be used to:
+ /// - Verify that your authentication token is valid
+ /// - Check API connectivity without performing any heavy operations
+ /// Returns a success response if the token is valid, or a 401 error if the token is invalid or missing. + ///
+ /// 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> GetStatusAsResponseAsync( + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +105,7 @@ partial void ProcessGetStatusResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/status", baseUri: HttpClient.BaseAddress); @@ -154,6 +178,8 @@ partial void ProcessGetStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +190,11 @@ partial void ProcessGetStatusResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +212,8 @@ partial void ProcessGetStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +223,7 @@ partial void ProcessGetStatusResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +232,11 @@ partial void ProcessGetStatusResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +253,15 @@ partial void ProcessGetStatusResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +301,8 @@ partial void ProcessGetStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +323,8 @@ partial void ProcessGetStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - missing or invalid authentication token @@ -345,9 +387,13 @@ partial void ProcessGetStatusResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.GetStatusResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.GetStatusResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -375,9 +421,13 @@ partial void ProcessGetStatusResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.GetStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.GetStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ImportProjectMedia.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ImportProjectMedia.g.cs index 22f8595..89a7f16 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ImportProjectMedia.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ImportProjectMedia.g.cs @@ -69,6 +69,47 @@ partial void ProcessImportProjectMediaResponseContent( /// public async global::System.Threading.Tasks.Task ImportProjectMediaAsync( + global::Descript.ImportProjectMediaRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImportProjectMediaAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Import media and sequences
+ /// Import media files into a new or existing project and create compositions.
+ /// This endpoint can:
+ /// - Create a new project if `project_id` is not provided
+ /// - Import media files from URLs
+ /// - Create multitrack sequences
+ /// - Create compositions (timelines) from existing or new media in the project
+ /// - Trigger transcription and other background processing tasks
+ /// ### Media URL requirements
+ /// - URLs must be accessible by Descript servers
+ /// - URLs must support HTTP Range requests
+ /// - Recommended to sign URLs for 12-48 hours to reduce chance of failure
+ /// - [Supported file types](https://help.descript.com/hc/en-us/articles/10164098416909-Supported-file-types)
+ /// ### Direct file upload
+ /// Instead of providing a URL, you can upload files directly by specifying `content_type` and `file_size` for a media item. The response will include a signed `upload_url` for each direct upload item. PUT the file bytes to that URL, and the import job will process it automatically. See the [Direct file upload](#tag/Direct-file-upload) guide for a full walkthrough.
+ /// ### Async Operations
+ /// Imports run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job finishes (successfully or not).
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// 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> ImportProjectMediaAsResponseAsync( + global::Descript.ImportProjectMediaRequest request, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +144,7 @@ partial void ProcessImportProjectMediaResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/jobs/import/project_media", baseUri: HttpClient.BaseAddress); @@ -182,6 +224,8 @@ partial void ProcessImportProjectMediaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +236,11 @@ partial void ProcessImportProjectMediaResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +258,8 @@ partial void ProcessImportProjectMediaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +269,7 @@ partial void ProcessImportProjectMediaResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +278,11 @@ partial void ProcessImportProjectMediaResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +299,15 @@ partial void ProcessImportProjectMediaResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +347,8 @@ partial void ProcessImportProjectMediaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +369,8 @@ partial void ProcessImportProjectMediaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid input: - Malformed request body - Invalid media URLs - URLs not accessible or don't support Range requests - Media filename conflicts with existing files (when importing to existing project) @@ -563,9 +623,13 @@ partial void ProcessImportProjectMediaResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.ImportProjectMediaResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.ImportProjectMediaResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -593,9 +657,13 @@ partial void ProcessImportProjectMediaResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.ImportProjectMediaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.ImportProjectMediaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListJobs.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListJobs.g.cs index d376e72..6bb269a 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListJobs.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListJobs.g.cs @@ -82,6 +82,51 @@ partial void ProcessListJobsResponseContent( global::System.DateTime? createdBefore = default, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListJobsAsResponseAsync( + projectId: projectId, + type: type, + cursor: cursor, + limit: limit, + createdAfter: createdAfter, + createdBefore: createdBefore, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List jobs
+ /// List recent jobs with optional filtering by project or job type.
+ /// By default, jobs created within the last 7 days are returned. Use `created_after` and
+ /// `created_before` to customize the time range. The maximum lookback is 30 days.
+ /// Results are paginated. Use the `cursor` from the response `pagination.next_cursor` to
+ /// fetch subsequent pages.
+ /// Query parameters allow you to filter the results:
+ /// * Filter by `project_id` to see all jobs for a project
+ /// * Filter by `type` to see specific job types (import/project_media, agent) + ///
+ /// + /// + /// + /// + /// 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> ListJobsAsResponseAsync( + global::System.Guid? projectId = default, + global::Descript.ListJobsType? type = default, + string? cursor = default, + int? limit = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -116,16 +161,17 @@ partial void ProcessListJobsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/jobs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("project_id", projectId?.ToString()) .AddOptionalParameter("type", type?.ToValueString()) .AddOptionalParameter("cursor", cursor) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("created_after", createdAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) - .AddOptionalParameter("created_before", createdBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("created_before", createdBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) ; var __path = __pathBuilder.ToString(); __path = global::Descript.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -202,6 +248,8 @@ partial void ProcessListJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +260,11 @@ partial void ProcessListJobsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +282,8 @@ partial void ProcessListJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +293,7 @@ partial void ProcessListJobsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +302,11 @@ partial void ProcessListJobsResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +323,15 @@ partial void ProcessListJobsResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +371,8 @@ partial void ProcessListJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +393,8 @@ partial void ProcessListJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - invalid or missing authentication token @@ -431,9 +495,13 @@ partial void ProcessListJobsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.ListJobsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.ListJobsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -461,9 +529,13 @@ partial void ProcessListJobsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.ListJobsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.ListJobsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs index 39091f2..5fd6f77 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ListProjects.g.cs @@ -98,6 +98,63 @@ partial void ProcessListProjectsResponseContent( int? limit = default, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListProjectsAsResponseAsync( + name: name, + createdBy: createdBy, + createdAfter: createdAfter, + createdBefore: createdBefore, + updatedAfter: updatedAfter, + updatedBefore: updatedBefore, + sort: sort, + direction: direction, + cursor: cursor, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List projects
+ /// List projects accessible to the authenticated user within a drive.
+ /// The drive is determined from the access token.
+ /// Results are paginated. Use the `cursor` from the response `pagination.next_cursor`
+ /// to fetch subsequent pages. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: created_at + /// + /// + /// Default Value: desc + /// + /// + /// + /// 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> ListProjectsAsResponseAsync( + string? name = default, + string? createdBy = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::Descript.ListProjectsSort? sort = default, + global::Descript.ListProjectsDirection? direction = default, + string? cursor = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -136,9 +193,10 @@ partial void ProcessListProjectsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/projects", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("name", name) .AddOptionalParameter("created_by", createdBy) @@ -149,7 +207,7 @@ partial void ProcessListProjectsResponseContent( .AddOptionalParameter("sort", sort?.ToValueString()) .AddOptionalParameter("direction", direction?.ToValueString()) .AddOptionalParameter("cursor", cursor) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Descript.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -230,6 +288,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -240,6 +300,11 @@ partial void ProcessListProjectsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -257,6 +322,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) { @@ -266,8 +333,7 @@ partial void ProcessListProjectsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -276,6 +342,11 @@ partial void ProcessListProjectsResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -292,14 +363,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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -339,6 +411,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -359,6 +433,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - invalid or missing authentication token @@ -459,9 +535,13 @@ partial void ProcessListProjectsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.ListProjectsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.ListProjectsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -489,9 +569,13 @@ partial void ProcessListProjectsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.ListProjectsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.ListProjectsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs index bede848..8b392bd 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs @@ -67,6 +67,45 @@ partial void ProcessPublishJobResponseContent( /// public async global::System.Threading.Tasks.Task PublishJobAsync( + global::Descript.PublishJobRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PublishJobAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Publish project media
+ /// Publish a project composition to create a shareable link and download the exported file.
+ /// Publishes a specific composition from a project, rendering the output as video or audio
+ /// at the specified resolution. When the job completes successfully the result contains both:
+ /// - `share_url`: a public URL that can be used to view the published content on Descript's share site.
+ /// - `download_url`: a time-limited signed URL to download the exported media file directly,
+ /// along with `download_url_expires_at` indicating when the link expires.
+ /// ### Republishing
+ /// Publishing the same composition a second time automatically reuses the previous share URL,
+ /// overwriting its content — so bookmarks and links handed out for the first publish keep working.
+ /// Republish matching is keyed on `(project_id, composition_id, media_type)`, so a Video publish
+ /// and an Audio publish of the same composition produce two separate share URLs.
+ /// ### Async Operations
+ /// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,
+ /// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
+ /// + /// 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> PublishJobAsResponseAsync( + global::Descript.PublishJobRequest request, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +140,7 @@ partial void ProcessPublishJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/jobs/publish", baseUri: HttpClient.BaseAddress); @@ -180,6 +220,8 @@ partial void ProcessPublishJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +232,11 @@ partial void ProcessPublishJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +254,8 @@ partial void ProcessPublishJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +265,7 @@ partial void ProcessPublishJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +274,11 @@ partial void ProcessPublishJobResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +295,15 @@ partial void ProcessPublishJobResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +343,8 @@ partial void ProcessPublishJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +365,8 @@ partial void ProcessPublishJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid input: - Malformed request body - Invalid project_id or composition_id format - Invalid media_type or resolution value @@ -518,9 +576,13 @@ partial void ProcessPublishJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.PublishJobResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.PublishJobResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -548,9 +610,13 @@ partial void ProcessPublishJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.PublishJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.PublishJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.g.cs index 91647a1..0c89782 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.g.cs @@ -73,10 +73,10 @@ public ApiEndpointsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ApiEndpointsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Descript.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Descript.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs b/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..7401d04 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Descript +{ + /// + /// 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/Descript/Generated/Descript.DescriptClient.g.cs b/src/libs/Descript/Generated/Descript.DescriptClient.g.cs index c9b9984..8f3d7ac 100644 --- a/src/libs/Descript/Generated/Descript.DescriptClient.g.cs +++ b/src/libs/Descript/Generated/Descript.DescriptClient.g.cs @@ -43,7 +43,7 @@ public sealed partial class DescriptClient : global::Descript.IDescriptClient, g /// /// Import media, edit projects with AI, and query jobs and projects. /// - public ApiEndpointsClient ApiEndpoints => new ApiEndpointsClient(HttpClient, authorizations: Authorizations, options: Options) + public ApiEndpointsClient ApiEndpoints => new ApiEndpointsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -85,7 +85,7 @@ public sealed partial class DescriptClient : global::Descript.IDescriptClient, g /// Descript Project should be created.
/// They'll then be redirected to the Project, where they can monitor the progress of the import and start editing. /// - public EditInDescriptClient EditInDescript => new EditInDescriptClient(HttpClient, authorizations: Authorizations, options: Options) + public EditInDescriptClient EditInDescript => new EditInDescriptClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -105,7 +105,7 @@ public sealed partial class DescriptClient : global::Descript.IDescriptClient, g /// <meta property="descript:source" content="409148bd-81aa-4af6-a9c3-29b761506f3a" />
/// ```. /// - public ExportFromDescriptClient ExportFromDescript => new ExportFromDescriptClient(HttpClient, authorizations: Authorizations, options: Options) + public ExportFromDescriptClient ExportFromDescript => new ExportFromDescriptClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -144,10 +144,10 @@ public DescriptClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DescriptClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Descript.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Descript.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Descript/Generated/Descript.EditInDescriptClient.PostEditInDescriptSchema.g.cs b/src/libs/Descript/Generated/Descript.EditInDescriptClient.PostEditInDescriptSchema.g.cs index e6daff3..25719ed 100644 --- a/src/libs/Descript/Generated/Descript.EditInDescriptClient.PostEditInDescriptSchema.g.cs +++ b/src/libs/Descript/Generated/Descript.EditInDescriptClient.PostEditInDescriptSchema.g.cs @@ -85,6 +85,63 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( /// public async global::System.Threading.Tasks.Task PostEditInDescriptSchemaAsync( + global::Descript.EditInDescriptSchemaPostBody request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostEditInDescriptSchemaAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Import URL
+ /// Create an Import URL by sending a Project schema to Descript API from your service's backend.
+ /// ### Import Schema
+ /// Our import schemas are specified as a minimal JSON list of files which is detailed in full at the bottom of this
+ /// section. At it's smallest, the request body looks like:
+ /// ```
+ /// {
+ /// "partner_drive_id": "162c61d1-6ced-4b25-a622-7dba922983ee",
+ /// "project_schema": {
+ /// "schema_version": "1.0.0",
+ /// "files": [{"uri": "https://descriptusercontent.com/jane.wav?signature=d182bca64bf94a1483d2fd16b579f955"}]
+ /// }
+ /// }
+ /// ```
+ /// ### File Access
+ /// The file paths provided in the schema need to either be public or pre-signed URIs with enough time before
+ /// expiration for failures and retries, we suggest URIs that won't expire for 48 hours. We ask that the files have
+ /// already been saved when the import link is generated to minimize cases where we're waiting for eventually
+ /// consistent storage of files that will never be written. We will, however, wait for eventual consistency of the
+ /// storage layer and retry fetching files before eventually timing out.
+ /// Files must be hosted on preapproved hosts as our import process has an allow list which it checks URIs against.
+ /// Files will be requested with `User-Agent: Descriptbot/1.0` (version may change) for tracking purposes.
+ /// ### Import link expiration
+ /// Import links are no longer valid after a user imports their data once. Viewing an already used import link will
+ /// not allow for importing again and will not provide access to a previously created Descript Project. Partners are
+ /// able to generate a new import link at any time, regardless of if a previous import link has been used.
+ /// The API does not currently provide partners with a link to the Descript Project, though users will be redirected
+ /// to it from Descript's web interface the first time they import files, and can always find the Project in Descript.
+ /// Import links expire after 3 hours and attempting to use an import link after the pre-signed links in the schema
+ /// file have expired will result in an error, so we recommend generating the import link after the user has clicked
+ /// the Edit in Descript button.
+ /// ### Supported media specification
+ /// We recommend sending the highest quality, uncompressed versions of files available to you. If you have multiple
+ /// tracks, we recommend prioritizing sending us the full multi-track sequence over a combined file.
+ /// * Audio: WAV, FLAC, AAC, MP3
+ /// * Video: h264, HEVC (container: MOV, MP4) + ///
+ /// + /// 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> PostEditInDescriptSchemaAsResponseAsync( + global::Descript.EditInDescriptSchemaPostBody request, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -119,6 +176,7 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: "/edit_in_descript/schema", baseUri: HttpClient.BaseAddress); @@ -198,6 +256,8 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -208,6 +268,11 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -225,6 +290,8 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -234,8 +301,7 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -244,6 +310,11 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -260,14 +331,15 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -307,6 +379,8 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -327,6 +401,8 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // @@ -455,9 +531,13 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.EditInDescriptSchemaPostResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.EditInDescriptSchemaPostResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -485,9 +565,13 @@ partial void ProcessPostEditInDescriptSchemaResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.EditInDescriptSchemaPostResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.EditInDescriptSchemaPostResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.EditInDescriptClient.g.cs b/src/libs/Descript/Generated/Descript.EditInDescriptClient.g.cs index 527bf8f..882d088 100644 --- a/src/libs/Descript/Generated/Descript.EditInDescriptClient.g.cs +++ b/src/libs/Descript/Generated/Descript.EditInDescriptClient.g.cs @@ -106,10 +106,10 @@ public EditInDescriptClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EditInDescriptClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Descript.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Descript.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.GetPublishedProjectMetadata.g.cs b/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.GetPublishedProjectMetadata.g.cs index 079724d..6bf9e28 100644 --- a/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.GetPublishedProjectMetadata.g.cs +++ b/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.GetPublishedProjectMetadata.g.cs @@ -56,6 +56,30 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( string publishedProjectSlug, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetPublishedProjectMetadataAsResponseAsync( + publishedProjectSlug: publishedProjectSlug, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Published Project Metadata
+ /// Retrieve metadata for a published Descript project by its URL slug. This endpoint provides information
+ /// about the published project including title, duration, publisher details, privacy settings, and subtitles.
+ /// This endpoint requires authentication using a personal token and is subject to rate limiting of 1000
+ /// requests per hour 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> GetPublishedProjectMetadataAsResponseAsync( + string publishedProjectSlug, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -85,6 +109,7 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Descript.PathBuilder( path: $"/published_projects/{publishedProjectSlug}", baseUri: HttpClient.BaseAddress); @@ -158,6 +183,8 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -168,6 +195,11 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -185,6 +217,8 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -194,8 +228,7 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -204,6 +237,11 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( __attempt < __maxAttempts && global::Descript.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Descript.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Descript.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Descript.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -220,14 +258,15 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( 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::Descript.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -267,6 +306,8 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -287,6 +328,8 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Unauthorized - invalid or missing authentication token. @@ -501,9 +544,13 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Descript.PublishedProjectMetadata.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Descript.PublishedProjectMetadata.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -531,9 +578,13 @@ partial void ProcessGetPublishedProjectMetadataResponseContent( #endif ).ConfigureAwait(false); - return - await global::Descript.PublishedProjectMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Descript.PublishedProjectMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Descript.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Descript.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.g.cs b/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.g.cs index 77ada07..8062785 100644 --- a/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.g.cs +++ b/src/libs/Descript/Generated/Descript.ExportFromDescriptClient.g.cs @@ -84,10 +84,10 @@ public ExportFromDescriptClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ExportFromDescriptClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Descript.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Descript.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.AgentEditJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.AgentEditJob.g.cs index 04cc15b..2a77bc3 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.AgentEditJob.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.AgentEditJob.g.cs @@ -49,6 +49,33 @@ public partial interface IApiEndpointsClient /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
/// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). /// + /// + /// 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> AgentEditJobAsResponseAsync( + + global::Descript.AgentEditJobRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Agent edit
+ /// Use a background agent to create and edit projects using a natural language prompt.
+ /// - **Edit existing project**: Provide a `project_id` to edit an existing project
+ /// - **Target a specific composition**: Provide both `project_id` and `composition_id` to direct the agent to a specific composition within the project
+ /// - **Create new project**: Provide a `project_name` instead of `project_id` to create a new project
+ /// ### Common use cases
+ /// - Create new content: "create a 30-second video about cooking tips"
+ /// - Apply audio effects: "add studio sound to every clip"
+ /// - Remove filler words: "remove all filler words from the transcript"
+ /// - Create highlights: "create a 30-second highlight reel"
+ /// - Content editing: "remove the section from 1:30 to 2:15"
+ /// ### Async Operations
+ /// Agent edits run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
/// /// The ID of an existing project to edit. Mutually exclusive with `project_name`.
/// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.CancelJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.CancelJob.g.cs index b67de90..cd4d891 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.CancelJob.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.CancelJob.g.cs @@ -16,5 +16,17 @@ public partial interface IApiEndpointsClient global::System.Guid jobId, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel job
+ /// Cancel a running 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 CancelJobAsResponseAsync( + global::System.Guid jobId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetJob.g.cs index a52a097..d90db99 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetJob.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetJob.g.cs @@ -17,5 +17,18 @@ public partial interface IApiEndpointsClient global::System.Guid jobId, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get job status
+ /// Retrieve the status of any job.
+ /// The response format varies based on job type and includes type-specific fields. + ///
+ /// + /// 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> GetJobAsResponseAsync( + global::System.Guid jobId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs index c2d6c03..7adbccf 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetProject.g.cs @@ -20,5 +20,21 @@ public partial interface IApiEndpointsClient global::System.Guid projectId, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get project details
+ /// Get a detailed project summary including all media files and compositions.
+ /// Returns the project's id, name, drive_id, a map of media files (keyed by
+ /// display path) with type and duration, and a list of compositions with id,
+ /// name, duration, and media type.
+ /// Use this to inspect a project's contents before editing or importing media. + ///
+ /// + /// 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( + global::System.Guid projectId, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetStatus.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetStatus.g.cs index 4dfd1c2..e48d8ba 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetStatus.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.GetStatus.g.cs @@ -19,5 +19,20 @@ public partial interface IApiEndpointsClient global::System.Threading.Tasks.Task GetStatusAsync( global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Check API status
+ /// > **Work in progress** — This endpoint is not yet available and will return an error if called.
+ /// Check API availability and validate authentication token.
+ /// This endpoint can be used to:
+ /// - Verify that your authentication token is valid
+ /// - Check API connectivity without performing any heavy operations
+ /// Returns a success response if the token is valid, or a 401 error if the token is invalid or missing. + ///
+ /// 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> GetStatusAsResponseAsync( + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ImportProjectMedia.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ImportProjectMedia.g.cs index 5ec5b86..50f51e1 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ImportProjectMedia.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ImportProjectMedia.g.cs @@ -57,6 +57,37 @@ public partial interface IApiEndpointsClient /// If `callback_url` is provided, Descript will POST the job status to that URL when the job finishes (successfully or not).
/// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). /// + /// + /// 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> ImportProjectMediaAsResponseAsync( + + global::Descript.ImportProjectMediaRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Import media and sequences
+ /// Import media files into a new or existing project and create compositions.
+ /// This endpoint can:
+ /// - Create a new project if `project_id` is not provided
+ /// - Import media files from URLs
+ /// - Create multitrack sequences
+ /// - Create compositions (timelines) from existing or new media in the project
+ /// - Trigger transcription and other background processing tasks
+ /// ### Media URL requirements
+ /// - URLs must be accessible by Descript servers
+ /// - URLs must support HTTP Range requests
+ /// - Recommended to sign URLs for 12-48 hours to reduce chance of failure
+ /// - [Supported file types](https://help.descript.com/hc/en-us/articles/10164098416909-Supported-file-types)
+ /// ### Direct file upload
+ /// Instead of providing a URL, you can upload files directly by specifying `content_type` and `file_size` for a media item. The response will include a signed `upload_url` for each direct upload item. PUT the file bytes to that URL, and the import job will process it automatically. See the [Direct file upload](#tag/Direct-file-upload) guide for a full walkthrough.
+ /// ### Async Operations
+ /// Imports run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job finishes (successfully or not).
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
/// /// Existing project ID to import media into. If not provided, a new project will be created.
/// When importing into an existing project, media filenames must not conflict with existing files.
diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListJobs.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListJobs.g.cs index c9254e3..8002bd4 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListJobs.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListJobs.g.cs @@ -35,5 +35,36 @@ public partial interface IApiEndpointsClient global::System.DateTime? createdBefore = default, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List jobs
+ /// List recent jobs with optional filtering by project or job type.
+ /// By default, jobs created within the last 7 days are returned. Use `created_after` and
+ /// `created_before` to customize the time range. The maximum lookback is 30 days.
+ /// Results are paginated. Use the `cursor` from the response `pagination.next_cursor` to
+ /// fetch subsequent pages.
+ /// Query parameters allow you to filter the results:
+ /// * Filter by `project_id` to see all jobs for a project
+ /// * Filter by `type` to see specific job types (import/project_media, agent) + ///
+ /// + /// + /// + /// + /// 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> ListJobsAsResponseAsync( + global::System.Guid? projectId = default, + global::Descript.ListJobsType? type = default, + string? cursor = default, + int? limit = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs index 25a1769..f2beff0 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ListProjects.g.cs @@ -43,5 +43,44 @@ public partial interface IApiEndpointsClient int? limit = default, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List projects
+ /// List projects accessible to the authenticated user within a drive.
+ /// The drive is determined from the access token.
+ /// Results are paginated. Use the `cursor` from the response `pagination.next_cursor`
+ /// to fetch subsequent pages. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Default Value: created_at + /// + /// + /// Default Value: desc + /// + /// + /// + /// 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> ListProjectsAsResponseAsync( + string? name = default, + string? createdBy = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + global::System.DateTime? updatedAfter = default, + global::System.DateTime? updatedBefore = default, + global::Descript.ListProjectsSort? sort = default, + global::Descript.ListProjectsDirection? direction = default, + string? cursor = default, + int? limit = default, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs index d7f87d5..99182fc 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs @@ -53,6 +53,35 @@ public partial interface IApiEndpointsClient /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
/// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). /// + /// + /// 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> PublishJobAsResponseAsync( + + global::Descript.PublishJobRequest request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Publish project media
+ /// Publish a project composition to create a shareable link and download the exported file.
+ /// Publishes a specific composition from a project, rendering the output as video or audio
+ /// at the specified resolution. When the job completes successfully the result contains both:
+ /// - `share_url`: a public URL that can be used to view the published content on Descript's share site.
+ /// - `download_url`: a time-limited signed URL to download the exported media file directly,
+ /// along with `download_url_expires_at` indicating when the link expires.
+ /// ### Republishing
+ /// Publishing the same composition a second time automatically reuses the previous share URL,
+ /// overwriting its content — so bookmarks and links handed out for the first publish keep working.
+ /// Republish matching is keyed on `(project_id, composition_id, media_type)`, so a Video publish
+ /// and an Audio publish of the same composition produce two separate share URLs.
+ /// ### Async Operations
+ /// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,
+ /// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.
+ /// ### Dynamic webhook
+ /// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.
+ /// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob). + ///
/// /// The ID of the project to publish.
/// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb diff --git a/src/libs/Descript/Generated/Descript.IEditInDescriptClient.PostEditInDescriptSchema.g.cs b/src/libs/Descript/Generated/Descript.IEditInDescriptClient.PostEditInDescriptSchema.g.cs index 56253f0..5805c96 100644 --- a/src/libs/Descript/Generated/Descript.IEditInDescriptClient.PostEditInDescriptSchema.g.cs +++ b/src/libs/Descript/Generated/Descript.IEditInDescriptClient.PostEditInDescriptSchema.g.cs @@ -89,6 +89,53 @@ public partial interface IEditInDescriptClient /// * Audio: WAV, FLAC, AAC, MP3
/// * Video: h264, HEVC (container: MOV, MP4) /// + /// + /// 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> PostEditInDescriptSchemaAsResponseAsync( + + global::Descript.EditInDescriptSchemaPostBody request, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Import URL
+ /// Create an Import URL by sending a Project schema to Descript API from your service's backend.
+ /// ### Import Schema
+ /// Our import schemas are specified as a minimal JSON list of files which is detailed in full at the bottom of this
+ /// section. At it's smallest, the request body looks like:
+ /// ```
+ /// {
+ /// "partner_drive_id": "162c61d1-6ced-4b25-a622-7dba922983ee",
+ /// "project_schema": {
+ /// "schema_version": "1.0.0",
+ /// "files": [{"uri": "https://descriptusercontent.com/jane.wav?signature=d182bca64bf94a1483d2fd16b579f955"}]
+ /// }
+ /// }
+ /// ```
+ /// ### File Access
+ /// The file paths provided in the schema need to either be public or pre-signed URIs with enough time before
+ /// expiration for failures and retries, we suggest URIs that won't expire for 48 hours. We ask that the files have
+ /// already been saved when the import link is generated to minimize cases where we're waiting for eventually
+ /// consistent storage of files that will never be written. We will, however, wait for eventual consistency of the
+ /// storage layer and retry fetching files before eventually timing out.
+ /// Files must be hosted on preapproved hosts as our import process has an allow list which it checks URIs against.
+ /// Files will be requested with `User-Agent: Descriptbot/1.0` (version may change) for tracking purposes.
+ /// ### Import link expiration
+ /// Import links are no longer valid after a user imports their data once. Viewing an already used import link will
+ /// not allow for importing again and will not provide access to a previously created Descript Project. Partners are
+ /// able to generate a new import link at any time, regardless of if a previous import link has been used.
+ /// The API does not currently provide partners with a link to the Descript Project, though users will be redirected
+ /// to it from Descript's web interface the first time they import files, and can always find the Project in Descript.
+ /// Import links expire after 3 hours and attempting to use an import link after the pre-signed links in the schema
+ /// file have expired will result in an error, so we recommend generating the import link after the user has clicked
+ /// the Edit in Descript button.
+ /// ### Supported media specification
+ /// We recommend sending the highest quality, uncompressed versions of files available to you. If you have multiple
+ /// tracks, we recommend prioritizing sending us the full multi-track sequence over a combined file.
+ /// * Audio: WAV, FLAC, AAC, MP3
+ /// * Video: h264, HEVC (container: MOV, MP4) + ///
/// /// The drive id associated with the auth token.
/// Example: aa3b2d8d-e5ca-41c2-8801-683328293fb9 diff --git a/src/libs/Descript/Generated/Descript.IExportFromDescriptClient.GetPublishedProjectMetadata.g.cs b/src/libs/Descript/Generated/Descript.IExportFromDescriptClient.GetPublishedProjectMetadata.g.cs index 84bc025..4ec9d85 100644 --- a/src/libs/Descript/Generated/Descript.IExportFromDescriptClient.GetPublishedProjectMetadata.g.cs +++ b/src/libs/Descript/Generated/Descript.IExportFromDescriptClient.GetPublishedProjectMetadata.g.cs @@ -19,5 +19,20 @@ public partial interface IExportFromDescriptClient string publishedProjectSlug, global::Descript.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Published Project Metadata
+ /// Retrieve metadata for a published Descript project by its URL slug. This endpoint provides information
+ /// about the published project including title, duration, publisher details, privacy settings, and subtitles.
+ /// This endpoint requires authentication using a personal token and is subject to rate limiting of 1000
+ /// requests per hour 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> GetPublishedProjectMetadataAsResponseAsync( + string publishedProjectSlug, + global::Descript.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs b/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs index c2d993f..d9f9c64 100644 --- a/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs +++ b/src/libs/Descript/Generated/Descript.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::Descript.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::Descript.AutoSDKClientOptions clientOptions, global::Descript.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Descript.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::Descript.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(