twilio 3.69.0 → 3.71.3

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 (68) hide show
  1. package/CHANGES.md +96 -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/Supersim.d.ts +2 -0
  9. package/lib/rest/Supersim.js +8 -0
  10. package/lib/rest/Twilio.d.ts +2 -0
  11. package/lib/rest/Twilio.js +14 -0
  12. package/lib/rest/api/v2010/account/call.d.ts +1 -1
  13. package/lib/rest/api/v2010/account/call.js +1 -1
  14. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +5 -1
  15. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +3 -0
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +5 -1
  17. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +3 -0
  18. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +5 -1
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +3 -0
  20. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +5 -1
  21. package/lib/rest/api/v2010/account/incomingPhoneNumber.js +3 -0
  22. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +172 -0
  23. package/lib/rest/conversations/v1/service/configuration/webhook.js +399 -0
  24. package/lib/rest/conversations/v1/service/configuration.d.ts +2 -0
  25. package/lib/rest/conversations/v1/service/configuration.js +13 -0
  26. package/lib/rest/flexApi/v1/configuration.d.ts +4 -0
  27. package/lib/rest/flexApi/v1/configuration.js +5 -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/media/V1.d.ts +28 -0
  31. package/lib/rest/media/V1.js +59 -0
  32. package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
  33. package/lib/rest/media/v1/mediaProcessor.js +702 -0
  34. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
  35. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
  36. package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
  37. package/lib/rest/media/v1/playerStreamer.js +729 -0
  38. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +330 -0
  39. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +655 -0
  40. package/lib/rest/messaging/v1/brandRegistration.d.ts +15 -2
  41. package/lib/rest/messaging/v1/brandRegistration.js +37 -1
  42. package/lib/rest/messaging/v1/service.d.ts +8 -0
  43. package/lib/rest/messaging/v1/service.js +14 -0
  44. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  45. package/lib/rest/supersim/V1.d.ts +3 -0
  46. package/lib/rest/supersim/V1.js +11 -0
  47. package/lib/rest/supersim/v1/ipCommand.d.ts +362 -0
  48. package/lib/rest/supersim/v1/ipCommand.js +679 -0
  49. package/lib/rest/verify/v2/service/accessToken.d.ts +2 -0
  50. package/lib/rest/verify/v2/service/accessToken.js +3 -1
  51. package/lib/rest/verify/v2/service/entity/factor.d.ts +4 -2
  52. package/lib/rest/verify/v2/service/entity/factor.js +8 -3
  53. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +2 -2
  54. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  55. package/lib/rest/verify/v2/service/verification.d.ts +4 -0
  56. package/lib/rest/verify/v2/service/verification.js +6 -1
  57. package/lib/rest/verify/v2/service.d.ts +6 -0
  58. package/lib/rest/verify/v2/service.js +12 -2
  59. package/lib/rest/verify/v2/verificationAttempt.d.ts +1 -1
  60. package/lib/rest/video/v1/room.d.ts +8 -0
  61. package/lib/rest/video/v1/room.js +13 -1
  62. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  63. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  64. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  65. package/lib/rest/wireless/v1/sim.js +18 -24
  66. package/lib/twiml/VoiceResponse.d.ts +1296 -24
  67. package/lib/twiml/VoiceResponse.js +2170 -82
  68. package/package.json +2 -2
@@ -0,0 +1,679 @@
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 Q = require('q'); /* jshint ignore:line */
13
+ var _ = require('lodash'); /* jshint ignore:line */
14
+ var util = require('util'); /* jshint ignore:line */
15
+ var Page = require('../../../base/Page'); /* jshint ignore:line */
16
+ var deserialize = require(
17
+ '../../../base/deserialize'); /* jshint ignore:line */
18
+ var values = require('../../../base/values'); /* jshint ignore:line */
19
+
20
+ var IpCommandList;
21
+ var IpCommandPage;
22
+ var IpCommandInstance;
23
+ var IpCommandContext;
24
+
25
+ /* jshint ignore:start */
26
+ /**
27
+ * Initialize the IpCommandList
28
+ *
29
+ * PLEASE NOTE that this class contains beta products that are subject to change.
30
+ * Use them with caution.
31
+ *
32
+ * @constructor Twilio.Supersim.V1.IpCommandList
33
+ *
34
+ * @param {Twilio.Supersim.V1} version - Version of the resource
35
+ */
36
+ /* jshint ignore:end */
37
+ IpCommandList = function IpCommandList(version) {
38
+ /* jshint ignore:start */
39
+ /**
40
+ * @function ipCommands
41
+ * @memberof Twilio.Supersim.V1#
42
+ *
43
+ * @param {string} sid - sid of instance
44
+ *
45
+ * @returns {Twilio.Supersim.V1.IpCommandContext}
46
+ */
47
+ /* jshint ignore:end */
48
+ function IpCommandListInstance(sid) {
49
+ return IpCommandListInstance.get(sid);
50
+ }
51
+
52
+ IpCommandListInstance._version = version;
53
+ // Path Solution
54
+ IpCommandListInstance._solution = {};
55
+ IpCommandListInstance._uri = `/IpCommands`;
56
+ /* jshint ignore:start */
57
+ /**
58
+ * create a IpCommandInstance
59
+ *
60
+ * @function create
61
+ * @memberof Twilio.Supersim.V1.IpCommandList#
62
+ *
63
+ * @param {object} opts - Options for request
64
+ * @param {string} opts.sim -
65
+ * The sid or unique_name of the Super SIM to send the IP Command to
66
+ * @param {string} opts.payload - The payload to be delivered to the device
67
+ * @param {number} opts.devicePort -
68
+ * The device port to which the IP Command will be sent
69
+ * @param {ip_command.payload_type} [opts.payloadType] -
70
+ * Indicates how the payload is encoded
71
+ * @param {string} [opts.callbackUrl] -
72
+ * The URL we should call after we have sent the IP Command
73
+ * @param {string} [opts.callbackMethod] -
74
+ * The HTTP method we should use to call callback_url
75
+ * @param {function} [callback] - Callback to handle processed record
76
+ *
77
+ * @returns {Promise} Resolves to processed IpCommandInstance
78
+ */
79
+ /* jshint ignore:end */
80
+ IpCommandListInstance.create = function create(opts, callback) {
81
+ if (_.isUndefined(opts)) {
82
+ throw new Error('Required parameter "opts" missing.');
83
+ }
84
+ if (_.isUndefined(opts.sim)) {
85
+ throw new Error('Required parameter "opts.sim" missing.');
86
+ }
87
+ if (_.isUndefined(opts.payload)) {
88
+ throw new Error('Required parameter "opts.payload" missing.');
89
+ }
90
+ if (_.isUndefined(opts.devicePort)) {
91
+ throw new Error('Required parameter "opts.devicePort" missing.');
92
+ }
93
+
94
+ var deferred = Q.defer();
95
+ var data = values.of({
96
+ 'Sim': _.get(opts, 'sim'),
97
+ 'Payload': _.get(opts, 'payload'),
98
+ 'DevicePort': _.get(opts, 'devicePort'),
99
+ 'PayloadType': _.get(opts, 'payloadType'),
100
+ 'CallbackUrl': _.get(opts, 'callbackUrl'),
101
+ 'CallbackMethod': _.get(opts, 'callbackMethod')
102
+ });
103
+
104
+ var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
105
+
106
+ promise = promise.then(function(payload) {
107
+ deferred.resolve(new IpCommandInstance(this._version, payload, this._solution.sid));
108
+ }.bind(this));
109
+
110
+ promise.catch(function(error) {
111
+ deferred.reject(error);
112
+ });
113
+
114
+ if (_.isFunction(callback)) {
115
+ deferred.promise.nodeify(callback);
116
+ }
117
+
118
+ return deferred.promise;
119
+ };
120
+
121
+ /* jshint ignore:start */
122
+ /**
123
+ * Streams IpCommandInstance records from the API.
124
+ *
125
+ * This operation lazily loads records as efficiently as possible until the limit
126
+ * is reached.
127
+ *
128
+ * The results are passed into the callback function, so this operation is memory
129
+ * efficient.
130
+ *
131
+ * If a function is passed as the first argument, it will be used as the callback
132
+ * function.
133
+ *
134
+ * @function each
135
+ * @memberof Twilio.Supersim.V1.IpCommandList#
136
+ *
137
+ * @param {object} [opts] - Options for request
138
+ * @param {string} [opts.sim] -
139
+ * The SID or unique name of the Sim resource that IP Command was sent to or from.
140
+ * @param {string} [opts.simIccid] -
141
+ * The ICCID of the Sim resource that IP Command was sent to or from.
142
+ * @param {ip_command.status} [opts.status] - The status of the IP Command
143
+ * @param {ip_command.direction} [opts.direction] - The direction of the IP Command
144
+ * @param {number} [opts.limit] -
145
+ * Upper limit for the number of records to return.
146
+ * each() guarantees never to return more than limit.
147
+ * Default is no limit
148
+ * @param {number} [opts.pageSize] -
149
+ * Number of records to fetch per request,
150
+ * when not set will use the default value of 50 records.
151
+ * If no pageSize is defined but a limit is defined,
152
+ * each() will attempt to read the limit with the most efficient
153
+ * page size, i.e. min(limit, 1000)
154
+ * @param {Function} [opts.callback] -
155
+ * Function to process each record. If this and a positional
156
+ * callback are passed, this one will be used
157
+ * @param {Function} [opts.done] -
158
+ * Function to be called upon completion of streaming
159
+ * @param {Function} [callback] - Function to process each record
160
+ */
161
+ /* jshint ignore:end */
162
+ IpCommandListInstance.each = function each(opts, callback) {
163
+ if (_.isFunction(opts)) {
164
+ callback = opts;
165
+ opts = {};
166
+ }
167
+ opts = opts || {};
168
+ if (opts.callback) {
169
+ callback = opts.callback;
170
+ }
171
+ if (_.isUndefined(callback)) {
172
+ throw new Error('Callback function must be provided');
173
+ }
174
+
175
+ var done = false;
176
+ var currentPage = 1;
177
+ var currentResource = 0;
178
+ var limits = this._version.readLimits({
179
+ limit: opts.limit,
180
+ pageSize: opts.pageSize
181
+ });
182
+
183
+ function onComplete(error) {
184
+ done = true;
185
+ if (_.isFunction(opts.done)) {
186
+ opts.done(error);
187
+ }
188
+ }
189
+
190
+ function fetchNextPage(fn) {
191
+ var promise = fn();
192
+ if (_.isUndefined(promise)) {
193
+ onComplete();
194
+ return;
195
+ }
196
+
197
+ promise.then(function(page) {
198
+ _.each(page.instances, function(instance) {
199
+ if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) {
200
+ done = true;
201
+ return false;
202
+ }
203
+
204
+ currentResource++;
205
+ callback(instance, onComplete);
206
+ });
207
+
208
+ if (!done) {
209
+ currentPage++;
210
+ fetchNextPage(_.bind(page.nextPage, page));
211
+ }
212
+ });
213
+
214
+ promise.catch(onComplete);
215
+ }
216
+
217
+ fetchNextPage(_.bind(this.page, this, _.merge(opts, limits)));
218
+ };
219
+
220
+ /* jshint ignore:start */
221
+ /**
222
+ * Lists IpCommandInstance records from the API as a list.
223
+ *
224
+ * If a function is passed as the first argument, it will be used as the callback
225
+ * function.
226
+ *
227
+ * @function list
228
+ * @memberof Twilio.Supersim.V1.IpCommandList#
229
+ *
230
+ * @param {object} [opts] - Options for request
231
+ * @param {string} [opts.sim] -
232
+ * The SID or unique name of the Sim resource that IP Command was sent to or from.
233
+ * @param {string} [opts.simIccid] -
234
+ * The ICCID of the Sim resource that IP Command was sent to or from.
235
+ * @param {ip_command.status} [opts.status] - The status of the IP Command
236
+ * @param {ip_command.direction} [opts.direction] - The direction of the IP Command
237
+ * @param {number} [opts.limit] -
238
+ * Upper limit for the number of records to return.
239
+ * list() guarantees never to return more than limit.
240
+ * Default is no limit
241
+ * @param {number} [opts.pageSize] -
242
+ * Number of records to fetch per request,
243
+ * when not set will use the default value of 50 records.
244
+ * If no page_size is defined but a limit is defined,
245
+ * list() will attempt to read the limit with the most
246
+ * efficient page size, i.e. min(limit, 1000)
247
+ * @param {function} [callback] - Callback to handle list of records
248
+ *
249
+ * @returns {Promise} Resolves to a list of records
250
+ */
251
+ /* jshint ignore:end */
252
+ IpCommandListInstance.list = function list(opts, callback) {
253
+ if (_.isFunction(opts)) {
254
+ callback = opts;
255
+ opts = {};
256
+ }
257
+ opts = opts || {};
258
+ var deferred = Q.defer();
259
+ var allResources = [];
260
+ opts.callback = function(resource, done) {
261
+ allResources.push(resource);
262
+
263
+ if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) {
264
+ done();
265
+ }
266
+ };
267
+
268
+ opts.done = function(error) {
269
+ if (_.isUndefined(error)) {
270
+ deferred.resolve(allResources);
271
+ } else {
272
+ deferred.reject(error);
273
+ }
274
+ };
275
+
276
+ if (_.isFunction(callback)) {
277
+ deferred.promise.nodeify(callback);
278
+ }
279
+
280
+ this.each(opts);
281
+ return deferred.promise;
282
+ };
283
+
284
+ /* jshint ignore:start */
285
+ /**
286
+ * Retrieve a single page of IpCommandInstance records from the API.
287
+ *
288
+ * The request is executed immediately.
289
+ *
290
+ * If a function is passed as the first argument, it will be used as the callback
291
+ * function.
292
+ *
293
+ * @function page
294
+ * @memberof Twilio.Supersim.V1.IpCommandList#
295
+ *
296
+ * @param {object} [opts] - Options for request
297
+ * @param {string} [opts.sim] -
298
+ * The SID or unique name of the Sim resource that IP Command was sent to or from.
299
+ * @param {string} [opts.simIccid] -
300
+ * The ICCID of the Sim resource that IP Command was sent to or from.
301
+ * @param {ip_command.status} [opts.status] - The status of the IP Command
302
+ * @param {ip_command.direction} [opts.direction] - The direction of the IP Command
303
+ * @param {string} [opts.pageToken] - PageToken provided by the API
304
+ * @param {number} [opts.pageNumber] -
305
+ * Page Number, this value is simply for client state
306
+ * @param {number} [opts.pageSize] - Number of records to return, defaults to 50
307
+ * @param {function} [callback] - Callback to handle list of records
308
+ *
309
+ * @returns {Promise} Resolves to a list of records
310
+ */
311
+ /* jshint ignore:end */
312
+ IpCommandListInstance.page = function page(opts, callback) {
313
+ if (_.isFunction(opts)) {
314
+ callback = opts;
315
+ opts = {};
316
+ }
317
+ opts = opts || {};
318
+
319
+ var deferred = Q.defer();
320
+ var data = values.of({
321
+ 'Sim': _.get(opts, 'sim'),
322
+ 'SimIccid': _.get(opts, 'simIccid'),
323
+ 'Status': _.get(opts, 'status'),
324
+ 'Direction': _.get(opts, 'direction'),
325
+ 'PageToken': opts.pageToken,
326
+ 'Page': opts.pageNumber,
327
+ 'PageSize': opts.pageSize
328
+ });
329
+
330
+ var promise = this._version.page({uri: this._uri, method: 'GET', params: data});
331
+
332
+ promise = promise.then(function(payload) {
333
+ deferred.resolve(new IpCommandPage(this._version, payload, this._solution));
334
+ }.bind(this));
335
+
336
+ promise.catch(function(error) {
337
+ deferred.reject(error);
338
+ });
339
+
340
+ if (_.isFunction(callback)) {
341
+ deferred.promise.nodeify(callback);
342
+ }
343
+
344
+ return deferred.promise;
345
+ };
346
+
347
+ /* jshint ignore:start */
348
+ /**
349
+ * Retrieve a single target page of IpCommandInstance records from the API.
350
+ *
351
+ * The request is executed immediately.
352
+ *
353
+ * If a function is passed as the first argument, it will be used as the callback
354
+ * function.
355
+ *
356
+ * @function getPage
357
+ * @memberof Twilio.Supersim.V1.IpCommandList#
358
+ *
359
+ * @param {string} [targetUrl] - API-generated URL for the requested results page
360
+ * @param {function} [callback] - Callback to handle list of records
361
+ *
362
+ * @returns {Promise} Resolves to a list of records
363
+ */
364
+ /* jshint ignore:end */
365
+ IpCommandListInstance.getPage = function getPage(targetUrl, callback) {
366
+ var deferred = Q.defer();
367
+
368
+ var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});
369
+
370
+ promise = promise.then(function(payload) {
371
+ deferred.resolve(new IpCommandPage(this._version, payload, this._solution));
372
+ }.bind(this));
373
+
374
+ promise.catch(function(error) {
375
+ deferred.reject(error);
376
+ });
377
+
378
+ if (_.isFunction(callback)) {
379
+ deferred.promise.nodeify(callback);
380
+ }
381
+
382
+ return deferred.promise;
383
+ };
384
+
385
+ /* jshint ignore:start */
386
+ /**
387
+ * Constructs a ip_command
388
+ *
389
+ * @function get
390
+ * @memberof Twilio.Supersim.V1.IpCommandList#
391
+ *
392
+ * @param {string} sid - The SID that identifies the resource to fetch
393
+ *
394
+ * @returns {Twilio.Supersim.V1.IpCommandContext}
395
+ */
396
+ /* jshint ignore:end */
397
+ IpCommandListInstance.get = function get(sid) {
398
+ return new IpCommandContext(this._version, sid);
399
+ };
400
+
401
+ /* jshint ignore:start */
402
+ /**
403
+ * Provide a user-friendly representation
404
+ *
405
+ * @function toJSON
406
+ * @memberof Twilio.Supersim.V1.IpCommandList#
407
+ *
408
+ * @returns Object
409
+ */
410
+ /* jshint ignore:end */
411
+ IpCommandListInstance.toJSON = function toJSON() {
412
+ return this._solution;
413
+ };
414
+
415
+ IpCommandListInstance[util.inspect.custom] = function inspect(depth, options) {
416
+ return util.inspect(this.toJSON(), options);
417
+ };
418
+
419
+ return IpCommandListInstance;
420
+ };
421
+
422
+
423
+ /* jshint ignore:start */
424
+ /**
425
+ * Initialize the IpCommandPage
426
+ *
427
+ * PLEASE NOTE that this class contains beta products that are subject to change.
428
+ * Use them with caution.
429
+ *
430
+ * @constructor Twilio.Supersim.V1.IpCommandPage
431
+ *
432
+ * @param {V1} version - Version of the resource
433
+ * @param {Response<string>} response - Response from the API
434
+ * @param {IpCommandSolution} solution - Path solution
435
+ *
436
+ * @returns IpCommandPage
437
+ */
438
+ /* jshint ignore:end */
439
+ IpCommandPage = function IpCommandPage(version, response, solution) {
440
+ // Path Solution
441
+ this._solution = solution;
442
+
443
+ Page.prototype.constructor.call(this, version, response, this._solution);
444
+ };
445
+
446
+ _.extend(IpCommandPage.prototype, Page.prototype);
447
+ IpCommandPage.prototype.constructor = IpCommandPage;
448
+
449
+ /* jshint ignore:start */
450
+ /**
451
+ * Build an instance of IpCommandInstance
452
+ *
453
+ * @function getInstance
454
+ * @memberof Twilio.Supersim.V1.IpCommandPage#
455
+ *
456
+ * @param {IpCommandPayload} payload - Payload response from the API
457
+ *
458
+ * @returns IpCommandInstance
459
+ */
460
+ /* jshint ignore:end */
461
+ IpCommandPage.prototype.getInstance = function getInstance(payload) {
462
+ return new IpCommandInstance(this._version, payload);
463
+ };
464
+
465
+ /* jshint ignore:start */
466
+ /**
467
+ * Provide a user-friendly representation
468
+ *
469
+ * @function toJSON
470
+ * @memberof Twilio.Supersim.V1.IpCommandPage#
471
+ *
472
+ * @returns Object
473
+ */
474
+ /* jshint ignore:end */
475
+ IpCommandPage.prototype.toJSON = function toJSON() {
476
+ let clone = {};
477
+ _.forOwn(this, function(value, key) {
478
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
479
+ clone[key] = value;
480
+ }
481
+ });
482
+ return clone;
483
+ };
484
+
485
+ IpCommandPage.prototype[util.inspect.custom] = function inspect(depth, options)
486
+ {
487
+ return util.inspect(this.toJSON(), options);
488
+ };
489
+
490
+
491
+ /* jshint ignore:start */
492
+ /**
493
+ * Initialize the IpCommandContext
494
+ *
495
+ * PLEASE NOTE that this class contains beta products that are subject to change.
496
+ * Use them with caution.
497
+ *
498
+ * @constructor Twilio.Supersim.V1.IpCommandInstance
499
+ *
500
+ * @property {string} sid - The unique string that identifies the resource
501
+ * @property {string} accountSid - The SID of the Account that created the resource
502
+ * @property {string} simSid -
503
+ * The SID of the Super SIM that this IP Command was sent to or from
504
+ * @property {string} simIccid -
505
+ * The ICCID of the Super SIM that this IP Command was sent to or from
506
+ * @property {ip_command.status} status - The status of the IP Command
507
+ * @property {ip_command.direction} direction - The direction of the IP Command
508
+ * @property {string} deviceIp -
509
+ * The IP address of the device that the IP Command was sent to or received from
510
+ * @property {number} devicePort -
511
+ * The port that the IP Command either originated from or was sent to
512
+ * @property {ip_command.payload_type} payloadType -
513
+ * The payload type of the IP Command
514
+ * @property {string} payload -
515
+ * The payload of the IP Command sent to or from the Super SIM
516
+ * @property {Date} dateCreated -
517
+ * The ISO 8601 date and time in GMT when the resource was created
518
+ * @property {Date} dateUpdated -
519
+ * The ISO 8601 date and time in GMT when the resource was last updated
520
+ * @property {string} url - The absolute URL of the IP Command resource
521
+ *
522
+ * @param {V1} version - Version of the resource
523
+ * @param {IpCommandPayload} payload - The instance payload
524
+ * @param {sid} sid - The SID that identifies the resource to fetch
525
+ */
526
+ /* jshint ignore:end */
527
+ IpCommandInstance = function IpCommandInstance(version, payload, sid) {
528
+ this._version = version;
529
+
530
+ // Marshaled Properties
531
+ this.sid = payload.sid; // jshint ignore:line
532
+ this.accountSid = payload.account_sid; // jshint ignore:line
533
+ this.simSid = payload.sim_sid; // jshint ignore:line
534
+ this.simIccid = payload.sim_iccid; // jshint ignore:line
535
+ this.status = payload.status; // jshint ignore:line
536
+ this.direction = payload.direction; // jshint ignore:line
537
+ this.deviceIp = payload.device_ip; // jshint ignore:line
538
+ this.devicePort = deserialize.integer(payload.device_port); // jshint ignore:line
539
+ this.payloadType = payload.payload_type; // jshint ignore:line
540
+ this.payload = payload.payload; // jshint ignore:line
541
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
542
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
543
+ this.url = payload.url; // jshint ignore:line
544
+
545
+ // Context
546
+ this._context = undefined;
547
+ this._solution = {sid: sid || this.sid, };
548
+ };
549
+
550
+ Object.defineProperty(IpCommandInstance.prototype,
551
+ '_proxy', {
552
+ get: function() {
553
+ if (!this._context) {
554
+ this._context = new IpCommandContext(this._version, this._solution.sid);
555
+ }
556
+
557
+ return this._context;
558
+ }
559
+ });
560
+
561
+ /* jshint ignore:start */
562
+ /**
563
+ * fetch a IpCommandInstance
564
+ *
565
+ * @function fetch
566
+ * @memberof Twilio.Supersim.V1.IpCommandInstance#
567
+ *
568
+ * @param {function} [callback] - Callback to handle processed record
569
+ *
570
+ * @returns {Promise} Resolves to processed IpCommandInstance
571
+ */
572
+ /* jshint ignore:end */
573
+ IpCommandInstance.prototype.fetch = function fetch(callback) {
574
+ return this._proxy.fetch(callback);
575
+ };
576
+
577
+ /* jshint ignore:start */
578
+ /**
579
+ * Provide a user-friendly representation
580
+ *
581
+ * @function toJSON
582
+ * @memberof Twilio.Supersim.V1.IpCommandInstance#
583
+ *
584
+ * @returns Object
585
+ */
586
+ /* jshint ignore:end */
587
+ IpCommandInstance.prototype.toJSON = function toJSON() {
588
+ let clone = {};
589
+ _.forOwn(this, function(value, key) {
590
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
591
+ clone[key] = value;
592
+ }
593
+ });
594
+ return clone;
595
+ };
596
+
597
+ IpCommandInstance.prototype[util.inspect.custom] = function inspect(depth,
598
+ options) {
599
+ return util.inspect(this.toJSON(), options);
600
+ };
601
+
602
+
603
+ /* jshint ignore:start */
604
+ /**
605
+ * Initialize the IpCommandContext
606
+ *
607
+ * PLEASE NOTE that this class contains beta products that are subject to change.
608
+ * Use them with caution.
609
+ *
610
+ * @constructor Twilio.Supersim.V1.IpCommandContext
611
+ *
612
+ * @param {V1} version - Version of the resource
613
+ * @param {sid} sid - The SID that identifies the resource to fetch
614
+ */
615
+ /* jshint ignore:end */
616
+ IpCommandContext = function IpCommandContext(version, sid) {
617
+ this._version = version;
618
+
619
+ // Path Solution
620
+ this._solution = {sid: sid, };
621
+ this._uri = `/IpCommands/${sid}`;
622
+ };
623
+
624
+ /* jshint ignore:start */
625
+ /**
626
+ * fetch a IpCommandInstance
627
+ *
628
+ * @function fetch
629
+ * @memberof Twilio.Supersim.V1.IpCommandContext#
630
+ *
631
+ * @param {function} [callback] - Callback to handle processed record
632
+ *
633
+ * @returns {Promise} Resolves to processed IpCommandInstance
634
+ */
635
+ /* jshint ignore:end */
636
+ IpCommandContext.prototype.fetch = function fetch(callback) {
637
+ var deferred = Q.defer();
638
+ var promise = this._version.fetch({uri: this._uri, method: 'GET'});
639
+
640
+ promise = promise.then(function(payload) {
641
+ deferred.resolve(new IpCommandInstance(this._version, payload, this._solution.sid));
642
+ }.bind(this));
643
+
644
+ promise.catch(function(error) {
645
+ deferred.reject(error);
646
+ });
647
+
648
+ if (_.isFunction(callback)) {
649
+ deferred.promise.nodeify(callback);
650
+ }
651
+
652
+ return deferred.promise;
653
+ };
654
+
655
+ /* jshint ignore:start */
656
+ /**
657
+ * Provide a user-friendly representation
658
+ *
659
+ * @function toJSON
660
+ * @memberof Twilio.Supersim.V1.IpCommandContext#
661
+ *
662
+ * @returns Object
663
+ */
664
+ /* jshint ignore:end */
665
+ IpCommandContext.prototype.toJSON = function toJSON() {
666
+ return this._solution;
667
+ };
668
+
669
+ IpCommandContext.prototype[util.inspect.custom] = function inspect(depth,
670
+ options) {
671
+ return util.inspect(this.toJSON(), options);
672
+ };
673
+
674
+ module.exports = {
675
+ IpCommandList: IpCommandList,
676
+ IpCommandPage: IpCommandPage,
677
+ IpCommandInstance: IpCommandInstance,
678
+ IpCommandContext: IpCommandContext
679
+ };
@@ -40,10 +40,12 @@ interface AccessTokenListInstance {
40
40
  /**
41
41
  * Options to pass to create
42
42
  *
43
+ * @property factorFriendlyName - The factor friendly name
43
44
  * @property factorType - The Type of this Factor
44
45
  * @property identity - Unique external identifier of the Entity
45
46
  */
46
47
  interface AccessTokenListInstanceCreateOptions {
48
+ factorFriendlyName?: string;
47
49
  factorType: AccessTokenFactorTypes;
48
50
  identity: string;
49
51
  }
@@ -61,6 +61,7 @@ AccessTokenList = function AccessTokenList(version, serviceSid) {
61
61
  * @param {object} opts - Options for request
62
62
  * @param {string} opts.identity - Unique external identifier of the Entity
63
63
  * @param {access_token.factor_types} opts.factorType - The Type of this Factor
64
+ * @param {string} [opts.factorFriendlyName] - The factor friendly name
64
65
  * @param {function} [callback] - Callback to handle processed record
65
66
  *
66
67
  * @returns {Promise} Resolves to processed AccessTokenInstance
@@ -80,7 +81,8 @@ AccessTokenList = function AccessTokenList(version, serviceSid) {
80
81
  var deferred = Q.defer();
81
82
  var data = values.of({
82
83
  'Identity': _.get(opts, 'identity'),
83
- 'FactorType': _.get(opts, 'factorType')
84
+ 'FactorType': _.get(opts, 'factorType'),
85
+ 'FactorFriendlyName': _.get(opts, 'factorFriendlyName')
84
86
  });
85
87
 
86
88
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});