diff --git a/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs b/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs index 815a80d..6a69290 100644 --- a/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs +++ b/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs @@ -14,10 +14,16 @@ internal static partial class ApiEndpointsPublishJobCommandApiCommand Required = true, }; - private static Option CompositionId { get; } = new( + private static Option CompositionId { get; } = new( name: @"--composition-id") { - Description = @"The ID of the composition within the project to publish.", + Description = @"Composition to publish. If omitted, the first composition in the project is used. + +Accepts any of the following formats: +- A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`) +- A 5-character short ID from a Descript URL (e.g. `39677`) +- A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`) +", }; private static Option MediaType { get; } = new( diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs index 445b477..8db6356 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs @@ -480,6 +480,43 @@ partial void ProcessPublishJobResponseContent( h => h.Key, h => h.Value)); } + // Not found: - Composition doesn't exist in the specified project (when `composition_id` is provided) + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Descript.Error404? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Descript.Error404.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Descript.Error404.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Descript.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // Unprocessable Entity: - `media_type` was explicitly set to `Video` but the target composition has no video content. Retry with `media_type` set to `Audio` (or omit it to publish as audio). if ((int)__response.StatusCode == 422) { @@ -675,7 +712,11 @@ partial void ProcessPublishJobResponseContent( /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition within the project to publish.
+ /// Composition to publish. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -705,7 +746,7 @@ partial void ProcessPublishJobResponseContent( /// public async global::System.Threading.Tasks.Task PublishJobAsync( global::System.Guid projectId, - global::System.Guid? compositionId = default, + string? compositionId = default, global::Descript.PublishJobRequestMediaType? mediaType = default, global::Descript.PublishJobRequestResolution? resolution = default, string? callbackUrl = default, diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs index 586faa8..e694c38 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs @@ -87,7 +87,11 @@ public partial interface IApiEndpointsClient /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition within the project to publish.
+ /// Composition to publish. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -117,7 +121,7 @@ public partial interface IApiEndpointsClient /// global::System.Threading.Tasks.Task PublishJobAsync( global::System.Guid projectId, - global::System.Guid? compositionId = default, + string? compositionId = default, global::Descript.PublishJobRequestMediaType? mediaType = default, global::Descript.PublishJobRequestResolution? resolution = default, string? callbackUrl = default, diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs index 5c9ca32..5f2781d 100644 --- a/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs @@ -18,12 +18,16 @@ public sealed partial class PublishJobRequest public required global::System.Guid ProjectId { get; set; } /// - /// The ID of the composition within the project to publish.
+ /// Composition to publish. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 ///
/// 39677a40-1c43-4c36-8449-46cfbc4de2b5 [global::System.Text.Json.Serialization.JsonPropertyName("composition_id")] - public global::System.Guid? CompositionId { get; set; } + public string? CompositionId { get; set; } /// /// Media type of the published output. Defaults to `Video` when omitted.
@@ -77,7 +81,11 @@ public sealed partial class PublishJobRequest /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition within the project to publish.
+ /// Composition to publish. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -107,7 +115,7 @@ public sealed partial class PublishJobRequest #endif public PublishJobRequest( global::System.Guid projectId, - global::System.Guid? compositionId, + string? compositionId, global::Descript.PublishJobRequestMediaType? mediaType, global::Descript.PublishJobRequestResolution? resolution, string? callbackUrl, diff --git a/src/libs/Descript/openapi.yaml b/src/libs/Descript/openapi.yaml index d342651..b9a106b 100644 --- a/src/libs/Descript/openapi.yaml +++ b/src/libs/Descript/openapi.yaml @@ -1140,8 +1140,13 @@ paths: example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb composition_id: type: string - format: uuid - description: The ID of the composition within the project to publish. + description: | + Composition to publish. If omitted, the first composition in the project is used. + + Accepts any of the following formats: + - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`) + - A 5-character short ID from a Descript URL (e.g. `39677`) + - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`) example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 media_type: type: string @@ -1293,6 +1298,20 @@ paths: value: error: forbidden message: Forbidden + '404': + description: | + Not found: + - Composition doesn't exist in the specified project (when `composition_id` is provided) + content: + application/json: + schema: + $ref: '#/components/schemas/Error404' + examples: + composition_not_found: + summary: Composition not found in project + value: + error: not_found + message: No composition matching '5b507b2b-e3ef-4146-a0d0-6741df516973' found in project 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb '422': description: | Unprocessable Entity: