Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ internal static partial class ApiEndpointsPublishJobCommandApiCommand
Required = true,
};

private static Option<global::System.Guid?> CompositionId { get; } = new(
private static Option<string?> 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<global::Descript.PublishJobRequestMediaType?> MediaType { get; } = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<global::Descript.Error404>.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)
{
Expand Down Expand Up @@ -675,7 +712,11 @@ partial void ProcessPublishJobResponseContent(
/// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb
/// </param>
/// <param name="compositionId">
/// The ID of the composition within the project to publish.<br/>
/// Composition to publish. If omitted, the first composition in the project is used.<br/>
/// Accepts any of the following formats:<br/>
/// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)<br/>
/// - A 5-character short ID from a Descript URL (e.g. `39677`)<br/>
/// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)<br/>
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5
/// </param>
/// <param name="mediaType">
Expand Down Expand Up @@ -705,7 +746,7 @@ partial void ProcessPublishJobResponseContent(
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::Descript.PublishJobResponse> 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ public partial interface IApiEndpointsClient
/// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb
/// </param>
/// <param name="compositionId">
/// The ID of the composition within the project to publish.<br/>
/// Composition to publish. If omitted, the first composition in the project is used.<br/>
/// Accepts any of the following formats:<br/>
/// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)<br/>
/// - A 5-character short ID from a Descript URL (e.g. `39677`)<br/>
/// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)<br/>
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5
/// </param>
/// <param name="mediaType">
Expand Down Expand Up @@ -117,7 +121,7 @@ public partial interface IApiEndpointsClient
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Descript.PublishJobResponse> 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,
Expand Down
16 changes: 12 additions & 4 deletions src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ public sealed partial class PublishJobRequest
public required global::System.Guid ProjectId { get; set; }

/// <summary>
/// The ID of the composition within the project to publish.<br/>
/// Composition to publish. If omitted, the first composition in the project is used.<br/>
/// Accepts any of the following formats:<br/>
/// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)<br/>
/// - A 5-character short ID from a Descript URL (e.g. `39677`)<br/>
/// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)<br/>
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5
/// </summary>
/// <example>39677a40-1c43-4c36-8449-46cfbc4de2b5</example>
[global::System.Text.Json.Serialization.JsonPropertyName("composition_id")]
public global::System.Guid? CompositionId { get; set; }
public string? CompositionId { get; set; }

/// <summary>
/// Media type of the published output. Defaults to `Video` when omitted.<br/>
Expand Down Expand Up @@ -77,7 +81,11 @@ public sealed partial class PublishJobRequest
/// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb
/// </param>
/// <param name="compositionId">
/// The ID of the composition within the project to publish.<br/>
/// Composition to publish. If omitted, the first composition in the project is used.<br/>
/// Accepts any of the following formats:<br/>
/// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)<br/>
/// - A 5-character short ID from a Descript URL (e.g. `39677`)<br/>
/// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)<br/>
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5
/// </param>
/// <param name="mediaType">
Expand Down Expand Up @@ -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,
Expand Down
23 changes: 21 additions & 2 deletions src/libs/Descript/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down