twilio 3.68.0 → 3.71.2

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.
Files changed (85) hide show
  1. package/CHANGES.md +104 -0
  2. package/README.md +1 -1
  3. package/lib/jwt/AccessToken.d.ts +16 -0
  4. package/lib/jwt/AccessToken.js +20 -0
  5. package/lib/jwt/ClientCapability.d.ts +1 -1
  6. package/lib/rest/Media.d.ts +28 -0
  7. package/lib/rest/Media.js +64 -0
  8. package/lib/rest/Twilio.d.ts +2 -0
  9. package/lib/rest/Twilio.js +14 -0
  10. package/lib/rest/Verify.d.ts +2 -2
  11. package/lib/rest/Verify.js +3 -4
  12. package/lib/rest/api/v2010/account/call/siprec.d.ts +776 -0
  13. package/lib/rest/api/v2010/account/call/siprec.js +811 -0
  14. package/lib/rest/api/v2010/account/call.d.ts +8 -1
  15. package/lib/rest/api/v2010/account/call.js +29 -1
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -2
  17. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +5 -2
  18. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -2
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +5 -2
  20. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -2
  21. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +5 -2
  22. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +7 -3
  23. package/lib/rest/api/v2010/account/incomingPhoneNumber.js +7 -4
  24. package/lib/rest/conversations/v1/service/configuration/notification.d.ts +6 -0
  25. package/lib/rest/conversations/v1/service/configuration/notification.js +11 -1
  26. package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
  27. package/lib/rest/flexApi/v1/configuration.js +2 -0
  28. package/lib/rest/frontlineApi/v1/user.d.ts +4 -0
  29. package/lib/rest/frontlineApi/v1/user.js +10 -1
  30. package/lib/rest/insights/v1/callSummaries.d.ts +27 -27
  31. package/lib/rest/insights/v1/callSummaries.js +36 -36
  32. package/lib/rest/media/V1.d.ts +28 -0
  33. package/lib/rest/media/V1.js +59 -0
  34. package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
  35. package/lib/rest/media/v1/mediaProcessor.js +702 -0
  36. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
  37. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
  38. package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
  39. package/lib/rest/media/v1/playerStreamer.js +729 -0
  40. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +330 -0
  41. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +655 -0
  42. package/lib/rest/messaging/v1/brandRegistration.d.ts +15 -2
  43. package/lib/rest/messaging/v1/brandRegistration.js +37 -1
  44. package/lib/rest/messaging/v1/service.d.ts +8 -0
  45. package/lib/rest/messaging/v1/service.js +14 -0
  46. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +133 -0
  47. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +268 -0
  48. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +127 -0
  49. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +271 -0
  50. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +14 -0
  51. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +56 -0
  52. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  53. package/lib/rest/serverless/v1/service/environment.js +1 -1
  54. package/lib/rest/serverless/v1/service.d.ts +2 -0
  55. package/lib/rest/serverless/v1/service.js +3 -0
  56. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
  57. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
  58. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
  59. package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
  60. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
  61. package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
  62. package/lib/rest/trunking/v1/trunk.d.ts +9 -1
  63. package/lib/rest/trunking/v1/trunk.js +13 -2
  64. package/lib/rest/verify/V2.d.ts +3 -3
  65. package/lib/rest/verify/V2.js +6 -8
  66. package/lib/rest/verify/v2/service/entity/factor.d.ts +4 -2
  67. package/lib/rest/verify/v2/service/entity/factor.js +8 -3
  68. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +2 -2
  69. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  70. package/lib/rest/verify/v2/service/verification.d.ts +5 -1
  71. package/lib/rest/verify/v2/service/verification.js +7 -2
  72. package/lib/rest/verify/v2/service.d.ts +6 -0
  73. package/lib/rest/verify/v2/service.js +12 -2
  74. package/lib/rest/verify/v2/{verificationTemplate.d.ts → template.d.ts} +35 -37
  75. package/lib/rest/verify/v2/{verificationTemplate.js → template.js} +58 -64
  76. package/lib/rest/verify/v2/verificationAttempt.d.ts +1 -1
  77. package/lib/rest/video/v1/room.d.ts +4 -0
  78. package/lib/rest/video/v1/room.js +7 -1
  79. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  80. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  81. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  82. package/lib/rest/wireless/v1/sim.js +18 -24
  83. package/lib/twiml/VoiceResponse.d.ts +1296 -24
  84. package/lib/twiml/VoiceResponse.js +2170 -82
  85. package/package.json +2 -2
@@ -171,15 +171,15 @@ interface CallSummariesListInstance {
171
171
  interface CallSummariesListInstanceEachOptions {
172
172
  abnormalSession?: boolean;
173
173
  branded?: boolean;
174
- callState?: CallSummariesCallState | CallSummariesCallState[];
175
- callType?: CallSummariesCallType | CallSummariesCallType[];
174
+ callState?: string;
175
+ callType?: string;
176
176
  callback?: (item: CallSummariesInstance, done: (err?: Error) => void) => void;
177
- direction?: CallSummariesCallDirection | CallSummariesCallDirection[];
177
+ direction?: string;
178
178
  done?: Function;
179
179
  endTime?: string;
180
- from?: string | string[];
181
- fromCarrier?: string | string[];
182
- fromCountryCode?: string | string[];
180
+ from?: string;
181
+ fromCarrier?: string;
182
+ fromCountryCode?: string;
183
183
  hasTag?: boolean;
184
184
  limit?: number;
185
185
  pageSize?: number;
@@ -187,9 +187,9 @@ interface CallSummariesListInstanceEachOptions {
187
187
  sortBy?: CallSummariesSortBy;
188
188
  startTime?: string;
189
189
  subaccount?: string;
190
- to?: string | string[];
191
- toCarrier?: string | string[];
192
- toCountryCode?: string | string[];
190
+ to?: string;
191
+ toCarrier?: string;
192
+ toCountryCode?: string;
193
193
  verifiedCaller?: boolean;
194
194
  }
195
195
 
@@ -228,13 +228,13 @@ interface CallSummariesListInstanceEachOptions {
228
228
  interface CallSummariesListInstanceOptions {
229
229
  abnormalSession?: boolean;
230
230
  branded?: boolean;
231
- callState?: CallSummariesCallState | CallSummariesCallState[];
232
- callType?: CallSummariesCallType | CallSummariesCallType[];
233
- direction?: CallSummariesCallDirection | CallSummariesCallDirection[];
231
+ callState?: string;
232
+ callType?: string;
233
+ direction?: string;
234
234
  endTime?: string;
235
- from?: string | string[];
236
- fromCarrier?: string | string[];
237
- fromCountryCode?: string | string[];
235
+ from?: string;
236
+ fromCarrier?: string;
237
+ fromCountryCode?: string;
238
238
  hasTag?: boolean;
239
239
  limit?: number;
240
240
  pageSize?: number;
@@ -242,9 +242,9 @@ interface CallSummariesListInstanceOptions {
242
242
  sortBy?: CallSummariesSortBy;
243
243
  startTime?: string;
244
244
  subaccount?: string;
245
- to?: string | string[];
246
- toCarrier?: string | string[];
247
- toCountryCode?: string | string[];
245
+ to?: string;
246
+ toCarrier?: string;
247
+ toCountryCode?: string;
248
248
  verifiedCaller?: boolean;
249
249
  }
250
250
 
@@ -276,13 +276,13 @@ interface CallSummariesListInstanceOptions {
276
276
  interface CallSummariesListInstancePageOptions {
277
277
  abnormalSession?: boolean;
278
278
  branded?: boolean;
279
- callState?: CallSummariesCallState | CallSummariesCallState[];
280
- callType?: CallSummariesCallType | CallSummariesCallType[];
281
- direction?: CallSummariesCallDirection | CallSummariesCallDirection[];
279
+ callState?: string;
280
+ callType?: string;
281
+ direction?: string;
282
282
  endTime?: string;
283
- from?: string | string[];
284
- fromCarrier?: string | string[];
285
- fromCountryCode?: string | string[];
283
+ from?: string;
284
+ fromCarrier?: string;
285
+ fromCountryCode?: string;
286
286
  hasTag?: boolean;
287
287
  pageNumber?: number;
288
288
  pageSize?: number;
@@ -291,9 +291,9 @@ interface CallSummariesListInstancePageOptions {
291
291
  sortBy?: CallSummariesSortBy;
292
292
  startTime?: string;
293
293
  subaccount?: string;
294
- to?: string | string[];
295
- toCarrier?: string | string[];
296
- toCountryCode?: string | string[];
294
+ to?: string;
295
+ toCarrier?: string;
296
+ toCountryCode?: string;
297
297
  verifiedCaller?: boolean;
298
298
  }
299
299
 
@@ -67,20 +67,20 @@ CallSummariesList = function CallSummariesList(version) {
67
67
  * @memberof Twilio.Insights.V1.CallSummariesList#
68
68
  *
69
69
  * @param {object} [opts] - Options for request
70
- * @param {string|list} [opts.from] - The from
71
- * @param {string|list} [opts.to] - The to
72
- * @param {string|list} [opts.fromCarrier] - The from_carrier
73
- * @param {string|list} [opts.toCarrier] - The to_carrier
74
- * @param {string|list} [opts.fromCountryCode] - The from_country_code
75
- * @param {string|list} [opts.toCountryCode] - The to_country_code
70
+ * @param {string} [opts.from] - The from
71
+ * @param {string} [opts.to] - The to
72
+ * @param {string} [opts.fromCarrier] - The from_carrier
73
+ * @param {string} [opts.toCarrier] - The to_carrier
74
+ * @param {string} [opts.fromCountryCode] - The from_country_code
75
+ * @param {string} [opts.toCountryCode] - The to_country_code
76
76
  * @param {boolean} [opts.branded] - The branded
77
77
  * @param {boolean} [opts.verifiedCaller] - The verified_caller
78
78
  * @param {boolean} [opts.hasTag] - The has_tag
79
79
  * @param {string} [opts.startTime] - The start_time
80
80
  * @param {string} [opts.endTime] - The end_time
81
- * @param {call_summaries.call_type|list} [opts.callType] - The call_type
82
- * @param {call_summaries.call_state|list} [opts.callState] - The call_state
83
- * @param {call_summaries.call_direction|list} [opts.direction] - The direction
81
+ * @param {string} [opts.callType] - The call_type
82
+ * @param {string} [opts.callState] - The call_state
83
+ * @param {string} [opts.direction] - The direction
84
84
  * @param {call_summaries.processing_state_request} [opts.processingState] -
85
85
  * The processing_state
86
86
  * @param {call_summaries.sort_by} [opts.sortBy] - The sort_by
@@ -173,20 +173,20 @@ CallSummariesList = function CallSummariesList(version) {
173
173
  * @memberof Twilio.Insights.V1.CallSummariesList#
174
174
  *
175
175
  * @param {object} [opts] - Options for request
176
- * @param {string|list} [opts.from] - The from
177
- * @param {string|list} [opts.to] - The to
178
- * @param {string|list} [opts.fromCarrier] - The from_carrier
179
- * @param {string|list} [opts.toCarrier] - The to_carrier
180
- * @param {string|list} [opts.fromCountryCode] - The from_country_code
181
- * @param {string|list} [opts.toCountryCode] - The to_country_code
176
+ * @param {string} [opts.from] - The from
177
+ * @param {string} [opts.to] - The to
178
+ * @param {string} [opts.fromCarrier] - The from_carrier
179
+ * @param {string} [opts.toCarrier] - The to_carrier
180
+ * @param {string} [opts.fromCountryCode] - The from_country_code
181
+ * @param {string} [opts.toCountryCode] - The to_country_code
182
182
  * @param {boolean} [opts.branded] - The branded
183
183
  * @param {boolean} [opts.verifiedCaller] - The verified_caller
184
184
  * @param {boolean} [opts.hasTag] - The has_tag
185
185
  * @param {string} [opts.startTime] - The start_time
186
186
  * @param {string} [opts.endTime] - The end_time
187
- * @param {call_summaries.call_type|list} [opts.callType] - The call_type
188
- * @param {call_summaries.call_state|list} [opts.callState] - The call_state
189
- * @param {call_summaries.call_direction|list} [opts.direction] - The direction
187
+ * @param {string} [opts.callType] - The call_type
188
+ * @param {string} [opts.callState] - The call_state
189
+ * @param {string} [opts.direction] - The direction
190
190
  * @param {call_summaries.processing_state_request} [opts.processingState] -
191
191
  * The processing_state
192
192
  * @param {call_summaries.sort_by} [opts.sortBy] - The sort_by
@@ -252,20 +252,20 @@ CallSummariesList = function CallSummariesList(version) {
252
252
  * @memberof Twilio.Insights.V1.CallSummariesList#
253
253
  *
254
254
  * @param {object} [opts] - Options for request
255
- * @param {string|list} [opts.from] - The from
256
- * @param {string|list} [opts.to] - The to
257
- * @param {string|list} [opts.fromCarrier] - The from_carrier
258
- * @param {string|list} [opts.toCarrier] - The to_carrier
259
- * @param {string|list} [opts.fromCountryCode] - The from_country_code
260
- * @param {string|list} [opts.toCountryCode] - The to_country_code
255
+ * @param {string} [opts.from] - The from
256
+ * @param {string} [opts.to] - The to
257
+ * @param {string} [opts.fromCarrier] - The from_carrier
258
+ * @param {string} [opts.toCarrier] - The to_carrier
259
+ * @param {string} [opts.fromCountryCode] - The from_country_code
260
+ * @param {string} [opts.toCountryCode] - The to_country_code
261
261
  * @param {boolean} [opts.branded] - The branded
262
262
  * @param {boolean} [opts.verifiedCaller] - The verified_caller
263
263
  * @param {boolean} [opts.hasTag] - The has_tag
264
264
  * @param {string} [opts.startTime] - The start_time
265
265
  * @param {string} [opts.endTime] - The end_time
266
- * @param {call_summaries.call_type|list} [opts.callType] - The call_type
267
- * @param {call_summaries.call_state|list} [opts.callState] - The call_state
268
- * @param {call_summaries.call_direction|list} [opts.direction] - The direction
266
+ * @param {string} [opts.callType] - The call_type
267
+ * @param {string} [opts.callState] - The call_state
268
+ * @param {string} [opts.direction] - The direction
269
269
  * @param {call_summaries.processing_state_request} [opts.processingState] -
270
270
  * The processing_state
271
271
  * @param {call_summaries.sort_by} [opts.sortBy] - The sort_by
@@ -289,20 +289,20 @@ CallSummariesList = function CallSummariesList(version) {
289
289
 
290
290
  var deferred = Q.defer();
291
291
  var data = values.of({
292
- 'From': serialize.map(_.get(opts, 'from'), function(e) { return e; }),
293
- 'To': serialize.map(_.get(opts, 'to'), function(e) { return e; }),
294
- 'FromCarrier': serialize.map(_.get(opts, 'fromCarrier'), function(e) { return e; }),
295
- 'ToCarrier': serialize.map(_.get(opts, 'toCarrier'), function(e) { return e; }),
296
- 'FromCountryCode': serialize.map(_.get(opts, 'fromCountryCode'), function(e) { return e; }),
297
- 'ToCountryCode': serialize.map(_.get(opts, 'toCountryCode'), function(e) { return e; }),
292
+ 'From': _.get(opts, 'from'),
293
+ 'To': _.get(opts, 'to'),
294
+ 'FromCarrier': _.get(opts, 'fromCarrier'),
295
+ 'ToCarrier': _.get(opts, 'toCarrier'),
296
+ 'FromCountryCode': _.get(opts, 'fromCountryCode'),
297
+ 'ToCountryCode': _.get(opts, 'toCountryCode'),
298
298
  'Branded': serialize.bool(_.get(opts, 'branded')),
299
299
  'VerifiedCaller': serialize.bool(_.get(opts, 'verifiedCaller')),
300
300
  'HasTag': serialize.bool(_.get(opts, 'hasTag')),
301
301
  'StartTime': _.get(opts, 'startTime'),
302
302
  'EndTime': _.get(opts, 'endTime'),
303
- 'CallType': serialize.map(_.get(opts, 'callType'), function(e) { return e; }),
304
- 'CallState': serialize.map(_.get(opts, 'callState'), function(e) { return e; }),
305
- 'Direction': serialize.map(_.get(opts, 'direction'), function(e) { return e; }),
303
+ 'CallType': _.get(opts, 'callType'),
304
+ 'CallState': _.get(opts, 'callState'),
305
+ 'Direction': _.get(opts, 'direction'),
306
306
  'ProcessingState': _.get(opts, 'processingState'),
307
307
  'SortBy': _.get(opts, 'sortBy'),
308
308
  'Subaccount': _.get(opts, 'subaccount'),
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Media = require('../Media');
9
+ import Version = require('../../base/Version');
10
+ import { MediaProcessorList } from './v1/mediaProcessor';
11
+ import { MediaProcessorListInstance } from './v1/mediaProcessor';
12
+ import { PlayerStreamerList } from './v1/playerStreamer';
13
+ import { PlayerStreamerListInstance } from './v1/playerStreamer';
14
+
15
+
16
+ declare class V1 extends Version {
17
+ /**
18
+ * Initialize the V1 version of Media
19
+ *
20
+ * @param domain - The twilio domain
21
+ */
22
+ constructor(domain: Media);
23
+
24
+ readonly mediaProcessor: MediaProcessorListInstance;
25
+ readonly playerStreamer: PlayerStreamerListInstance;
26
+ }
27
+
28
+ export = V1;
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ /* jshint ignore:start */
4
+ /**
5
+ * This code was generated by
6
+ * \ / _ _ _| _ _
7
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
8
+ * / /
9
+ */
10
+ /* jshint ignore:end */
11
+
12
+ var _ = require('lodash'); /* jshint ignore:line */
13
+ var MediaProcessorList = require('./v1/mediaProcessor').MediaProcessorList;
14
+ var PlayerStreamerList = require('./v1/playerStreamer').PlayerStreamerList;
15
+ var Version = require('../../base/Version'); /* jshint ignore:line */
16
+
17
+
18
+ /* jshint ignore:start */
19
+ /**
20
+ * Initialize the V1 version of Media
21
+ *
22
+ * @constructor Twilio.Media.V1
23
+ *
24
+ * @property {Twilio.Media.V1.MediaProcessorList} mediaProcessor -
25
+ * mediaProcessor resource
26
+ * @property {Twilio.Media.V1.PlayerStreamerList} playerStreamer -
27
+ * playerStreamer resource
28
+ *
29
+ * @param {Twilio.Media} domain - The twilio domain
30
+ */
31
+ /* jshint ignore:end */
32
+ function V1(domain) {
33
+ Version.prototype.constructor.call(this, domain, 'v1');
34
+
35
+ // Resources
36
+ this._mediaProcessor = undefined;
37
+ this._playerStreamer = undefined;
38
+ }
39
+
40
+ _.extend(V1.prototype, Version.prototype);
41
+ V1.prototype.constructor = V1;
42
+
43
+ Object.defineProperty(V1.prototype,
44
+ 'mediaProcessor', {
45
+ get: function() {
46
+ this._mediaProcessor = this._mediaProcessor || new MediaProcessorList(this);
47
+ return this._mediaProcessor;
48
+ }
49
+ });
50
+
51
+ Object.defineProperty(V1.prototype,
52
+ 'playerStreamer', {
53
+ get: function() {
54
+ this._playerStreamer = this._playerStreamer || new PlayerStreamerList(this);
55
+ return this._playerStreamer;
56
+ }
57
+ });
58
+
59
+ module.exports = V1;
@@ -0,0 +1,355 @@
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 MediaProcessorOrder = 'asc'|'desc';
14
+
15
+ type MediaProcessorStatus = 'failed'|'started'|'ended';
16
+
17
+ type MediaProcessorUpdateStatus = 'ended';
18
+
19
+ /**
20
+ * Initialize the MediaProcessorList
21
+ *
22
+ * @param version - Version of the resource
23
+ */
24
+ declare function MediaProcessorList(version: V1): MediaProcessorListInstance;
25
+
26
+ /**
27
+ * Options to pass to update
28
+ *
29
+ * @property status - The status of the MediaProcessor
30
+ */
31
+ interface MediaProcessorInstanceUpdateOptions {
32
+ status: MediaProcessorUpdateStatus;
33
+ }
34
+
35
+ interface MediaProcessorListInstance {
36
+ /**
37
+ * @param sid - sid of instance
38
+ */
39
+ (sid: string): MediaProcessorContext;
40
+ /**
41
+ * create a MediaProcessorInstance
42
+ *
43
+ * @param opts - Options for request
44
+ * @param callback - Callback to handle processed record
45
+ */
46
+ create(opts: MediaProcessorListInstanceCreateOptions, callback?: (error: Error | null, item: MediaProcessorInstance) => any): Promise<MediaProcessorInstance>;
47
+ /**
48
+ * Streams MediaProcessorInstance records from the API.
49
+ *
50
+ * This operation lazily loads records as efficiently as possible until the limit
51
+ * is reached.
52
+ *
53
+ * The results are passed into the callback function, so this operation is memory
54
+ * efficient.
55
+ *
56
+ * If a function is passed as the first argument, it will be used as the callback
57
+ * function.
58
+ *
59
+ * @param callback - Function to process each record
60
+ */
61
+ each(callback?: (item: MediaProcessorInstance, done: (err?: Error) => void) => void): void;
62
+ /**
63
+ * Streams MediaProcessorInstance records from the API.
64
+ *
65
+ * This operation lazily loads records as efficiently as possible until the limit
66
+ * is reached.
67
+ *
68
+ * The results are passed into the callback function, so this operation is memory
69
+ * efficient.
70
+ *
71
+ * If a function is passed as the first argument, it will be used as the callback
72
+ * function.
73
+ *
74
+ * @param opts - Options for request
75
+ * @param callback - Function to process each record
76
+ */
77
+ each(opts?: MediaProcessorListInstanceEachOptions, callback?: (item: MediaProcessorInstance, done: (err?: Error) => void) => void): void;
78
+ /**
79
+ * Constructs a media_processor
80
+ *
81
+ * @param sid - The SID that identifies the resource to fetch
82
+ */
83
+ get(sid: string): MediaProcessorContext;
84
+ /**
85
+ * Retrieve a single target page of MediaProcessorInstance records from the API.
86
+ *
87
+ * The request is executed immediately.
88
+ *
89
+ * If a function is passed as the first argument, it will be used as the callback
90
+ * function.
91
+ *
92
+ * @param callback - Callback to handle list of records
93
+ */
94
+ getPage(callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise<MediaProcessorPage>;
95
+ /**
96
+ * Retrieve a single target page of MediaProcessorInstance records from the API.
97
+ *
98
+ * The request is executed immediately.
99
+ *
100
+ * If a function is passed as the first argument, it will be used as the callback
101
+ * function.
102
+ *
103
+ * @param targetUrl - API-generated URL for the requested results page
104
+ * @param callback - Callback to handle list of records
105
+ */
106
+ getPage(targetUrl?: string, callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise<MediaProcessorPage>;
107
+ /**
108
+ * Lists MediaProcessorInstance records from the API as a list.
109
+ *
110
+ * If a function is passed as the first argument, it will be used as the callback
111
+ * function.
112
+ *
113
+ * @param callback - Callback to handle list of records
114
+ */
115
+ list(callback?: (error: Error | null, items: MediaProcessorInstance[]) => any): Promise<MediaProcessorInstance[]>;
116
+ /**
117
+ * Lists MediaProcessorInstance records from the API as a list.
118
+ *
119
+ * If a function is passed as the first argument, it will be used as the callback
120
+ * function.
121
+ *
122
+ * @param opts - Options for request
123
+ * @param callback - Callback to handle list of records
124
+ */
125
+ list(opts?: MediaProcessorListInstanceOptions, callback?: (error: Error | null, items: MediaProcessorInstance[]) => any): Promise<MediaProcessorInstance[]>;
126
+ /**
127
+ * Retrieve a single page of MediaProcessorInstance records from the API.
128
+ *
129
+ * The request is executed immediately.
130
+ *
131
+ * If a function is passed as the first argument, it will be used as the callback
132
+ * function.
133
+ *
134
+ * @param callback - Callback to handle list of records
135
+ */
136
+ page(callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise<MediaProcessorPage>;
137
+ /**
138
+ * Retrieve a single page of MediaProcessorInstance records from the API.
139
+ *
140
+ * The request is executed immediately.
141
+ *
142
+ * If a function is passed as the first argument, it will be used as the callback
143
+ * function.
144
+ *
145
+ * @param opts - Options for request
146
+ * @param callback - Callback to handle list of records
147
+ */
148
+ page(opts?: MediaProcessorListInstancePageOptions, callback?: (error: Error | null, items: MediaProcessorPage) => any): Promise<MediaProcessorPage>;
149
+ /**
150
+ * Provide a user-friendly representation
151
+ */
152
+ toJSON(): any;
153
+ }
154
+
155
+ /**
156
+ * Options to pass to create
157
+ *
158
+ * @property extension - The Media Extension name or URL
159
+ * @property extensionContext - The Media Extension context
160
+ * @property extensionEnvironment - The Media Extension environment
161
+ * @property statusCallback - The URL to send MediaProcessor event updates to your application
162
+ * @property statusCallbackMethod - The HTTP method Twilio should use to call the `status_callback` URL
163
+ */
164
+ interface MediaProcessorListInstanceCreateOptions {
165
+ extension: string;
166
+ extensionContext: string;
167
+ extensionEnvironment?: object;
168
+ statusCallback?: string;
169
+ statusCallbackMethod?: string;
170
+ }
171
+
172
+ /**
173
+ * Options to pass to each
174
+ *
175
+ * @property callback -
176
+ * Function to process each record. If this and a positional
177
+ * callback are passed, this one will be used
178
+ * @property done - Function to be called upon completion of streaming
179
+ * @property limit -
180
+ * Upper limit for the number of records to return.
181
+ * each() guarantees never to return more than limit.
182
+ * Default is no limit
183
+ * @property order - The sort order of the list
184
+ * @property pageSize -
185
+ * Number of records to fetch per request,
186
+ * when not set will use the default value of 50 records.
187
+ * If no pageSize is defined but a limit is defined,
188
+ * each() will attempt to read the limit with the most efficient
189
+ * page size, i.e. min(limit, 1000)
190
+ * @property status - Status to filter by
191
+ */
192
+ interface MediaProcessorListInstanceEachOptions {
193
+ callback?: (item: MediaProcessorInstance, done: (err?: Error) => void) => void;
194
+ done?: Function;
195
+ limit?: number;
196
+ order?: MediaProcessorOrder;
197
+ pageSize?: number;
198
+ status?: MediaProcessorStatus;
199
+ }
200
+
201
+ /**
202
+ * Options to pass to list
203
+ *
204
+ * @property limit -
205
+ * Upper limit for the number of records to return.
206
+ * list() guarantees never to return more than limit.
207
+ * Default is no limit
208
+ * @property order - The sort order of the list
209
+ * @property pageSize -
210
+ * Number of records to fetch per request,
211
+ * when not set will use the default value of 50 records.
212
+ * If no page_size is defined but a limit is defined,
213
+ * list() will attempt to read the limit with the most
214
+ * efficient page size, i.e. min(limit, 1000)
215
+ * @property status - Status to filter by
216
+ */
217
+ interface MediaProcessorListInstanceOptions {
218
+ limit?: number;
219
+ order?: MediaProcessorOrder;
220
+ pageSize?: number;
221
+ status?: MediaProcessorStatus;
222
+ }
223
+
224
+ /**
225
+ * Options to pass to page
226
+ *
227
+ * @property order - The sort order of the list
228
+ * @property pageNumber - Page Number, this value is simply for client state
229
+ * @property pageSize - Number of records to return, defaults to 50
230
+ * @property pageToken - PageToken provided by the API
231
+ * @property status - Status to filter by
232
+ */
233
+ interface MediaProcessorListInstancePageOptions {
234
+ order?: MediaProcessorOrder;
235
+ pageNumber?: number;
236
+ pageSize?: number;
237
+ pageToken?: string;
238
+ status?: MediaProcessorStatus;
239
+ }
240
+
241
+ interface MediaProcessorPayload extends MediaProcessorResource, Page.TwilioResponsePayload {
242
+ }
243
+
244
+ interface MediaProcessorResource {
245
+ account_sid: string;
246
+ date_created: Date;
247
+ date_updated: Date;
248
+ ended_reason: string;
249
+ extension: string;
250
+ extension_context: string;
251
+ sid: string;
252
+ status: MediaProcessorStatus;
253
+ status_callback: string;
254
+ status_callback_method: string;
255
+ url: string;
256
+ }
257
+
258
+ interface MediaProcessorSolution {
259
+ }
260
+
261
+
262
+ declare class MediaProcessorContext {
263
+ /**
264
+ * Initialize the MediaProcessorContext
265
+ *
266
+ * @param version - Version of the resource
267
+ * @param sid - The SID that identifies the resource to fetch
268
+ */
269
+ constructor(version: V1, sid: string);
270
+
271
+ /**
272
+ * fetch a MediaProcessorInstance
273
+ *
274
+ * @param callback - Callback to handle processed record
275
+ */
276
+ fetch(callback?: (error: Error | null, items: MediaProcessorInstance) => any): Promise<MediaProcessorInstance>;
277
+ /**
278
+ * Provide a user-friendly representation
279
+ */
280
+ toJSON(): any;
281
+ /**
282
+ * update a MediaProcessorInstance
283
+ *
284
+ * @param opts - Options for request
285
+ * @param callback - Callback to handle processed record
286
+ */
287
+ update(opts: MediaProcessorInstanceUpdateOptions, callback?: (error: Error | null, items: MediaProcessorInstance) => any): Promise<MediaProcessorInstance>;
288
+ }
289
+
290
+
291
+ declare class MediaProcessorInstance extends SerializableClass {
292
+ /**
293
+ * Initialize the MediaProcessorContext
294
+ *
295
+ * @param version - Version of the resource
296
+ * @param payload - The instance payload
297
+ * @param sid - The SID that identifies the resource to fetch
298
+ */
299
+ constructor(version: V1, payload: MediaProcessorPayload, sid: string);
300
+
301
+ private _proxy: MediaProcessorContext;
302
+ accountSid: string;
303
+ dateCreated: Date;
304
+ dateUpdated: Date;
305
+ endedReason: string;
306
+ extension: string;
307
+ extensionContext: string;
308
+ /**
309
+ * fetch a MediaProcessorInstance
310
+ *
311
+ * @param callback - Callback to handle processed record
312
+ */
313
+ fetch(callback?: (error: Error | null, items: MediaProcessorInstance) => any): Promise<MediaProcessorInstance>;
314
+ sid: string;
315
+ status: MediaProcessorStatus;
316
+ statusCallback: string;
317
+ statusCallbackMethod: string;
318
+ /**
319
+ * Provide a user-friendly representation
320
+ */
321
+ toJSON(): any;
322
+ /**
323
+ * update a MediaProcessorInstance
324
+ *
325
+ * @param opts - Options for request
326
+ * @param callback - Callback to handle processed record
327
+ */
328
+ update(opts: MediaProcessorInstanceUpdateOptions, callback?: (error: Error | null, items: MediaProcessorInstance) => any): Promise<MediaProcessorInstance>;
329
+ url: string;
330
+ }
331
+
332
+
333
+ declare class MediaProcessorPage extends Page<V1, MediaProcessorPayload, MediaProcessorResource, MediaProcessorInstance> {
334
+ /**
335
+ * Initialize the MediaProcessorPage
336
+ *
337
+ * @param version - Version of the resource
338
+ * @param response - Response from the API
339
+ * @param solution - Path solution
340
+ */
341
+ constructor(version: V1, response: Response<string>, solution: MediaProcessorSolution);
342
+
343
+ /**
344
+ * Build an instance of MediaProcessorInstance
345
+ *
346
+ * @param payload - Payload response from the API
347
+ */
348
+ getInstance(payload: MediaProcessorPayload): MediaProcessorInstance;
349
+ /**
350
+ * Provide a user-friendly representation
351
+ */
352
+ toJSON(): any;
353
+ }
354
+
355
+ export { MediaProcessorContext, MediaProcessorInstance, MediaProcessorInstanceUpdateOptions, MediaProcessorList, MediaProcessorListInstance, MediaProcessorListInstanceCreateOptions, MediaProcessorListInstanceEachOptions, MediaProcessorListInstanceOptions, MediaProcessorListInstancePageOptions, MediaProcessorOrder, MediaProcessorPage, MediaProcessorPayload, MediaProcessorResource, MediaProcessorSolution, MediaProcessorStatus, MediaProcessorUpdateStatus }