From e285a15a54c522161a4670684c82600790712439 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Jun 2026 22:14:37 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...iEndpointsPublishJobCommandApiCommand.g.cs | 8 +- ...escript.ApiEndpointsClient.PublishJob.g.cs | 15 ++- ...script.IApiEndpointsClient.PublishJob.g.cs | 6 +- ...verters.PublishSuccessResultMediaType.g.cs | 53 ++++++++ ...PublishSuccessResultMediaTypeNullable.g.cs | 60 +++++++++ .../Descript.JsonSerializerContext.g.cs | 5 + .../Descript.JsonSerializerContextTypes.g.cs | 118 +++++++++--------- .../Descript.Models.PublishJobRequest.g.cs | 12 +- ...ipt.Models.PublishJobRequestMediaType.g.cs | 8 +- .../Descript.Models.PublishSuccessResult.g.cs | 15 +++ ....Models.PublishSuccessResultMediaType.g.cs | 52 ++++++++ src/libs/Descript/openapi.yaml | 31 ++++- 12 files changed, 315 insertions(+), 68 deletions(-) create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaType.g.cs create mode 100644 src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaTypeNullable.g.cs create mode 100644 src/libs/Descript/Generated/Descript.Models.PublishSuccessResultMediaType.g.cs diff --git a/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs b/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs index fb50e0f..815a80d 100644 --- a/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs +++ b/src/cli/Descript.CLI/Commands/ApiEndpointsPublishJobCommandApiCommand.g.cs @@ -23,7 +23,13 @@ internal static partial class ApiEndpointsPublishJobCommandApiCommand private static Option MediaType { get; } = new( name: @"--media-type") { - Description = @"Media type of the published output.", + Description = @"Media type of the published output. Defaults to `Video` when omitted. + +If the target composition has no video content: +- omitting `media_type` publishes it as `Audio` + (the completed job result reports `media_type: Audio`), +- explicitly requesting `Video` is rejected with a 422. +", }; private static Option Resolution { 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 66ae8af..445b477 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.PublishJob.g.cs @@ -480,20 +480,24 @@ partial void ProcessPublishJobResponseContent( 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) { string? __content_422 = null; global::System.Exception? __exception_422 = null; + global::Descript.Error400? __value_422 = null; try { if (__effectiveReadResponseAsString) { __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Descript.Error400.FromJson(__content_422, JsonSerializerContext); } else { __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Descript.Error400.FromJson(__content_422, JsonSerializerContext); } } catch (global::System.Exception __ex) @@ -502,11 +506,12 @@ partial void ProcessPublishJobResponseContent( } - throw global::Descript.ApiException.Create( + throw global::Descript.ApiException.Create( statusCode: __response.StatusCode, message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_422, responseBody: __content_422, + responseObject: __value_422, responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, @@ -674,7 +679,11 @@ partial void ProcessPublishJobResponseContent( /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// - /// Media type of the published output.
+ /// Media type of the published output. Defaults to `Video` when omitted.
+ /// If the target composition has no video content:
+ /// - omitting `media_type` publishes it as `Audio`
+ /// (the completed job result reports `media_type: Audio`),
+ /// - explicitly requesting `Video` is rejected with a 422.
/// Default Value: Video /// /// diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs index 99182fc..586faa8 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.PublishJob.g.cs @@ -91,7 +91,11 @@ public partial interface IApiEndpointsClient /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// - /// Media type of the published output.
+ /// Media type of the published output. Defaults to `Video` when omitted.
+ /// If the target composition has no video content:
+ /// - omitting `media_type` publishes it as `Audio`
+ /// (the completed job result reports `media_type: Audio`),
+ /// - explicitly requesting `Video` is rejected with a 422.
/// Default Value: Video /// /// diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaType.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaType.g.cs new file mode 100644 index 0000000..e12ed0b --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishSuccessResultMediaTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishSuccessResultMediaType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishSuccessResultMediaTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishSuccessResultMediaType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishSuccessResultMediaType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishSuccessResultMediaType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Descript.PublishSuccessResultMediaTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaTypeNullable.g.cs b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaTypeNullable.g.cs new file mode 100644 index 0000000..9958751 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.JsonConverters.PublishSuccessResultMediaTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Descript.JsonConverters +{ + /// + public sealed class PublishSuccessResultMediaTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Descript.PublishSuccessResultMediaType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Descript.PublishSuccessResultMediaTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Descript.PublishSuccessResultMediaType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Descript.PublishSuccessResultMediaType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Descript.PublishSuccessResultMediaType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Descript.PublishSuccessResultMediaTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs b/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs index 33d4db4..a24c8cf 100644 --- a/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonSerializerContext.g.cs @@ -89,6 +89,10 @@ namespace Descript typeof(global::Descript.JsonConverters.PublishSuccessResultStatusNullableJsonConverter), + typeof(global::Descript.JsonConverters.PublishSuccessResultMediaTypeJsonConverter), + + typeof(global::Descript.JsonConverters.PublishSuccessResultMediaTypeNullableJsonConverter), + typeof(global::Descript.JsonConverters.PublishErrorResultStatusJsonConverter), typeof(global::Descript.JsonConverters.PublishErrorResultStatusNullableJsonConverter), @@ -232,6 +236,7 @@ namespace Descript [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.AgentJobStatusResultDiscriminatorStatus), TypeInfoPropertyName = "AgentJobStatusResultDiscriminatorStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishSuccessResult))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishSuccessResultStatus), TypeInfoPropertyName = "PublishSuccessResultStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishSuccessResultMediaType), TypeInfoPropertyName = "PublishSuccessResultMediaType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishErrorResult))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishErrorResultStatus), TypeInfoPropertyName = "PublishErrorResultStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Descript.PublishJobStatus))] diff --git a/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs b/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs index bd6d906..28240f2 100644 --- a/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs +++ b/src/libs/Descript/Generated/Descript.JsonSerializerContextTypes.g.cs @@ -276,231 +276,235 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Descript.PublishErrorResult? Type62 { get; set; } + public global::Descript.PublishSuccessResultMediaType? Type62 { get; set; } /// /// /// - public global::Descript.PublishErrorResultStatus? Type63 { get; set; } + public global::Descript.PublishErrorResult? Type63 { get; set; } /// /// /// - public global::Descript.PublishJobStatus? Type64 { get; set; } + public global::Descript.PublishErrorResultStatus? Type64 { get; set; } /// /// /// - public global::Descript.PublishJobStatusJobType? Type65 { get; set; } + public global::Descript.PublishJobStatus? Type65 { get; set; } /// /// /// - public global::Descript.PublishJobStatusJobState? Type66 { get; set; } + public global::Descript.PublishJobStatusJobType? Type66 { get; set; } /// /// /// - public global::Descript.PublishJobStatusProgress? Type67 { get; set; } + public global::Descript.PublishJobStatusJobState? Type67 { get; set; } /// /// /// - public global::Descript.Result3? Type68 { get; set; } + public global::Descript.PublishJobStatusProgress? Type68 { get; set; } /// /// /// - public global::Descript.PublishJobStatusResultDiscriminator? Type69 { get; set; } + public global::Descript.Result3? Type69 { get; set; } /// /// /// - public global::Descript.PublishJobStatusResultDiscriminatorStatus? Type70 { get; set; } + public global::Descript.PublishJobStatusResultDiscriminator? Type70 { get; set; } /// /// /// - public global::Descript.JobStatus? Type71 { get; set; } + public global::Descript.PublishJobStatusResultDiscriminatorStatus? Type71 { get; set; } /// /// /// - public global::Descript.JobStatusDiscriminator? Type72 { get; set; } + public global::Descript.JobStatus? Type72 { get; set; } /// /// /// - public global::Descript.JobStatusDiscriminatorJobType? Type73 { get; set; } + public global::Descript.JobStatusDiscriminator? Type73 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequest? Type74 { get; set; } + public global::Descript.JobStatusDiscriminatorJobType? Type74 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestTeamAccess? Type75 { get; set; } + public global::Descript.ImportProjectMediaRequest? Type75 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaUrlImport? Type76 { get; set; } + public global::Descript.ImportProjectMediaRequestTeamAccess? Type76 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaDirectUpload? Type77 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaUrlImport? Type77 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequence? Type78 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaDirectUpload? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type79 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequence? Type79 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequenceTrack? Type80 { get; set; } + public global::System.Collections.Generic.IList? Type80 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type81 { get; set; } + public global::Descript.ImportProjectMediaRequestAddMediaMultitrackSequenceTrack? Type81 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddComposition? Type82 { get; set; } + public global::System.Collections.Generic.IList? Type82 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type83 { get; set; } + public global::Descript.ImportProjectMediaRequestAddComposition? Type83 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaRequestAddCompositionClip? Type84 { get; set; } + public global::System.Collections.Generic.IList? Type84 { get; set; } /// /// /// - public global::Descript.AgentEditJobRequest? Type85 { get; set; } + public global::Descript.ImportProjectMediaRequestAddCompositionClip? Type85 { get; set; } /// /// /// - public global::Descript.AgentEditJobRequestTeamAccess? Type86 { get; set; } + public global::Descript.AgentEditJobRequest? Type86 { get; set; } /// /// /// - public global::Descript.PublishJobRequest? Type87 { get; set; } + public global::Descript.AgentEditJobRequestTeamAccess? Type87 { get; set; } /// /// /// - public global::Descript.PublishJobRequestMediaType? Type88 { get; set; } + public global::Descript.PublishJobRequest? Type88 { get; set; } /// /// /// - public global::Descript.PublishJobRequestResolution? Type89 { get; set; } + public global::Descript.PublishJobRequestMediaType? Type89 { get; set; } /// /// /// - public global::Descript.PublishJobRequestAccessLevel? Type90 { get; set; } + public global::Descript.PublishJobRequestResolution? Type90 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequest? Type91 { get; set; } + public global::Descript.PublishJobRequestAccessLevel? Type91 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequestFormat? Type92 { get; set; } + public global::Descript.ExportTranscriptRequest? Type92 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? Type93 { get; set; } + public global::Descript.ExportTranscriptRequestFormat? Type93 { get; set; } /// /// /// - public global::Descript.ExportTranscriptRequestTimecodes? Type94 { get; set; } + public global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? Type94 { get; set; } /// /// /// - public global::Descript.ListJobsType? Type95 { get; set; } + public global::Descript.ExportTranscriptRequestTimecodes? Type95 { get; set; } /// /// /// - public global::Descript.ListProjectsSort? Type96 { get; set; } + public global::Descript.ListJobsType? Type96 { get; set; } /// /// /// - public global::Descript.ListProjectsDirection? Type97 { get; set; } + public global::Descript.ListProjectsSort? Type97 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaResponse? Type98 { get; set; } + public global::Descript.ListProjectsDirection? Type98 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type99 { get; set; } + public global::Descript.ImportProjectMediaResponse? Type99 { get; set; } /// /// /// - public global::Descript.ImportProjectMediaResponseUploadUrls2? Type100 { get; set; } + public global::System.Collections.Generic.Dictionary? Type100 { get; set; } /// /// /// - public global::Descript.AgentEditJobResponse? Type101 { get; set; } + public global::Descript.ImportProjectMediaResponseUploadUrls2? Type101 { get; set; } /// /// /// - public global::Descript.PublishJobResponse? Type102 { get; set; } + public global::Descript.AgentEditJobResponse? Type102 { get; set; } /// /// /// - public byte[]? Type103 { get; set; } + public global::Descript.PublishJobResponse? Type103 { get; set; } /// /// /// - public global::Descript.ListJobsResponse? Type104 { get; set; } + public byte[]? Type104 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type105 { get; set; } + public global::Descript.ListJobsResponse? Type105 { get; set; } /// /// /// - public global::Descript.ListJobsResponsePagination? Type106 { get; set; } + public global::System.Collections.Generic.IList? Type106 { get; set; } /// /// /// - public global::Descript.ListProjectsResponse? Type107 { get; set; } + public global::Descript.ListJobsResponsePagination? Type107 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type108 { get; set; } + public global::Descript.ListProjectsResponse? Type108 { get; set; } /// /// /// - public global::Descript.ListProjectsResponseDataItem? Type109 { get; set; } + public global::System.Collections.Generic.IList? Type109 { get; set; } /// /// /// - public global::Descript.ListProjectsResponsePagination? Type110 { get; set; } + public global::Descript.ListProjectsResponseDataItem? Type110 { get; set; } /// /// /// - public global::Descript.GetProjectResponse? Type111 { get; set; } + public global::Descript.ListProjectsResponsePagination? Type111 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type112 { get; set; } + public global::Descript.GetProjectResponse? Type112 { get; set; } /// /// /// - public global::Descript.GetProjectResponseMediaFiles2? Type113 { get; set; } + public global::System.Collections.Generic.Dictionary? Type113 { get; set; } /// /// /// - public global::Descript.GetProjectResponseMediaFilesType? Type114 { get; set; } + public global::Descript.GetProjectResponseMediaFiles2? Type114 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type115 { get; set; } + public global::Descript.GetProjectResponseMediaFilesType? Type115 { get; set; } /// /// /// - public global::Descript.GetProjectResponseComposition? Type116 { get; set; } + public global::System.Collections.Generic.IList? Type116 { get; set; } /// /// /// - public global::Descript.GetStatusResponse? Type117 { get; set; } + public global::Descript.GetProjectResponseComposition? Type117 { get; set; } /// /// /// - public global::Descript.GetStatusResponseStatus? Type118 { get; set; } + public global::Descript.GetStatusResponse? Type118 { get; set; } + /// + /// + /// + public global::Descript.GetStatusResponseStatus? Type119 { get; set; } /// /// diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs index d5f101d..5c9ca32 100644 --- a/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequest.g.cs @@ -26,7 +26,11 @@ public sealed partial class PublishJobRequest public global::System.Guid? CompositionId { get; set; } /// - /// Media type of the published output.
+ /// Media type of the published output. Defaults to `Video` when omitted.
+ /// If the target composition has no video content:
+ /// - omitting `media_type` publishes it as `Audio`
+ /// (the completed job result reports `media_type: Audio`),
+ /// - explicitly requesting `Video` is rejected with a 422.
/// Default Value: Video ///
[global::System.Text.Json.Serialization.JsonPropertyName("media_type")] @@ -77,7 +81,11 @@ public sealed partial class PublishJobRequest /// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// - /// Media type of the published output.
+ /// Media type of the published output. Defaults to `Video` when omitted.
+ /// If the target composition has no video content:
+ /// - omitting `media_type` publishes it as `Audio`
+ /// (the completed job result reports `media_type: Audio`),
+ /// - explicitly requesting `Video` is rejected with a 422.
/// Default Value: Video /// /// diff --git a/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs index 10fb02f..2007367 100644 --- a/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.PublishJobRequestMediaType.g.cs @@ -4,13 +4,17 @@ namespace Descript { /// - /// Media type of the published output.
+ /// Media type of the published output. Defaults to `Video` when omitted.
+ /// If the target composition has no video content:
+ /// - omitting `media_type` publishes it as `Audio`
+ /// (the completed job result reports `media_type: Audio`),
+ /// - explicitly requesting `Video` is rejected with a 422.
/// Default Value: Video ///
public enum PublishJobRequestMediaType { /// - /// + /// Audio`), /// Audio, /// diff --git a/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs index b3b263e..9c3ad2c 100644 --- a/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResult.g.cs @@ -33,6 +33,15 @@ public sealed partial class PublishSuccessResult [global::System.Text.Json.Serialization.JsonRequired] public required string ShareUrl { get; set; } + /// + /// The media type the composition was actually published as. For an audio-only composition published with the default Video request, this is Audio.
+ /// Example: Audio + ///
+ /// Audio + [global::System.Text.Json.Serialization.JsonPropertyName("media_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Descript.JsonConverters.PublishSuccessResultMediaTypeJsonConverter))] + public global::Descript.PublishSuccessResultMediaType? MediaType { get; set; } + /// /// Time-limited signed URL to download the original published media file. Present when the job completed successfully and signing succeeded.
/// Example: https://storage.googleapis.com/bucket/object?X-Goog-Signature=... @@ -67,6 +76,10 @@ public sealed partial class PublishSuccessResult /// /// Indicates successful completion /// + /// + /// The media type the composition was actually published as. For an audio-only composition published with the default Video request, this is Audio.
+ /// Example: Audio + /// /// /// Time-limited signed URL to download the original published media file. Present when the job completed successfully and signing succeeded.
/// Example: https://storage.googleapis.com/bucket/object?X-Goog-Signature=... @@ -81,12 +94,14 @@ public PublishSuccessResult( string compositionId, string shareUrl, global::Descript.PublishSuccessResultStatus status, + global::Descript.PublishSuccessResultMediaType? mediaType, string? downloadUrl, global::System.DateTime? downloadUrlExpiresAt) { this.Status = status; this.CompositionId = compositionId ?? throw new global::System.ArgumentNullException(nameof(compositionId)); this.ShareUrl = shareUrl ?? throw new global::System.ArgumentNullException(nameof(shareUrl)); + this.MediaType = mediaType; this.DownloadUrl = downloadUrl; this.DownloadUrlExpiresAt = downloadUrlExpiresAt; } diff --git a/src/libs/Descript/Generated/Descript.Models.PublishSuccessResultMediaType.g.cs b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResultMediaType.g.cs new file mode 100644 index 0000000..a4646e5 --- /dev/null +++ b/src/libs/Descript/Generated/Descript.Models.PublishSuccessResultMediaType.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Descript +{ + /// + /// The media type the composition was actually published as. For an audio-only composition published with the default Video request, this is Audio.
+ /// Example: Audio + ///
+ public enum PublishSuccessResultMediaType + { + /// + /// + /// + Audio, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PublishSuccessResultMediaTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PublishSuccessResultMediaType value) + { + return value switch + { + PublishSuccessResultMediaType.Audio => "Audio", + PublishSuccessResultMediaType.Video => "Video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PublishSuccessResultMediaType? ToEnum(string value) + { + return value switch + { + "Audio" => PublishSuccessResultMediaType.Audio, + "Video" => PublishSuccessResultMediaType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Descript/openapi.yaml b/src/libs/Descript/openapi.yaml index f7f04df..522b73b 100644 --- a/src/libs/Descript/openapi.yaml +++ b/src/libs/Descript/openapi.yaml @@ -1008,7 +1008,13 @@ paths: - Video - Audio default: Video - description: Media type of the published output. + description: | + Media type of the published output. Defaults to `Video` when omitted. + + If the target composition has no video content: + - omitting `media_type` publishes it as `Audio` + (the completed job result reports `media_type: Audio`), + - explicitly requesting `Video` is rejected with a 422. resolution: type: string enum: @@ -1148,7 +1154,20 @@ paths: message: Forbidden '422': description: | - Unprocessable Entity + 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). + content: + application/json: + schema: + $ref: '#/components/schemas/Error400' + examples: + audio_only_video_request: + summary: Audio-only composition requested as video + value: + error: unprocessable_entity + message: Composition has no video content and cannot be published as video. Retry with media_type "Audio". '429': $ref: '#/components/responses/Error429Response' /export/transcript: @@ -2869,6 +2888,14 @@ components: format: uri description: Public URL to view the published content example: https://share.descript.com/view/abc123 + media_type: + type: string + enum: + - Video + - Audio + description: | + The media type the composition was actually published as. For an audio-only composition published with the default Video request, this is Audio. + example: Audio download_url: type: string format: uri