Skip to content

Commit

Permalink
fix: correct response type for generate subtitles (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Apr 26, 2024
1 parent 18c15b6 commit 5b05c0c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Types:
- <code><a href="./src/resources/video/assets.ts">AssetResponse</a></code>
- <code><a href="./src/resources/video/assets.ts">InputInfo</a></code>
- <code><a href="./src/resources/video/assets.ts">Track</a></code>
- <code><a href="./src/resources/video/assets.ts">AssetGenerateSubtitlesResponse</a></code>
- <code><a href="./src/resources/video/assets.ts">AssetRetrieveInputInfoResponse</a></code>

Methods:
Expand All @@ -29,7 +30,7 @@ Methods:
- <code title="post /video/v1/assets/{ASSET_ID}/tracks">client.video.assets.<a href="./src/resources/video/assets.ts">createTrack</a>(assetId, { ...params }) -> Track</code>
- <code title="delete /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID}">client.video.assets.<a href="./src/resources/video/assets.ts">deletePlaybackId</a>(assetId, playbackId) -> void</code>
- <code title="delete /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}">client.video.assets.<a href="./src/resources/video/assets.ts">deleteTrack</a>(assetId, trackId) -> void</code>
- <code title="post /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles">client.video.assets.<a href="./src/resources/video/assets.ts">generateSubtitles</a>(assetId, trackId, { ...params }) -> Track</code>
- <code title="post /video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}/generate-subtitles">client.video.assets.<a href="./src/resources/video/assets.ts">generateSubtitles</a>(assetId, trackId, { ...params }) -> AssetGenerateSubtitlesResponse</code>
- <code title="get /video/v1/assets/{ASSET_ID}/input-info">client.video.assets.<a href="./src/resources/video/assets.ts">retrieveInputInfo</a>(assetId) -> AssetRetrieveInputInfoResponse</code>
- <code title="get /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID}">client.video.assets.<a href="./src/resources/video/assets.ts">retrievePlaybackId</a>(assetId, playbackId) -> PlaybackID</code>
- <code title="put /video/v1/assets/{ASSET_ID}/master-access">client.video.assets.<a href="./src/resources/video/assets.ts">updateMasterAccess</a>(assetId, { ...params }) -> Asset</code>
Expand Down
7 changes: 5 additions & 2 deletions src/resources/video/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ export class Assets extends APIResource {
trackId: string,
body: AssetGenerateSubtitlesParams,
options?: Core.RequestOptions,
): Core.APIPromise<Track> {
): Core.APIPromise<AssetGenerateSubtitlesResponse> {
return (
this._client.post(`/video/v1/assets/${assetId}/tracks/${trackId}/generate-subtitles`, {
body,
...options,
}) as Core.APIPromise<{ data: Track }>
}) as Core.APIPromise<{ data: AssetGenerateSubtitlesResponse }>
)._thenUnwrap((obj) => obj.data);
}

Expand Down Expand Up @@ -1252,6 +1252,8 @@ export interface Track {
type?: 'video' | 'audio' | 'text';
}

export type AssetGenerateSubtitlesResponse = Array<Track>;

export type AssetRetrieveInputInfoResponse = Array<InputInfo>;

export interface AssetCreateParams {
Expand Down Expand Up @@ -1728,6 +1730,7 @@ export namespace Assets {
export import AssetResponse = AssetsAPI.AssetResponse;
export import InputInfo = AssetsAPI.InputInfo;
export import Track = AssetsAPI.Track;
export import AssetGenerateSubtitlesResponse = AssetsAPI.AssetGenerateSubtitlesResponse;
export import AssetRetrieveInputInfoResponse = AssetsAPI.AssetRetrieveInputInfoResponse;
export import AssetsBasePage = AssetsAPI.AssetsBasePage;
export import AssetCreateParams = AssetsAPI.AssetCreateParams;
Expand Down
1 change: 1 addition & 0 deletions src/resources/video/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export {
AssetResponse,
InputInfo,
Track,
AssetGenerateSubtitlesResponse,
AssetRetrieveInputInfoResponse,
AssetCreateParams,
AssetUpdateParams,
Expand Down
1 change: 1 addition & 0 deletions src/resources/video/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export namespace Video {
export import AssetResponse = AssetsAPI.AssetResponse;
export import InputInfo = AssetsAPI.InputInfo;
export import Track = AssetsAPI.Track;
export import AssetGenerateSubtitlesResponse = AssetsAPI.AssetGenerateSubtitlesResponse;
export import AssetRetrieveInputInfoResponse = AssetsAPI.AssetRetrieveInputInfoResponse;
export import AssetsBasePage = AssetsAPI.AssetsBasePage;
export import AssetCreateParams = AssetsAPI.AssetCreateParams;
Expand Down

0 comments on commit 5b05c0c

Please sign in to comment.