twilio 3.74.0 → 3.76.0

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 (90) hide show
  1. package/lib/rest/Chat.d.ts +4 -0
  2. package/lib/rest/Chat.js +19 -0
  3. package/lib/rest/FlexApi.d.ts +2 -0
  4. package/lib/rest/FlexApi.js +8 -0
  5. package/lib/rest/Insights.d.ts +2 -0
  6. package/lib/rest/Insights.js +8 -0
  7. package/lib/rest/Media.d.ts +2 -0
  8. package/lib/rest/Media.js +9 -0
  9. package/lib/rest/Supersim.d.ts +0 -2
  10. package/lib/rest/Supersim.js +0 -8
  11. package/lib/rest/api/v2010/account/call/payment.d.ts +1 -1
  12. package/lib/rest/api/v2010/account/call/payment.js +1 -1
  13. package/lib/rest/api/v2010/account/call/siprec.d.ts +2 -0
  14. package/lib/rest/api/v2010/account/call/siprec.js +3 -0
  15. package/lib/rest/api/v2010/account/call/stream.d.ts +4 -8
  16. package/lib/rest/api/v2010/account/call/stream.js +11 -7
  17. package/lib/rest/api/v2010/account/recording.d.ts +31 -2
  18. package/lib/rest/api/v2010/account/recording.js +25 -4
  19. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +1 -1
  21. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +1 -1
  22. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +1 -1
  23. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +1 -1
  24. package/lib/rest/api/v2010/account/usage/record/today.d.ts +1 -1
  25. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +1 -1
  26. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +1 -1
  27. package/lib/rest/api/v2010/account/usage/record.d.ts +1 -1
  28. package/lib/rest/api/v2010/account/usage/trigger.d.ts +1 -1
  29. package/lib/rest/chat/V3.d.ts +25 -0
  30. package/lib/rest/chat/V3.js +46 -0
  31. package/lib/rest/chat/v2/service/user/userChannel.d.ts +26 -1
  32. package/lib/rest/chat/v2/service/user/userChannel.js +18 -4
  33. package/lib/rest/chat/v3/channel.d.ts +177 -0
  34. package/lib/rest/chat/v3/channel.js +373 -0
  35. package/lib/rest/conversations/v1/addressConfiguration.d.ts +3 -3
  36. package/lib/rest/conversations/v1/addressConfiguration.js +4 -4
  37. package/lib/rest/flexApi/V1.d.ts +3 -0
  38. package/lib/rest/flexApi/V1.js +11 -0
  39. package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
  40. package/lib/rest/flexApi/v1/configuration.js +3 -0
  41. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts +266 -0
  42. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js +505 -0
  43. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts +323 -0
  44. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js +674 -0
  45. package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +327 -0
  46. package/lib/rest/flexApi/v1/interaction/interactionChannel.js +718 -0
  47. package/lib/rest/flexApi/v1/interaction.d.ts +152 -0
  48. package/lib/rest/flexApi/v1/interaction.js +395 -0
  49. package/lib/rest/insights/V1.d.ts +3 -0
  50. package/lib/rest/insights/V1.js +11 -0
  51. package/lib/rest/insights/v1/annotation.d.ts +188 -0
  52. package/lib/rest/insights/v1/annotation.js +406 -0
  53. package/lib/rest/media/V1.d.ts +3 -0
  54. package/lib/rest/media/V1.js +12 -0
  55. package/lib/rest/media/v1/mediaProcessor.js +1 -1
  56. package/lib/rest/media/v1/mediaRecording.d.ts +358 -0
  57. package/lib/rest/{supersim/v1/command.js → media/v1/mediaRecording.js} +190 -176
  58. package/lib/rest/media/v1/playerStreamer.d.ts +4 -0
  59. package/lib/rest/media/v1/playerStreamer.js +5 -1
  60. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +5 -5
  61. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +3 -3
  62. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts +2 -0
  63. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js +3 -0
  64. package/lib/rest/supersim/V1.d.ts +0 -3
  65. package/lib/rest/supersim/V1.js +0 -11
  66. package/lib/rest/supersim/v1/fleet.d.ts +0 -16
  67. package/lib/rest/supersim/v1/fleet.js +0 -18
  68. package/lib/rest/supersim/v1/usageRecord.d.ts +3 -3
  69. package/lib/rest/supersim/v1/usageRecord.js +3 -3
  70. package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts +1 -1
  71. package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js +2 -2
  72. package/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts +1 -1
  73. package/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js +2 -2
  74. package/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts +1 -1
  75. package/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js +2 -2
  76. package/lib/rest/verify/v2/service/accessToken.d.ts +6 -0
  77. package/lib/rest/verify/v2/service/accessToken.js +9 -1
  78. package/lib/rest/verify/v2/service/entity/challenge.d.ts +4 -0
  79. package/lib/rest/verify/v2/service/entity/challenge.js +8 -1
  80. package/lib/rest/verify/v2/service/entity/factor.d.ts +2 -0
  81. package/lib/rest/verify/v2/service/entity/factor.js +2 -0
  82. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +4 -0
  83. package/lib/rest/verify/v2/service/entity/newFactor.js +9 -3
  84. package/lib/rest/video/v1/composition.d.ts +4 -0
  85. package/lib/rest/video/v1/composition.js +6 -0
  86. package/lib/rest/video/v1/recording.d.ts +4 -0
  87. package/lib/rest/video/v1/recording.js +6 -0
  88. package/lib/twiml/VoiceResponse.d.ts +2 -2
  89. package/package.json +3 -3
  90. package/lib/rest/supersim/v1/command.d.ts +0 -342
@@ -17,101 +17,46 @@ var deserialize = require(
17
17
  '../../../base/deserialize'); /* jshint ignore:line */
18
18
  var values = require('../../../base/values'); /* jshint ignore:line */
19
19
 
20
- var CommandList;
21
- var CommandPage;
22
- var CommandInstance;
23
- var CommandContext;
20
+ var MediaRecordingList;
21
+ var MediaRecordingPage;
22
+ var MediaRecordingInstance;
23
+ var MediaRecordingContext;
24
24
 
25
25
  /* jshint ignore:start */
26
26
  /**
27
- * Initialize the CommandList
27
+ * Initialize the MediaRecordingList
28
28
  *
29
- * PLEASE NOTE that this class contains beta products that are subject to change.
30
- * Use them with caution.
29
+ * PLEASE NOTE that this class contains preview products that are subject to
30
+ * change. Use them with caution. If you currently do not have developer preview
31
+ * access, please contact help@twilio.com.
31
32
  *
32
- * @constructor Twilio.Supersim.V1.CommandList
33
+ * @constructor Twilio.Media.V1.MediaRecordingList
33
34
  *
34
- * @param {Twilio.Supersim.V1} version - Version of the resource
35
+ * @param {Twilio.Media.V1} version - Version of the resource
35
36
  */
36
37
  /* jshint ignore:end */
37
- CommandList = function CommandList(version) {
38
+ MediaRecordingList = function MediaRecordingList(version) {
38
39
  /* jshint ignore:start */
39
40
  /**
40
- * @function commands
41
- * @memberof Twilio.Supersim.V1#
41
+ * @function mediaRecording
42
+ * @memberof Twilio.Media.V1#
42
43
  *
43
44
  * @param {string} sid - sid of instance
44
45
  *
45
- * @returns {Twilio.Supersim.V1.CommandContext}
46
+ * @returns {Twilio.Media.V1.MediaRecordingContext}
46
47
  */
47
48
  /* jshint ignore:end */
48
- function CommandListInstance(sid) {
49
- return CommandListInstance.get(sid);
49
+ function MediaRecordingListInstance(sid) {
50
+ return MediaRecordingListInstance.get(sid);
50
51
  }
51
52
 
52
- CommandListInstance._version = version;
53
+ MediaRecordingListInstance._version = version;
53
54
  // Path Solution
54
- CommandListInstance._solution = {};
55
- CommandListInstance._uri = `/Commands`;
55
+ MediaRecordingListInstance._solution = {};
56
+ MediaRecordingListInstance._uri = `/MediaRecordings`;
56
57
  /* jshint ignore:start */
57
58
  /**
58
- * create a CommandInstance
59
- *
60
- * @function create
61
- * @memberof Twilio.Supersim.V1.CommandList#
62
- *
63
- * @param {object} opts - Options for request
64
- * @param {string} opts.sim -
65
- * The sid or unique_name of the SIM to send the Command to
66
- * @param {string} opts.command - The message body of the command
67
- * @param {string} [opts.callbackMethod] -
68
- * The HTTP method we should use to call callback_url
69
- * @param {string} [opts.callbackUrl] -
70
- * The URL we should call after we have sent the command
71
- * @param {function} [callback] - Callback to handle processed record
72
- *
73
- * @returns {Promise} Resolves to processed CommandInstance
74
- */
75
- /* jshint ignore:end */
76
- CommandListInstance.create = function create(opts, callback) {
77
- if (_.isUndefined(opts)) {
78
- throw new Error('Required parameter "opts" missing.');
79
- }
80
- if (_.isUndefined(opts['sim'])) {
81
- throw new Error('Required parameter "opts[\'sim\']" missing.');
82
- }
83
- if (_.isUndefined(opts['command'])) {
84
- throw new Error('Required parameter "opts[\'command\']" missing.');
85
- }
86
-
87
- var deferred = Q.defer();
88
- var data = values.of({
89
- 'Sim': _.get(opts, 'sim'),
90
- 'Command': _.get(opts, 'command'),
91
- 'CallbackMethod': _.get(opts, 'callbackMethod'),
92
- 'CallbackUrl': _.get(opts, 'callbackUrl')
93
- });
94
-
95
- var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
96
-
97
- promise = promise.then(function(payload) {
98
- deferred.resolve(new CommandInstance(this._version, payload, this._solution.sid));
99
- }.bind(this));
100
-
101
- promise.catch(function(error) {
102
- deferred.reject(error);
103
- });
104
-
105
- if (_.isFunction(callback)) {
106
- deferred.promise.nodeify(callback);
107
- }
108
-
109
- return deferred.promise;
110
- };
111
-
112
- /* jshint ignore:start */
113
- /**
114
- * Streams CommandInstance records from the API.
59
+ * Streams MediaRecordingInstance records from the API.
115
60
  *
116
61
  * This operation lazily loads records as efficiently as possible until the limit
117
62
  * is reached.
@@ -123,13 +68,13 @@ CommandList = function CommandList(version) {
123
68
  * function.
124
69
  *
125
70
  * @function each
126
- * @memberof Twilio.Supersim.V1.CommandList#
71
+ * @memberof Twilio.Media.V1.MediaRecordingList#
127
72
  *
128
73
  * @param {object} [opts] - Options for request
129
- * @param {string} [opts.sim] -
130
- * The SID or unique name of the Sim that Command was sent to or from.
131
- * @param {command.status} [opts.status] - The status of the Command
132
- * @param {command.direction} [opts.direction] - The direction of the Command
74
+ * @param {media_recording.order} [opts.order] - The sort order of the list
75
+ * @param {media_recording.status} [opts.status] - Status to filter by
76
+ * @param {string} [opts.processorSid] - MediaProcessor to filter by
77
+ * @param {string} [opts.sourceSid] - Source SID to filter by
133
78
  * @param {number} [opts.limit] -
134
79
  * Upper limit for the number of records to return.
135
80
  * each() guarantees never to return more than limit.
@@ -148,7 +93,7 @@ CommandList = function CommandList(version) {
148
93
  * @param {Function} [callback] - Function to process each record
149
94
  */
150
95
  /* jshint ignore:end */
151
- CommandListInstance.each = function each(opts, callback) {
96
+ MediaRecordingListInstance.each = function each(opts, callback) {
152
97
  if (_.isFunction(opts)) {
153
98
  callback = opts;
154
99
  opts = {};
@@ -210,19 +155,19 @@ CommandList = function CommandList(version) {
210
155
 
211
156
  /* jshint ignore:start */
212
157
  /**
213
- * Lists CommandInstance records from the API as a list.
158
+ * Lists MediaRecordingInstance records from the API as a list.
214
159
  *
215
160
  * If a function is passed as the first argument, it will be used as the callback
216
161
  * function.
217
162
  *
218
163
  * @function list
219
- * @memberof Twilio.Supersim.V1.CommandList#
164
+ * @memberof Twilio.Media.V1.MediaRecordingList#
220
165
  *
221
166
  * @param {object} [opts] - Options for request
222
- * @param {string} [opts.sim] -
223
- * The SID or unique name of the Sim that Command was sent to or from.
224
- * @param {command.status} [opts.status] - The status of the Command
225
- * @param {command.direction} [opts.direction] - The direction of the Command
167
+ * @param {media_recording.order} [opts.order] - The sort order of the list
168
+ * @param {media_recording.status} [opts.status] - Status to filter by
169
+ * @param {string} [opts.processorSid] - MediaProcessor to filter by
170
+ * @param {string} [opts.sourceSid] - Source SID to filter by
226
171
  * @param {number} [opts.limit] -
227
172
  * Upper limit for the number of records to return.
228
173
  * list() guarantees never to return more than limit.
@@ -238,7 +183,7 @@ CommandList = function CommandList(version) {
238
183
  * @returns {Promise} Resolves to a list of records
239
184
  */
240
185
  /* jshint ignore:end */
241
- CommandListInstance.list = function list(opts, callback) {
186
+ MediaRecordingListInstance.list = function list(opts, callback) {
242
187
  if (_.isFunction(opts)) {
243
188
  callback = opts;
244
189
  opts = {};
@@ -272,7 +217,7 @@ CommandList = function CommandList(version) {
272
217
 
273
218
  /* jshint ignore:start */
274
219
  /**
275
- * Retrieve a single page of CommandInstance records from the API.
220
+ * Retrieve a single page of MediaRecordingInstance records from the API.
276
221
  *
277
222
  * The request is executed immediately.
278
223
  *
@@ -280,13 +225,13 @@ CommandList = function CommandList(version) {
280
225
  * function.
281
226
  *
282
227
  * @function page
283
- * @memberof Twilio.Supersim.V1.CommandList#
228
+ * @memberof Twilio.Media.V1.MediaRecordingList#
284
229
  *
285
230
  * @param {object} [opts] - Options for request
286
- * @param {string} [opts.sim] -
287
- * The SID or unique name of the Sim that Command was sent to or from.
288
- * @param {command.status} [opts.status] - The status of the Command
289
- * @param {command.direction} [opts.direction] - The direction of the Command
231
+ * @param {media_recording.order} [opts.order] - The sort order of the list
232
+ * @param {media_recording.status} [opts.status] - Status to filter by
233
+ * @param {string} [opts.processorSid] - MediaProcessor to filter by
234
+ * @param {string} [opts.sourceSid] - Source SID to filter by
290
235
  * @param {string} [opts.pageToken] - PageToken provided by the API
291
236
  * @param {number} [opts.pageNumber] -
292
237
  * Page Number, this value is simply for client state
@@ -296,7 +241,7 @@ CommandList = function CommandList(version) {
296
241
  * @returns {Promise} Resolves to a list of records
297
242
  */
298
243
  /* jshint ignore:end */
299
- CommandListInstance.page = function page(opts, callback) {
244
+ MediaRecordingListInstance.page = function page(opts, callback) {
300
245
  if (_.isFunction(opts)) {
301
246
  callback = opts;
302
247
  opts = {};
@@ -305,9 +250,10 @@ CommandList = function CommandList(version) {
305
250
 
306
251
  var deferred = Q.defer();
307
252
  var data = values.of({
308
- 'Sim': _.get(opts, 'sim'),
253
+ 'Order': _.get(opts, 'order'),
309
254
  'Status': _.get(opts, 'status'),
310
- 'Direction': _.get(opts, 'direction'),
255
+ 'ProcessorSid': _.get(opts, 'processorSid'),
256
+ 'SourceSid': _.get(opts, 'sourceSid'),
311
257
  'PageToken': opts.pageToken,
312
258
  'Page': opts.pageNumber,
313
259
  'PageSize': opts.pageSize
@@ -316,7 +262,7 @@ CommandList = function CommandList(version) {
316
262
  var promise = this._version.page({uri: this._uri, method: 'GET', params: data});
317
263
 
318
264
  promise = promise.then(function(payload) {
319
- deferred.resolve(new CommandPage(this._version, payload, this._solution));
265
+ deferred.resolve(new MediaRecordingPage(this._version, payload, this._solution));
320
266
  }.bind(this));
321
267
 
322
268
  promise.catch(function(error) {
@@ -332,7 +278,7 @@ CommandList = function CommandList(version) {
332
278
 
333
279
  /* jshint ignore:start */
334
280
  /**
335
- * Retrieve a single target page of CommandInstance records from the API.
281
+ * Retrieve a single target page of MediaRecordingInstance records from the API.
336
282
  *
337
283
  * The request is executed immediately.
338
284
  *
@@ -340,7 +286,7 @@ CommandList = function CommandList(version) {
340
286
  * function.
341
287
  *
342
288
  * @function getPage
343
- * @memberof Twilio.Supersim.V1.CommandList#
289
+ * @memberof Twilio.Media.V1.MediaRecordingList#
344
290
  *
345
291
  * @param {string} [targetUrl] - API-generated URL for the requested results page
346
292
  * @param {function} [callback] - Callback to handle list of records
@@ -348,13 +294,13 @@ CommandList = function CommandList(version) {
348
294
  * @returns {Promise} Resolves to a list of records
349
295
  */
350
296
  /* jshint ignore:end */
351
- CommandListInstance.getPage = function getPage(targetUrl, callback) {
297
+ MediaRecordingListInstance.getPage = function getPage(targetUrl, callback) {
352
298
  var deferred = Q.defer();
353
299
 
354
300
  var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});
355
301
 
356
302
  promise = promise.then(function(payload) {
357
- deferred.resolve(new CommandPage(this._version, payload, this._solution));
303
+ deferred.resolve(new MediaRecordingPage(this._version, payload, this._solution));
358
304
  }.bind(this));
359
305
 
360
306
  promise.catch(function(error) {
@@ -370,18 +316,18 @@ CommandList = function CommandList(version) {
370
316
 
371
317
  /* jshint ignore:start */
372
318
  /**
373
- * Constructs a command
319
+ * Constructs a media_recording
374
320
  *
375
321
  * @function get
376
- * @memberof Twilio.Supersim.V1.CommandList#
322
+ * @memberof Twilio.Media.V1.MediaRecordingList#
377
323
  *
378
324
  * @param {string} sid - The SID that identifies the resource to fetch
379
325
  *
380
- * @returns {Twilio.Supersim.V1.CommandContext}
326
+ * @returns {Twilio.Media.V1.MediaRecordingContext}
381
327
  */
382
328
  /* jshint ignore:end */
383
- CommandListInstance.get = function get(sid) {
384
- return new CommandContext(this._version, sid);
329
+ MediaRecordingListInstance.get = function get(sid) {
330
+ return new MediaRecordingContext(this._version, sid);
385
331
  };
386
332
 
387
333
  /* jshint ignore:start */
@@ -389,63 +335,65 @@ CommandList = function CommandList(version) {
389
335
  * Provide a user-friendly representation
390
336
  *
391
337
  * @function toJSON
392
- * @memberof Twilio.Supersim.V1.CommandList#
338
+ * @memberof Twilio.Media.V1.MediaRecordingList#
393
339
  *
394
340
  * @returns Object
395
341
  */
396
342
  /* jshint ignore:end */
397
- CommandListInstance.toJSON = function toJSON() {
343
+ MediaRecordingListInstance.toJSON = function toJSON() {
398
344
  return this._solution;
399
345
  };
400
346
 
401
- CommandListInstance[util.inspect.custom] = function inspect(depth, options) {
347
+ MediaRecordingListInstance[util.inspect.custom] = function inspect(depth,
348
+ options) {
402
349
  return util.inspect(this.toJSON(), options);
403
350
  };
404
351
 
405
- return CommandListInstance;
352
+ return MediaRecordingListInstance;
406
353
  };
407
354
 
408
355
 
409
356
  /* jshint ignore:start */
410
357
  /**
411
- * Initialize the CommandPage
358
+ * Initialize the MediaRecordingPage
412
359
  *
413
- * PLEASE NOTE that this class contains beta products that are subject to change.
414
- * Use them with caution.
360
+ * PLEASE NOTE that this class contains preview products that are subject to
361
+ * change. Use them with caution. If you currently do not have developer preview
362
+ * access, please contact help@twilio.com.
415
363
  *
416
- * @constructor Twilio.Supersim.V1.CommandPage
364
+ * @constructor Twilio.Media.V1.MediaRecordingPage
417
365
  *
418
366
  * @param {V1} version - Version of the resource
419
367
  * @param {Response<string>} response - Response from the API
420
- * @param {CommandSolution} solution - Path solution
368
+ * @param {MediaRecordingSolution} solution - Path solution
421
369
  *
422
- * @returns CommandPage
370
+ * @returns MediaRecordingPage
423
371
  */
424
372
  /* jshint ignore:end */
425
- CommandPage = function CommandPage(version, response, solution) {
373
+ MediaRecordingPage = function MediaRecordingPage(version, response, solution) {
426
374
  // Path Solution
427
375
  this._solution = solution;
428
376
 
429
377
  Page.prototype.constructor.call(this, version, response, this._solution);
430
378
  };
431
379
 
432
- _.extend(CommandPage.prototype, Page.prototype);
433
- CommandPage.prototype.constructor = CommandPage;
380
+ _.extend(MediaRecordingPage.prototype, Page.prototype);
381
+ MediaRecordingPage.prototype.constructor = MediaRecordingPage;
434
382
 
435
383
  /* jshint ignore:start */
436
384
  /**
437
- * Build an instance of CommandInstance
385
+ * Build an instance of MediaRecordingInstance
438
386
  *
439
387
  * @function getInstance
440
- * @memberof Twilio.Supersim.V1.CommandPage#
388
+ * @memberof Twilio.Media.V1.MediaRecordingPage#
441
389
  *
442
- * @param {CommandPayload} payload - Payload response from the API
390
+ * @param {MediaRecordingPayload} payload - Payload response from the API
443
391
  *
444
- * @returns CommandInstance
392
+ * @returns MediaRecordingInstance
445
393
  */
446
394
  /* jshint ignore:end */
447
- CommandPage.prototype.getInstance = function getInstance(payload) {
448
- return new CommandInstance(this._version, payload);
395
+ MediaRecordingPage.prototype.getInstance = function getInstance(payload) {
396
+ return new MediaRecordingInstance(this._version, payload);
449
397
  };
450
398
 
451
399
  /* jshint ignore:start */
@@ -453,12 +401,12 @@ CommandPage.prototype.getInstance = function getInstance(payload) {
453
401
  * Provide a user-friendly representation
454
402
  *
455
403
  * @function toJSON
456
- * @memberof Twilio.Supersim.V1.CommandPage#
404
+ * @memberof Twilio.Media.V1.MediaRecordingPage#
457
405
  *
458
406
  * @returns Object
459
407
  */
460
408
  /* jshint ignore:end */
461
- CommandPage.prototype.toJSON = function toJSON() {
409
+ MediaRecordingPage.prototype.toJSON = function toJSON() {
462
410
  let clone = {};
463
411
  _.forOwn(this, function(value, key) {
464
412
  if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
@@ -468,51 +416,69 @@ CommandPage.prototype.toJSON = function toJSON() {
468
416
  return clone;
469
417
  };
470
418
 
471
- CommandPage.prototype[util.inspect.custom] = function inspect(depth, options) {
419
+ MediaRecordingPage.prototype[util.inspect.custom] = function inspect(depth,
420
+ options) {
472
421
  return util.inspect(this.toJSON(), options);
473
422
  };
474
423
 
475
424
 
476
425
  /* jshint ignore:start */
477
426
  /**
478
- * Initialize the CommandContext
427
+ * Initialize the MediaRecordingContext
479
428
  *
480
- * PLEASE NOTE that this class contains beta products that are subject to change.
481
- * Use them with caution.
429
+ * PLEASE NOTE that this class contains preview products that are subject to
430
+ * change. Use them with caution. If you currently do not have developer preview
431
+ * access, please contact help@twilio.com.
482
432
  *
483
- * @constructor Twilio.Supersim.V1.CommandInstance
433
+ * @constructor Twilio.Media.V1.MediaRecordingInstance
484
434
  *
485
- * @property {string} sid - The unique string that identifies the resource
486
435
  * @property {string} accountSid - The SID of the Account that created the resource
487
- * @property {string} simSid -
488
- * The SID of the SIM that this Command was sent to or from
489
- * @property {string} command -
490
- * The message body of the command sent to or from the SIM
491
- * @property {command.status} status - The status of the Command
492
- * @property {command.direction} direction - The direction of the Command
436
+ * @property {number} bitrate - The bitrate of the media
493
437
  * @property {Date} dateCreated -
494
438
  * The ISO 8601 date and time in GMT when the resource was created
495
439
  * @property {Date} dateUpdated -
496
440
  * The ISO 8601 date and time in GMT when the resource was last updated
497
- * @property {string} url - The absolute URL of the Command resource
441
+ * @property {number} duration - The duration of the MediaRecording
442
+ * @property {media_recording.format} format - The format of the MediaRecording
443
+ * @property {string} links - The URLs of related resources
444
+ * @property {string} processorSid - The SID of the MediaProcessor
445
+ * @property {string} resolution - The dimensions of the video image in pixels
446
+ * @property {string} sourceSid -
447
+ * The SID of the resource that generated the original media
448
+ * @property {string} sid - The unique string that identifies the resource
449
+ * @property {number} size - The size of the recording
450
+ * @property {media_recording.status} status - The status of the MediaRecording
451
+ * @property {string} statusCallback -
452
+ * The URL to which Twilio will send MediaRecording event updates
453
+ * @property {string} statusCallbackMethod -
454
+ * The HTTP method Twilio should use to call the `status_callback` URL
455
+ * @property {string} url - The absolute URL of the resource
498
456
  *
499
457
  * @param {V1} version - Version of the resource
500
- * @param {CommandPayload} payload - The instance payload
458
+ * @param {MediaRecordingPayload} payload - The instance payload
501
459
  * @param {sid} sid - The SID that identifies the resource to fetch
502
460
  */
503
461
  /* jshint ignore:end */
504
- CommandInstance = function CommandInstance(version, payload, sid) {
462
+ MediaRecordingInstance = function MediaRecordingInstance(version, payload, sid)
463
+ {
505
464
  this._version = version;
506
465
 
507
466
  // Marshaled Properties
508
- this.sid = payload.sid; // jshint ignore:line
509
467
  this.accountSid = payload.account_sid; // jshint ignore:line
510
- this.simSid = payload.sim_sid; // jshint ignore:line
511
- this.command = payload.command; // jshint ignore:line
512
- this.status = payload.status; // jshint ignore:line
513
- this.direction = payload.direction; // jshint ignore:line
468
+ this.bitrate = deserialize.integer(payload.bitrate); // jshint ignore:line
514
469
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
515
470
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
471
+ this.duration = deserialize.integer(payload.duration); // jshint ignore:line
472
+ this.format = payload.format; // jshint ignore:line
473
+ this.links = payload.links; // jshint ignore:line
474
+ this.processorSid = payload.processor_sid; // jshint ignore:line
475
+ this.resolution = payload.resolution; // jshint ignore:line
476
+ this.sourceSid = payload.source_sid; // jshint ignore:line
477
+ this.sid = payload.sid; // jshint ignore:line
478
+ this.size = deserialize.integer(payload.size); // jshint ignore:line
479
+ this.status = payload.status; // jshint ignore:line
480
+ this.statusCallback = payload.status_callback; // jshint ignore:line
481
+ this.statusCallbackMethod = payload.status_callback_method; // jshint ignore:line
516
482
  this.url = payload.url; // jshint ignore:line
517
483
 
518
484
  // Context
@@ -520,11 +486,11 @@ CommandInstance = function CommandInstance(version, payload, sid) {
520
486
  this._solution = {sid: sid || this.sid, };
521
487
  };
522
488
 
523
- Object.defineProperty(CommandInstance.prototype,
489
+ Object.defineProperty(MediaRecordingInstance.prototype,
524
490
  '_proxy', {
525
491
  get: function() {
526
492
  if (!this._context) {
527
- this._context = new CommandContext(this._version, this._solution.sid);
493
+ this._context = new MediaRecordingContext(this._version, this._solution.sid);
528
494
  }
529
495
 
530
496
  return this._context;
@@ -533,17 +499,33 @@ Object.defineProperty(CommandInstance.prototype,
533
499
 
534
500
  /* jshint ignore:start */
535
501
  /**
536
- * fetch a CommandInstance
502
+ * remove a MediaRecordingInstance
503
+ *
504
+ * @function remove
505
+ * @memberof Twilio.Media.V1.MediaRecordingInstance#
506
+ *
507
+ * @param {function} [callback] - Callback to handle processed record
508
+ *
509
+ * @returns {Promise} Resolves to processed MediaRecordingInstance
510
+ */
511
+ /* jshint ignore:end */
512
+ MediaRecordingInstance.prototype.remove = function remove(callback) {
513
+ return this._proxy.remove(callback);
514
+ };
515
+
516
+ /* jshint ignore:start */
517
+ /**
518
+ * fetch a MediaRecordingInstance
537
519
  *
538
520
  * @function fetch
539
- * @memberof Twilio.Supersim.V1.CommandInstance#
521
+ * @memberof Twilio.Media.V1.MediaRecordingInstance#
540
522
  *
541
523
  * @param {function} [callback] - Callback to handle processed record
542
524
  *
543
- * @returns {Promise} Resolves to processed CommandInstance
525
+ * @returns {Promise} Resolves to processed MediaRecordingInstance
544
526
  */
545
527
  /* jshint ignore:end */
546
- CommandInstance.prototype.fetch = function fetch(callback) {
528
+ MediaRecordingInstance.prototype.fetch = function fetch(callback) {
547
529
  return this._proxy.fetch(callback);
548
530
  };
549
531
 
@@ -552,12 +534,12 @@ CommandInstance.prototype.fetch = function fetch(callback) {
552
534
  * Provide a user-friendly representation
553
535
  *
554
536
  * @function toJSON
555
- * @memberof Twilio.Supersim.V1.CommandInstance#
537
+ * @memberof Twilio.Media.V1.MediaRecordingInstance#
556
538
  *
557
539
  * @returns Object
558
540
  */
559
541
  /* jshint ignore:end */
560
- CommandInstance.prototype.toJSON = function toJSON() {
542
+ MediaRecordingInstance.prototype.toJSON = function toJSON() {
561
543
  let clone = {};
562
544
  _.forOwn(this, function(value, key) {
563
545
  if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
@@ -567,7 +549,7 @@ CommandInstance.prototype.toJSON = function toJSON() {
567
549
  return clone;
568
550
  };
569
551
 
570
- CommandInstance.prototype[util.inspect.custom] = function inspect(depth,
552
+ MediaRecordingInstance.prototype[util.inspect.custom] = function inspect(depth,
571
553
  options) {
572
554
  return util.inspect(this.toJSON(), options);
573
555
  };
@@ -575,43 +557,75 @@ CommandInstance.prototype[util.inspect.custom] = function inspect(depth,
575
557
 
576
558
  /* jshint ignore:start */
577
559
  /**
578
- * Initialize the CommandContext
560
+ * Initialize the MediaRecordingContext
579
561
  *
580
- * PLEASE NOTE that this class contains beta products that are subject to change.
581
- * Use them with caution.
562
+ * PLEASE NOTE that this class contains preview products that are subject to
563
+ * change. Use them with caution. If you currently do not have developer preview
564
+ * access, please contact help@twilio.com.
582
565
  *
583
- * @constructor Twilio.Supersim.V1.CommandContext
566
+ * @constructor Twilio.Media.V1.MediaRecordingContext
584
567
  *
585
568
  * @param {V1} version - Version of the resource
586
569
  * @param {sid} sid - The SID that identifies the resource to fetch
587
570
  */
588
571
  /* jshint ignore:end */
589
- CommandContext = function CommandContext(version, sid) {
572
+ MediaRecordingContext = function MediaRecordingContext(version, sid) {
590
573
  this._version = version;
591
574
 
592
575
  // Path Solution
593
576
  this._solution = {sid: sid, };
594
- this._uri = `/Commands/${sid}`;
577
+ this._uri = `/MediaRecordings/${sid}`;
578
+ };
579
+
580
+ /* jshint ignore:start */
581
+ /**
582
+ * remove a MediaRecordingInstance
583
+ *
584
+ * @function remove
585
+ * @memberof Twilio.Media.V1.MediaRecordingContext#
586
+ *
587
+ * @param {function} [callback] - Callback to handle processed record
588
+ *
589
+ * @returns {Promise} Resolves to processed MediaRecordingInstance
590
+ */
591
+ /* jshint ignore:end */
592
+ MediaRecordingContext.prototype.remove = function remove(callback) {
593
+ var deferred = Q.defer();
594
+ var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
595
+
596
+ promise = promise.then(function(payload) {
597
+ deferred.resolve(payload);
598
+ }.bind(this));
599
+
600
+ promise.catch(function(error) {
601
+ deferred.reject(error);
602
+ });
603
+
604
+ if (_.isFunction(callback)) {
605
+ deferred.promise.nodeify(callback);
606
+ }
607
+
608
+ return deferred.promise;
595
609
  };
596
610
 
597
611
  /* jshint ignore:start */
598
612
  /**
599
- * fetch a CommandInstance
613
+ * fetch a MediaRecordingInstance
600
614
  *
601
615
  * @function fetch
602
- * @memberof Twilio.Supersim.V1.CommandContext#
616
+ * @memberof Twilio.Media.V1.MediaRecordingContext#
603
617
  *
604
618
  * @param {function} [callback] - Callback to handle processed record
605
619
  *
606
- * @returns {Promise} Resolves to processed CommandInstance
620
+ * @returns {Promise} Resolves to processed MediaRecordingInstance
607
621
  */
608
622
  /* jshint ignore:end */
609
- CommandContext.prototype.fetch = function fetch(callback) {
623
+ MediaRecordingContext.prototype.fetch = function fetch(callback) {
610
624
  var deferred = Q.defer();
611
625
  var promise = this._version.fetch({uri: this._uri, method: 'GET'});
612
626
 
613
627
  promise = promise.then(function(payload) {
614
- deferred.resolve(new CommandInstance(this._version, payload, this._solution.sid));
628
+ deferred.resolve(new MediaRecordingInstance(this._version, payload, this._solution.sid));
615
629
  }.bind(this));
616
630
 
617
631
  promise.catch(function(error) {
@@ -630,23 +644,23 @@ CommandContext.prototype.fetch = function fetch(callback) {
630
644
  * Provide a user-friendly representation
631
645
  *
632
646
  * @function toJSON
633
- * @memberof Twilio.Supersim.V1.CommandContext#
647
+ * @memberof Twilio.Media.V1.MediaRecordingContext#
634
648
  *
635
649
  * @returns Object
636
650
  */
637
651
  /* jshint ignore:end */
638
- CommandContext.prototype.toJSON = function toJSON() {
652
+ MediaRecordingContext.prototype.toJSON = function toJSON() {
639
653
  return this._solution;
640
654
  };
641
655
 
642
- CommandContext.prototype[util.inspect.custom] = function inspect(depth, options)
643
- {
656
+ MediaRecordingContext.prototype[util.inspect.custom] = function inspect(depth,
657
+ options) {
644
658
  return util.inspect(this.toJSON(), options);
645
659
  };
646
660
 
647
661
  module.exports = {
648
- CommandList: CommandList,
649
- CommandPage: CommandPage,
650
- CommandInstance: CommandInstance,
651
- CommandContext: CommandContext
662
+ MediaRecordingList: MediaRecordingList,
663
+ MediaRecordingPage: MediaRecordingPage,
664
+ MediaRecordingInstance: MediaRecordingInstance,
665
+ MediaRecordingContext: MediaRecordingContext
652
666
  };