twilio 3.80.0 → 3.82.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 (63) hide show
  1. package/lib/base/RequestClient.d.ts +26 -2
  2. package/lib/base/RequestClient.js +14 -2
  3. package/lib/rest/Messaging.d.ts +2 -0
  4. package/lib/rest/Messaging.js +9 -0
  5. package/lib/rest/Microvisor.d.ts +28 -0
  6. package/lib/rest/Microvisor.js +62 -0
  7. package/lib/rest/Preview.d.ts +0 -6
  8. package/lib/rest/Preview.js +0 -28
  9. package/lib/rest/Routes.d.ts +30 -0
  10. package/lib/rest/Routes.js +71 -0
  11. package/lib/rest/Twilio.d.ts +4 -0
  12. package/lib/rest/Twilio.js +28 -0
  13. package/lib/rest/Verify.d.ts +2 -0
  14. package/lib/rest/Verify.js +8 -0
  15. package/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.d.ts +2 -2
  16. package/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js +4 -4
  17. package/lib/rest/flexApi/v1/configuration.d.ts +4 -0
  18. package/lib/rest/flexApi/v1/configuration.js +6 -0
  19. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts +1 -1
  20. package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +1 -1
  21. package/lib/rest/flexApi/v1/interaction.d.ts +1 -3
  22. package/lib/rest/messaging/V1.d.ts +3 -0
  23. package/lib/rest/messaging/V1.js +13 -0
  24. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +418 -0
  25. package/lib/rest/messaging/v1/tollfreeVerification.js +802 -0
  26. package/lib/rest/microvisor/V1.d.ts +28 -0
  27. package/lib/rest/microvisor/V1.js +57 -0
  28. package/lib/rest/{preview/bulk_exports/export/day.d.ts → microvisor/v1/app.d.ts} +79 -69
  29. package/lib/rest/{preview/bulk_exports/export/day.js → microvisor/v1/app.js} +160 -122
  30. package/lib/rest/{preview/bulk_exports/export/exportCustomJob.d.ts → microvisor/v1/device.d.ts} +136 -84
  31. package/lib/rest/microvisor/v1/device.js +652 -0
  32. package/lib/rest/routes/V2.d.ts +31 -0
  33. package/lib/rest/routes/V2.js +69 -0
  34. package/lib/rest/routes/v2/phoneNumber.d.ts +168 -0
  35. package/lib/rest/routes/v2/phoneNumber.js +394 -0
  36. package/lib/rest/routes/v2/sipDomain.d.ts +168 -0
  37. package/lib/rest/routes/v2/sipDomain.js +383 -0
  38. package/lib/rest/routes/v2/trunk.d.ts +168 -0
  39. package/lib/rest/routes/v2/trunk.js +390 -0
  40. package/lib/rest/supersim/v1/fleet.d.ts +3 -1
  41. package/lib/rest/supersim/v1/fleet.js +8 -3
  42. package/lib/rest/verify/V2.d.ts +3 -0
  43. package/lib/rest/verify/V2.js +11 -0
  44. package/lib/rest/verify/v2/safelist.d.ts +161 -0
  45. package/lib/rest/verify/v2/safelist.js +408 -0
  46. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  47. package/lib/rest/verify/v2/service/verification.js +1 -1
  48. package/lib/rest/video/v1/room/roomParticipant/roomParticipantAnonymize.d.ts +143 -0
  49. package/lib/rest/video/v1/room/roomParticipant/roomParticipantAnonymize.js +337 -0
  50. package/lib/rest/video/v1/room/roomParticipant.d.ts +7 -0
  51. package/lib/rest/video/v1/room/roomParticipant.js +29 -0
  52. package/lib/twiml/VoiceResponse.d.ts +3 -3
  53. package/lib/webhooks/webhooks.js +1 -0
  54. package/package.json +1 -1
  55. package/lib/rest/preview/BulkExports.d.ts +0 -28
  56. package/lib/rest/preview/BulkExports.js +0 -59
  57. package/lib/rest/preview/bulk_exports/export/exportCustomJob.js +0 -540
  58. package/lib/rest/preview/bulk_exports/export/job.d.ts +0 -163
  59. package/lib/rest/preview/bulk_exports/export/job.js +0 -390
  60. package/lib/rest/preview/bulk_exports/export.d.ts +0 -153
  61. package/lib/rest/preview/bulk_exports/export.js +0 -402
  62. package/lib/rest/preview/bulk_exports/exportConfiguration.d.ts +0 -180
  63. package/lib/rest/preview/bulk_exports/exportConfiguration.js +0 -411
@@ -0,0 +1,69 @@
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 PhoneNumberList = require('./v2/phoneNumber').PhoneNumberList;
14
+ var SipDomainList = require('./v2/sipDomain').SipDomainList;
15
+ var TrunkList = require('./v2/trunk').TrunkList;
16
+ var Version = require('../../base/Version'); /* jshint ignore:line */
17
+
18
+
19
+ /* jshint ignore:start */
20
+ /**
21
+ * Initialize the V2 version of Routes
22
+ *
23
+ * @constructor Twilio.Routes.V2
24
+ *
25
+ * @property {Twilio.Routes.V2.PhoneNumberList} phoneNumbers -
26
+ * phoneNumbers resource
27
+ * @property {Twilio.Routes.V2.SipDomainList} sipDomains - sipDomains resource
28
+ * @property {Twilio.Routes.V2.TrunkList} trunks - trunks resource
29
+ *
30
+ * @param {Twilio.Routes} domain - The twilio domain
31
+ */
32
+ /* jshint ignore:end */
33
+ function V2(domain) {
34
+ Version.prototype.constructor.call(this, domain, 'v2');
35
+
36
+ // Resources
37
+ this._phoneNumbers = undefined;
38
+ this._sipDomains = undefined;
39
+ this._trunks = undefined;
40
+ }
41
+
42
+ _.extend(V2.prototype, Version.prototype);
43
+ V2.prototype.constructor = V2;
44
+
45
+ Object.defineProperty(V2.prototype,
46
+ 'phoneNumbers', {
47
+ get: function() {
48
+ this._phoneNumbers = this._phoneNumbers || new PhoneNumberList(this);
49
+ return this._phoneNumbers;
50
+ }
51
+ });
52
+
53
+ Object.defineProperty(V2.prototype,
54
+ 'sipDomains', {
55
+ get: function() {
56
+ this._sipDomains = this._sipDomains || new SipDomainList(this);
57
+ return this._sipDomains;
58
+ }
59
+ });
60
+
61
+ Object.defineProperty(V2.prototype,
62
+ 'trunks', {
63
+ get: function() {
64
+ this._trunks = this._trunks || new TrunkList(this);
65
+ return this._trunks;
66
+ }
67
+ });
68
+
69
+ module.exports = V2;
@@ -0,0 +1,168 @@
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 V2 = require('../V2');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ /**
14
+ * Initialize the PhoneNumberList
15
+ *
16
+ * @param version - Version of the resource
17
+ */
18
+ declare function PhoneNumberList(version: V2): PhoneNumberListInstance;
19
+
20
+ /**
21
+ * Options to pass to update
22
+ *
23
+ * @property friendlyName - A human readable description of this resource.
24
+ * @property voiceRegion - The Inbound Processing Region used for this phone number for voice
25
+ */
26
+ interface PhoneNumberInstanceUpdateOptions {
27
+ friendlyName?: string;
28
+ voiceRegion?: string;
29
+ }
30
+
31
+ interface PhoneNumberListInstance {
32
+ /**
33
+ * @param sid - sid of instance
34
+ */
35
+ (sid: string): PhoneNumberContext;
36
+ /**
37
+ * Constructs a phone_number
38
+ *
39
+ * @param phoneNumber - The phone number
40
+ */
41
+ get(phoneNumber: string): PhoneNumberContext;
42
+ /**
43
+ * Provide a user-friendly representation
44
+ */
45
+ toJSON(): any;
46
+ }
47
+
48
+ interface PhoneNumberPayload extends PhoneNumberResource, Page.TwilioResponsePayload {
49
+ }
50
+
51
+ interface PhoneNumberResource {
52
+ account_sid: string;
53
+ date_created: Date;
54
+ date_updated: Date;
55
+ friendly_name: string;
56
+ phone_number: string;
57
+ sid: string;
58
+ url: string;
59
+ voice_region: string;
60
+ }
61
+
62
+ interface PhoneNumberSolution {
63
+ }
64
+
65
+
66
+ declare class PhoneNumberContext {
67
+ /**
68
+ * Initialize the PhoneNumberContext
69
+ *
70
+ * @param version - Version of the resource
71
+ * @param phoneNumber - The phone number
72
+ */
73
+ constructor(version: V2, phoneNumber: string);
74
+
75
+ /**
76
+ * fetch a PhoneNumberInstance
77
+ *
78
+ * @param callback - Callback to handle processed record
79
+ */
80
+ fetch(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
81
+ /**
82
+ * Provide a user-friendly representation
83
+ */
84
+ toJSON(): any;
85
+ /**
86
+ * update a PhoneNumberInstance
87
+ *
88
+ * @param callback - Callback to handle processed record
89
+ */
90
+ update(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
91
+ /**
92
+ * update a PhoneNumberInstance
93
+ *
94
+ * @param opts - Options for request
95
+ * @param callback - Callback to handle processed record
96
+ */
97
+ update(opts?: PhoneNumberInstanceUpdateOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
98
+ }
99
+
100
+
101
+ declare class PhoneNumberInstance extends SerializableClass {
102
+ /**
103
+ * Initialize the PhoneNumberContext
104
+ *
105
+ * @param version - Version of the resource
106
+ * @param payload - The instance payload
107
+ * @param phoneNumber - The phone number
108
+ */
109
+ constructor(version: V2, payload: PhoneNumberPayload, phoneNumber: string);
110
+
111
+ private _proxy: PhoneNumberContext;
112
+ accountSid: string;
113
+ dateCreated: Date;
114
+ dateUpdated: Date;
115
+ /**
116
+ * fetch a PhoneNumberInstance
117
+ *
118
+ * @param callback - Callback to handle processed record
119
+ */
120
+ fetch(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
121
+ friendlyName: string;
122
+ phoneNumber: string;
123
+ sid: string;
124
+ /**
125
+ * Provide a user-friendly representation
126
+ */
127
+ toJSON(): any;
128
+ /**
129
+ * update a PhoneNumberInstance
130
+ *
131
+ * @param callback - Callback to handle processed record
132
+ */
133
+ update(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
134
+ /**
135
+ * update a PhoneNumberInstance
136
+ *
137
+ * @param opts - Options for request
138
+ * @param callback - Callback to handle processed record
139
+ */
140
+ update(opts?: PhoneNumberInstanceUpdateOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
141
+ url: string;
142
+ voiceRegion: string;
143
+ }
144
+
145
+
146
+ declare class PhoneNumberPage extends Page<V2, PhoneNumberPayload, PhoneNumberResource, PhoneNumberInstance> {
147
+ /**
148
+ * Initialize the PhoneNumberPage
149
+ *
150
+ * @param version - Version of the resource
151
+ * @param response - Response from the API
152
+ * @param solution - Path solution
153
+ */
154
+ constructor(version: V2, response: Response<string>, solution: PhoneNumberSolution);
155
+
156
+ /**
157
+ * Build an instance of PhoneNumberInstance
158
+ *
159
+ * @param payload - Payload response from the API
160
+ */
161
+ getInstance(payload: PhoneNumberPayload): PhoneNumberInstance;
162
+ /**
163
+ * Provide a user-friendly representation
164
+ */
165
+ toJSON(): any;
166
+ }
167
+
168
+ export { PhoneNumberContext, PhoneNumberInstance, PhoneNumberInstanceUpdateOptions, PhoneNumberList, PhoneNumberListInstance, PhoneNumberPage, PhoneNumberPayload, PhoneNumberResource, PhoneNumberSolution }
@@ -0,0 +1,394 @@
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 PhoneNumberList;
21
+ var PhoneNumberPage;
22
+ var PhoneNumberInstance;
23
+ var PhoneNumberContext;
24
+
25
+ /* jshint ignore:start */
26
+ /**
27
+ * Initialize the PhoneNumberList
28
+ *
29
+ * @constructor Twilio.Routes.V2.PhoneNumberList
30
+ *
31
+ * @param {Twilio.Routes.V2} version - Version of the resource
32
+ */
33
+ /* jshint ignore:end */
34
+ PhoneNumberList = function PhoneNumberList(version) {
35
+ /* jshint ignore:start */
36
+ /**
37
+ * @function phoneNumbers
38
+ * @memberof Twilio.Routes.V2#
39
+ *
40
+ * @param {string} sid - sid of instance
41
+ *
42
+ * @returns {Twilio.Routes.V2.PhoneNumberContext}
43
+ */
44
+ /* jshint ignore:end */
45
+ function PhoneNumberListInstance(sid) {
46
+ return PhoneNumberListInstance.get(sid);
47
+ }
48
+
49
+ PhoneNumberListInstance._version = version;
50
+ // Path Solution
51
+ PhoneNumberListInstance._solution = {};
52
+ /* jshint ignore:start */
53
+ /**
54
+ * Constructs a phone_number
55
+ *
56
+ * @function get
57
+ * @memberof Twilio.Routes.V2.PhoneNumberList#
58
+ *
59
+ * @param {string} phoneNumber - The phone number
60
+ *
61
+ * @returns {Twilio.Routes.V2.PhoneNumberContext}
62
+ */
63
+ /* jshint ignore:end */
64
+ PhoneNumberListInstance.get = function get(phoneNumber) {
65
+ return new PhoneNumberContext(this._version, phoneNumber);
66
+ };
67
+
68
+ /* jshint ignore:start */
69
+ /**
70
+ * Provide a user-friendly representation
71
+ *
72
+ * @function toJSON
73
+ * @memberof Twilio.Routes.V2.PhoneNumberList#
74
+ *
75
+ * @returns Object
76
+ */
77
+ /* jshint ignore:end */
78
+ PhoneNumberListInstance.toJSON = function toJSON() {
79
+ return this._solution;
80
+ };
81
+
82
+ PhoneNumberListInstance[util.inspect.custom] = function inspect(depth, options)
83
+ {
84
+ return util.inspect(this.toJSON(), options);
85
+ };
86
+
87
+ return PhoneNumberListInstance;
88
+ };
89
+
90
+
91
+ /* jshint ignore:start */
92
+ /**
93
+ * Initialize the PhoneNumberPage
94
+ *
95
+ * @constructor Twilio.Routes.V2.PhoneNumberPage
96
+ *
97
+ * @param {V2} version - Version of the resource
98
+ * @param {Response<string>} response - Response from the API
99
+ * @param {PhoneNumberSolution} solution - Path solution
100
+ *
101
+ * @returns PhoneNumberPage
102
+ */
103
+ /* jshint ignore:end */
104
+ PhoneNumberPage = function PhoneNumberPage(version, response, solution) {
105
+ // Path Solution
106
+ this._solution = solution;
107
+
108
+ Page.prototype.constructor.call(this, version, response, this._solution);
109
+ };
110
+
111
+ _.extend(PhoneNumberPage.prototype, Page.prototype);
112
+ PhoneNumberPage.prototype.constructor = PhoneNumberPage;
113
+
114
+ /* jshint ignore:start */
115
+ /**
116
+ * Build an instance of PhoneNumberInstance
117
+ *
118
+ * @function getInstance
119
+ * @memberof Twilio.Routes.V2.PhoneNumberPage#
120
+ *
121
+ * @param {PhoneNumberPayload} payload - Payload response from the API
122
+ *
123
+ * @returns PhoneNumberInstance
124
+ */
125
+ /* jshint ignore:end */
126
+ PhoneNumberPage.prototype.getInstance = function getInstance(payload) {
127
+ return new PhoneNumberInstance(this._version, payload);
128
+ };
129
+
130
+ /* jshint ignore:start */
131
+ /**
132
+ * Provide a user-friendly representation
133
+ *
134
+ * @function toJSON
135
+ * @memberof Twilio.Routes.V2.PhoneNumberPage#
136
+ *
137
+ * @returns Object
138
+ */
139
+ /* jshint ignore:end */
140
+ PhoneNumberPage.prototype.toJSON = function toJSON() {
141
+ let clone = {};
142
+ _.forOwn(this, function(value, key) {
143
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
144
+ clone[key] = value;
145
+ }
146
+ });
147
+ return clone;
148
+ };
149
+
150
+ PhoneNumberPage.prototype[util.inspect.custom] = function inspect(depth,
151
+ options) {
152
+ return util.inspect(this.toJSON(), options);
153
+ };
154
+
155
+
156
+ /* jshint ignore:start */
157
+ /**
158
+ * Initialize the PhoneNumberContext
159
+ *
160
+ * @constructor Twilio.Routes.V2.PhoneNumberInstance
161
+ *
162
+ * @property {string} phoneNumber - The phone number
163
+ * @property {string} url - The absolute URL of the resource
164
+ * @property {string} sid -
165
+ * A string that uniquely identifies the Inbound Processing Region assignments for this phone number.
166
+ * @property {string} accountSid - Account Sid.
167
+ * @property {string} friendlyName -
168
+ * A human readable description of the Inbound Processing Region assignments for this phone number.
169
+ * @property {string} voiceRegion -
170
+ * The Inbound Processing Region used for this phone number for voice.
171
+ * @property {Date} dateCreated -
172
+ * The date that this phone number was assigned an Inbound Processing Region.
173
+ * @property {Date} dateUpdated -
174
+ * The date that the Inbound Processing Region was updated for this phone number.
175
+ *
176
+ * @param {V2} version - Version of the resource
177
+ * @param {PhoneNumberPayload} payload - The instance payload
178
+ * @param {string} phoneNumber - The phone number
179
+ */
180
+ /* jshint ignore:end */
181
+ PhoneNumberInstance = function PhoneNumberInstance(version, payload,
182
+ phoneNumber) {
183
+ this._version = version;
184
+
185
+ // Marshaled Properties
186
+ this.phoneNumber = payload.phone_number; // jshint ignore:line
187
+ this.url = payload.url; // jshint ignore:line
188
+ this.sid = payload.sid; // jshint ignore:line
189
+ this.accountSid = payload.account_sid; // jshint ignore:line
190
+ this.friendlyName = payload.friendly_name; // jshint ignore:line
191
+ this.voiceRegion = payload.voice_region; // jshint ignore:line
192
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
193
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
194
+
195
+ // Context
196
+ this._context = undefined;
197
+ this._solution = {phoneNumber: phoneNumber || this.phoneNumber, };
198
+ };
199
+
200
+ Object.defineProperty(PhoneNumberInstance.prototype,
201
+ '_proxy', {
202
+ get: function() {
203
+ if (!this._context) {
204
+ this._context = new PhoneNumberContext(this._version, this._solution.phoneNumber);
205
+ }
206
+
207
+ return this._context;
208
+ }
209
+ });
210
+
211
+ /* jshint ignore:start */
212
+ /**
213
+ * update a PhoneNumberInstance
214
+ *
215
+ * @function update
216
+ * @memberof Twilio.Routes.V2.PhoneNumberInstance#
217
+ *
218
+ * @param {object} [opts] - Options for request
219
+ * @param {string} [opts.voiceRegion] -
220
+ * The Inbound Processing Region used for this phone number for voice
221
+ * @param {string} [opts.friendlyName] -
222
+ * A human readable description of this resource.
223
+ * @param {function} [callback] - Callback to handle processed record
224
+ *
225
+ * @returns {Promise} Resolves to processed PhoneNumberInstance
226
+ */
227
+ /* jshint ignore:end */
228
+ PhoneNumberInstance.prototype.update = function update(opts, callback) {
229
+ return this._proxy.update(opts, callback);
230
+ };
231
+
232
+ /* jshint ignore:start */
233
+ /**
234
+ * fetch a PhoneNumberInstance
235
+ *
236
+ * @function fetch
237
+ * @memberof Twilio.Routes.V2.PhoneNumberInstance#
238
+ *
239
+ * @param {function} [callback] - Callback to handle processed record
240
+ *
241
+ * @returns {Promise} Resolves to processed PhoneNumberInstance
242
+ */
243
+ /* jshint ignore:end */
244
+ PhoneNumberInstance.prototype.fetch = function fetch(callback) {
245
+ return this._proxy.fetch(callback);
246
+ };
247
+
248
+ /* jshint ignore:start */
249
+ /**
250
+ * Provide a user-friendly representation
251
+ *
252
+ * @function toJSON
253
+ * @memberof Twilio.Routes.V2.PhoneNumberInstance#
254
+ *
255
+ * @returns Object
256
+ */
257
+ /* jshint ignore:end */
258
+ PhoneNumberInstance.prototype.toJSON = function toJSON() {
259
+ let clone = {};
260
+ _.forOwn(this, function(value, key) {
261
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
262
+ clone[key] = value;
263
+ }
264
+ });
265
+ return clone;
266
+ };
267
+
268
+ PhoneNumberInstance.prototype[util.inspect.custom] = function inspect(depth,
269
+ options) {
270
+ return util.inspect(this.toJSON(), options);
271
+ };
272
+
273
+
274
+ /* jshint ignore:start */
275
+ /**
276
+ * Initialize the PhoneNumberContext
277
+ *
278
+ * @constructor Twilio.Routes.V2.PhoneNumberContext
279
+ *
280
+ * @param {V2} version - Version of the resource
281
+ * @param {string} phoneNumber - The phone number
282
+ */
283
+ /* jshint ignore:end */
284
+ PhoneNumberContext = function PhoneNumberContext(version, phoneNumber) {
285
+ this._version = version;
286
+
287
+ // Path Solution
288
+ this._solution = {phoneNumber: phoneNumber, };
289
+ this._uri = `/PhoneNumbers/${phoneNumber}`;
290
+ };
291
+
292
+ /* jshint ignore:start */
293
+ /**
294
+ * update a PhoneNumberInstance
295
+ *
296
+ * @function update
297
+ * @memberof Twilio.Routes.V2.PhoneNumberContext#
298
+ *
299
+ * @param {object} [opts] - Options for request
300
+ * @param {string} [opts.voiceRegion] -
301
+ * The Inbound Processing Region used for this phone number for voice
302
+ * @param {string} [opts.friendlyName] -
303
+ * A human readable description of this resource.
304
+ * @param {function} [callback] - Callback to handle processed record
305
+ *
306
+ * @returns {Promise} Resolves to processed PhoneNumberInstance
307
+ */
308
+ /* jshint ignore:end */
309
+ PhoneNumberContext.prototype.update = function update(opts, callback) {
310
+ if (_.isFunction(opts)) {
311
+ callback = opts;
312
+ opts = {};
313
+ }
314
+ opts = opts || {};
315
+
316
+ var deferred = Q.defer();
317
+ var data = values.of({
318
+ 'VoiceRegion': _.get(opts, 'voiceRegion'),
319
+ 'FriendlyName': _.get(opts, 'friendlyName')
320
+ });
321
+
322
+ var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
323
+
324
+ promise = promise.then(function(payload) {
325
+ deferred.resolve(new PhoneNumberInstance(this._version, payload, this._solution.phoneNumber));
326
+ }.bind(this));
327
+
328
+ promise.catch(function(error) {
329
+ deferred.reject(error);
330
+ });
331
+
332
+ if (_.isFunction(callback)) {
333
+ deferred.promise.nodeify(callback);
334
+ }
335
+
336
+ return deferred.promise;
337
+ };
338
+
339
+ /* jshint ignore:start */
340
+ /**
341
+ * fetch a PhoneNumberInstance
342
+ *
343
+ * @function fetch
344
+ * @memberof Twilio.Routes.V2.PhoneNumberContext#
345
+ *
346
+ * @param {function} [callback] - Callback to handle processed record
347
+ *
348
+ * @returns {Promise} Resolves to processed PhoneNumberInstance
349
+ */
350
+ /* jshint ignore:end */
351
+ PhoneNumberContext.prototype.fetch = function fetch(callback) {
352
+ var deferred = Q.defer();
353
+ var promise = this._version.fetch({uri: this._uri, method: 'GET'});
354
+
355
+ promise = promise.then(function(payload) {
356
+ deferred.resolve(new PhoneNumberInstance(this._version, payload, this._solution.phoneNumber));
357
+ }.bind(this));
358
+
359
+ promise.catch(function(error) {
360
+ deferred.reject(error);
361
+ });
362
+
363
+ if (_.isFunction(callback)) {
364
+ deferred.promise.nodeify(callback);
365
+ }
366
+
367
+ return deferred.promise;
368
+ };
369
+
370
+ /* jshint ignore:start */
371
+ /**
372
+ * Provide a user-friendly representation
373
+ *
374
+ * @function toJSON
375
+ * @memberof Twilio.Routes.V2.PhoneNumberContext#
376
+ *
377
+ * @returns Object
378
+ */
379
+ /* jshint ignore:end */
380
+ PhoneNumberContext.prototype.toJSON = function toJSON() {
381
+ return this._solution;
382
+ };
383
+
384
+ PhoneNumberContext.prototype[util.inspect.custom] = function inspect(depth,
385
+ options) {
386
+ return util.inspect(this.toJSON(), options);
387
+ };
388
+
389
+ module.exports = {
390
+ PhoneNumberList: PhoneNumberList,
391
+ PhoneNumberPage: PhoneNumberPage,
392
+ PhoneNumberInstance: PhoneNumberInstance,
393
+ PhoneNumberContext: PhoneNumberContext
394
+ };