twilio 3.75.0 → 3.75.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,346 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Page = require('../../../base/Page');
9
+ import Response = require('../../../http/response');
10
+ import V1 = require('../V1');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ type MediaRecordingFormat = 'mp4'|'webm';
14
+
15
+ type MediaRecordingOrder = 'asc'|'desc';
16
+
17
+ type MediaRecordingStatus = 'processing'|'completed'|'deleted'|'failed';
18
+
19
+ /**
20
+ * Initialize the MediaRecordingList
21
+ *
22
+ * PLEASE NOTE that this class contains preview products that are subject to
23
+ * change. Use them with caution. If you currently do not have developer preview
24
+ * access, please contact help@twilio.com.
25
+ *
26
+ * @param version - Version of the resource
27
+ */
28
+ declare function MediaRecordingList(version: V1): MediaRecordingListInstance;
29
+
30
+ interface MediaRecordingListInstance {
31
+ /**
32
+ * @param sid - sid of instance
33
+ */
34
+ (sid: string): MediaRecordingContext;
35
+ /**
36
+ * Streams MediaRecordingInstance records from the API.
37
+ *
38
+ * This operation lazily loads records as efficiently as possible until the limit
39
+ * is reached.
40
+ *
41
+ * The results are passed into the callback function, so this operation is memory
42
+ * efficient.
43
+ *
44
+ * If a function is passed as the first argument, it will be used as the callback
45
+ * function.
46
+ *
47
+ * @param callback - Function to process each record
48
+ */
49
+ each(callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void): void;
50
+ /**
51
+ * Streams MediaRecordingInstance records from the API.
52
+ *
53
+ * This operation lazily loads records as efficiently as possible until the limit
54
+ * is reached.
55
+ *
56
+ * The results are passed into the callback function, so this operation is memory
57
+ * efficient.
58
+ *
59
+ * If a function is passed as the first argument, it will be used as the callback
60
+ * function.
61
+ *
62
+ * @param opts - Options for request
63
+ * @param callback - Function to process each record
64
+ */
65
+ each(opts?: MediaRecordingListInstanceEachOptions, callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void): void;
66
+ /**
67
+ * Constructs a media_recording
68
+ *
69
+ * @param sid - The SID that identifies the resource to fetch
70
+ */
71
+ get(sid: string): MediaRecordingContext;
72
+ /**
73
+ * Retrieve a single target page of MediaRecordingInstance records from the API.
74
+ *
75
+ * The request is executed immediately.
76
+ *
77
+ * If a function is passed as the first argument, it will be used as the callback
78
+ * function.
79
+ *
80
+ * @param callback - Callback to handle list of records
81
+ */
82
+ getPage(callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
83
+ /**
84
+ * Retrieve a single target page of MediaRecordingInstance records from the API.
85
+ *
86
+ * The request is executed immediately.
87
+ *
88
+ * If a function is passed as the first argument, it will be used as the callback
89
+ * function.
90
+ *
91
+ * @param targetUrl - API-generated URL for the requested results page
92
+ * @param callback - Callback to handle list of records
93
+ */
94
+ getPage(targetUrl?: string, callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
95
+ /**
96
+ * Lists MediaRecordingInstance records from the API as a list.
97
+ *
98
+ * If a function is passed as the first argument, it will be used as the callback
99
+ * function.
100
+ *
101
+ * @param callback - Callback to handle list of records
102
+ */
103
+ list(callback?: (error: Error | null, items: MediaRecordingInstance[]) => any): Promise<MediaRecordingInstance[]>;
104
+ /**
105
+ * Lists MediaRecordingInstance records from the API as a list.
106
+ *
107
+ * If a function is passed as the first argument, it will be used as the callback
108
+ * function.
109
+ *
110
+ * @param opts - Options for request
111
+ * @param callback - Callback to handle list of records
112
+ */
113
+ list(opts?: MediaRecordingListInstanceOptions, callback?: (error: Error | null, items: MediaRecordingInstance[]) => any): Promise<MediaRecordingInstance[]>;
114
+ /**
115
+ * Retrieve a single page of MediaRecordingInstance records from the API.
116
+ *
117
+ * The request is executed immediately.
118
+ *
119
+ * If a function is passed as the first argument, it will be used as the callback
120
+ * function.
121
+ *
122
+ * @param callback - Callback to handle list of records
123
+ */
124
+ page(callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
125
+ /**
126
+ * Retrieve a single page of MediaRecordingInstance records from the API.
127
+ *
128
+ * The request is executed immediately.
129
+ *
130
+ * If a function is passed as the first argument, it will be used as the callback
131
+ * function.
132
+ *
133
+ * @param opts - Options for request
134
+ * @param callback - Callback to handle list of records
135
+ */
136
+ page(opts?: MediaRecordingListInstancePageOptions, callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
137
+ /**
138
+ * Provide a user-friendly representation
139
+ */
140
+ toJSON(): any;
141
+ }
142
+
143
+ /**
144
+ * Options to pass to each
145
+ *
146
+ * @property callback -
147
+ * Function to process each record. If this and a positional
148
+ * callback are passed, this one will be used
149
+ * @property done - Function to be called upon completion of streaming
150
+ * @property limit -
151
+ * Upper limit for the number of records to return.
152
+ * each() guarantees never to return more than limit.
153
+ * Default is no limit
154
+ * @property order - The sort order of the list
155
+ * @property pageSize -
156
+ * Number of records to fetch per request,
157
+ * when not set will use the default value of 50 records.
158
+ * If no pageSize is defined but a limit is defined,
159
+ * each() will attempt to read the limit with the most efficient
160
+ * page size, i.e. min(limit, 1000)
161
+ * @property status - Status to filter by
162
+ */
163
+ interface MediaRecordingListInstanceEachOptions {
164
+ callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void;
165
+ done?: Function;
166
+ limit?: number;
167
+ order?: MediaRecordingOrder;
168
+ pageSize?: number;
169
+ status?: MediaRecordingStatus;
170
+ }
171
+
172
+ /**
173
+ * Options to pass to list
174
+ *
175
+ * @property limit -
176
+ * Upper limit for the number of records to return.
177
+ * list() guarantees never to return more than limit.
178
+ * Default is no limit
179
+ * @property order - The sort order of the list
180
+ * @property pageSize -
181
+ * Number of records to fetch per request,
182
+ * when not set will use the default value of 50 records.
183
+ * If no page_size is defined but a limit is defined,
184
+ * list() will attempt to read the limit with the most
185
+ * efficient page size, i.e. min(limit, 1000)
186
+ * @property status - Status to filter by
187
+ */
188
+ interface MediaRecordingListInstanceOptions {
189
+ limit?: number;
190
+ order?: MediaRecordingOrder;
191
+ pageSize?: number;
192
+ status?: MediaRecordingStatus;
193
+ }
194
+
195
+ /**
196
+ * Options to pass to page
197
+ *
198
+ * @property order - The sort order of the list
199
+ * @property pageNumber - Page Number, this value is simply for client state
200
+ * @property pageSize - Number of records to return, defaults to 50
201
+ * @property pageToken - PageToken provided by the API
202
+ * @property status - Status to filter by
203
+ */
204
+ interface MediaRecordingListInstancePageOptions {
205
+ order?: MediaRecordingOrder;
206
+ pageNumber?: number;
207
+ pageSize?: number;
208
+ pageToken?: string;
209
+ status?: MediaRecordingStatus;
210
+ }
211
+
212
+ interface MediaRecordingPayload extends MediaRecordingResource, Page.TwilioResponsePayload {
213
+ }
214
+
215
+ interface MediaRecordingResource {
216
+ account_sid: string;
217
+ bitrate: number;
218
+ date_created: Date;
219
+ date_updated: Date;
220
+ duration: number;
221
+ format: MediaRecordingFormat;
222
+ links: string;
223
+ processor_sid: string;
224
+ resolution: string;
225
+ sid: string;
226
+ size: number;
227
+ source_sid: string;
228
+ status: MediaRecordingStatus;
229
+ status_callback: string;
230
+ status_callback_method: string;
231
+ url: string;
232
+ }
233
+
234
+ interface MediaRecordingSolution {
235
+ }
236
+
237
+
238
+ declare class MediaRecordingContext {
239
+ /**
240
+ * Initialize the MediaRecordingContext
241
+ *
242
+ * PLEASE NOTE that this class contains preview products that are subject to
243
+ * change. Use them with caution. If you currently do not have developer preview
244
+ * access, please contact help@twilio.com.
245
+ *
246
+ * @param version - Version of the resource
247
+ * @param sid - The SID that identifies the resource to fetch
248
+ */
249
+ constructor(version: V1, sid: string);
250
+
251
+ /**
252
+ * fetch a MediaRecordingInstance
253
+ *
254
+ * @param callback - Callback to handle processed record
255
+ */
256
+ fetch(callback?: (error: Error | null, items: MediaRecordingInstance) => any): Promise<MediaRecordingInstance>;
257
+ /**
258
+ * remove a MediaRecordingInstance
259
+ *
260
+ * @param callback - Callback to handle processed record
261
+ */
262
+ remove(callback?: (error: Error | null, items: MediaRecordingInstance) => any): Promise<boolean>;
263
+ /**
264
+ * Provide a user-friendly representation
265
+ */
266
+ toJSON(): any;
267
+ }
268
+
269
+
270
+ declare class MediaRecordingInstance extends SerializableClass {
271
+ /**
272
+ * Initialize the MediaRecordingContext
273
+ *
274
+ * PLEASE NOTE that this class contains preview products that are subject to
275
+ * change. Use them with caution. If you currently do not have developer preview
276
+ * access, please contact help@twilio.com.
277
+ *
278
+ * @param version - Version of the resource
279
+ * @param payload - The instance payload
280
+ * @param sid - The SID that identifies the resource to fetch
281
+ */
282
+ constructor(version: V1, payload: MediaRecordingPayload, sid: string);
283
+
284
+ private _proxy: MediaRecordingContext;
285
+ accountSid: string;
286
+ bitrate: number;
287
+ dateCreated: Date;
288
+ dateUpdated: Date;
289
+ duration: number;
290
+ /**
291
+ * fetch a MediaRecordingInstance
292
+ *
293
+ * @param callback - Callback to handle processed record
294
+ */
295
+ fetch(callback?: (error: Error | null, items: MediaRecordingInstance) => any): Promise<MediaRecordingInstance>;
296
+ format: MediaRecordingFormat;
297
+ links: string;
298
+ processorSid: string;
299
+ /**
300
+ * remove a MediaRecordingInstance
301
+ *
302
+ * @param callback - Callback to handle processed record
303
+ */
304
+ remove(callback?: (error: Error | null, items: MediaRecordingInstance) => any): Promise<boolean>;
305
+ resolution: string;
306
+ sid: string;
307
+ size: number;
308
+ sourceSid: string;
309
+ status: MediaRecordingStatus;
310
+ statusCallback: string;
311
+ statusCallbackMethod: string;
312
+ /**
313
+ * Provide a user-friendly representation
314
+ */
315
+ toJSON(): any;
316
+ url: string;
317
+ }
318
+
319
+
320
+ declare class MediaRecordingPage extends Page<V1, MediaRecordingPayload, MediaRecordingResource, MediaRecordingInstance> {
321
+ /**
322
+ * Initialize the MediaRecordingPage
323
+ *
324
+ * PLEASE NOTE that this class contains preview products that are subject to
325
+ * change. Use them with caution. If you currently do not have developer preview
326
+ * access, please contact help@twilio.com.
327
+ *
328
+ * @param version - Version of the resource
329
+ * @param response - Response from the API
330
+ * @param solution - Path solution
331
+ */
332
+ constructor(version: V1, response: Response<string>, solution: MediaRecordingSolution);
333
+
334
+ /**
335
+ * Build an instance of MediaRecordingInstance
336
+ *
337
+ * @param payload - Payload response from the API
338
+ */
339
+ getInstance(payload: MediaRecordingPayload): MediaRecordingInstance;
340
+ /**
341
+ * Provide a user-friendly representation
342
+ */
343
+ toJSON(): any;
344
+ }
345
+
346
+ export { MediaRecordingContext, MediaRecordingFormat, MediaRecordingInstance, MediaRecordingList, MediaRecordingListInstance, MediaRecordingListInstanceEachOptions, MediaRecordingListInstanceOptions, MediaRecordingListInstancePageOptions, MediaRecordingOrder, MediaRecordingPage, MediaRecordingPayload, MediaRecordingResource, MediaRecordingSolution, MediaRecordingStatus }