@@ -4,59 +4,6 @@ import { APIResource } from '../../resource';
44import * as Core from '../../core' ;
55
66export class Downloads extends APIResource {
7- /**
8- * Creates a download for a video when a video is ready to view.
9- *
10- * @example
11- * ```ts
12- * const download = await client.stream.downloads.create(
13- * 'ea95132c15732412d22c1476fa83f27a',
14- * {
15- * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
16- * body: {},
17- * },
18- * );
19- * ```
20- */
21- create (
22- identifier : string ,
23- params : DownloadCreateParams ,
24- options ?: Core . RequestOptions ,
25- ) : Core . APIPromise < DownloadCreateResponse > {
26- const { account_id, body } = params ;
27- return (
28- this . _client . post ( `/accounts/${ account_id } /stream/${ identifier } /downloads` , {
29- body : body ,
30- ...options ,
31- } ) as Core . APIPromise < { result : DownloadCreateResponse } >
32- ) . _thenUnwrap ( ( obj ) => obj . result ) ;
33- }
34-
35- /**
36- * Delete the downloads for a video.
37- *
38- * @example
39- * ```ts
40- * const download = await client.stream.downloads.delete(
41- * 'ea95132c15732412d22c1476fa83f27a',
42- * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
43- * );
44- * ```
45- */
46- delete (
47- identifier : string ,
48- params : DownloadDeleteParams ,
49- options ?: Core . RequestOptions ,
50- ) : Core . APIPromise < DownloadDeleteResponse > {
51- const { account_id } = params ;
52- return (
53- this . _client . delete (
54- `/accounts/${ account_id } /stream/${ identifier } /downloads` ,
55- options ,
56- ) as Core . APIPromise < { result : DownloadDeleteResponse } >
57- ) . _thenUnwrap ( ( obj ) => obj . result ) ;
58- }
59-
607 /**
618 * Lists the downloads created for a video.
629 *
@@ -82,31 +29,8 @@ export class Downloads extends APIResource {
8229 }
8330}
8431
85- export type DownloadCreateResponse = unknown ;
86-
87- export type DownloadDeleteResponse = string ;
88-
8932export type DownloadGetResponse = unknown ;
9033
91- export interface DownloadCreateParams {
92- /**
93- * Path param: Identifier.
94- */
95- account_id : string ;
96-
97- /**
98- * Body param:
99- */
100- body : unknown ;
101- }
102-
103- export interface DownloadDeleteParams {
104- /**
105- * Identifier.
106- */
107- account_id : string ;
108- }
109-
11034export interface DownloadGetParams {
11135 /**
11236 * Identifier.
@@ -115,12 +39,5 @@ export interface DownloadGetParams {
11539}
11640
11741export declare namespace Downloads {
118- export {
119- type DownloadCreateResponse as DownloadCreateResponse ,
120- type DownloadDeleteResponse as DownloadDeleteResponse ,
121- type DownloadGetResponse as DownloadGetResponse ,
122- type DownloadCreateParams as DownloadCreateParams ,
123- type DownloadDeleteParams as DownloadDeleteParams ,
124- type DownloadGetParams as DownloadGetParams ,
125- } ;
42+ export { type DownloadGetResponse as DownloadGetResponse , type DownloadGetParams as DownloadGetParams } ;
12643}
0 commit comments