Skip to content

Commit be48f62

Browse files
committed
feat(client): Make t2v waitable
1 parent b306edc commit be48f62

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/resources/text-to-video.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { APIResource } from '../resource';
44
import * as Core from '../core';
5+
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';
56

67
export class TextToVideo extends APIResource {
78
/**
@@ -10,8 +11,10 @@ export class TextToVideo extends APIResource {
1011
create(
1112
body: TextToVideoCreateParams,
1213
options?: Core.RequestOptions,
13-
): Core.APIPromise<TextToVideoCreateResponse> {
14-
return this._client.post('/v1/text_to_video', { body, ...options });
14+
): APIPromiseWithAwaitableTask<TextToVideoCreateResponse> {
15+
return wrapAsWaitableResource<TextToVideoCreateResponse>(this._client)(
16+
this._client.post('/v1/text_to_video', { body, ...options }),
17+
);
1518
}
1619
}
1720

0 commit comments

Comments
 (0)