twilio 3.83.3 → 3.84.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/README.md +6 -0
  2. package/lib/rest/FlexApi.d.ts +6 -0
  3. package/lib/rest/FlexApi.js +27 -0
  4. package/lib/rest/Messaging.d.ts +4 -0
  5. package/lib/rest/Messaging.js +18 -0
  6. package/lib/rest/Oauth.d.ts +2 -0
  7. package/lib/rest/Oauth.js +8 -0
  8. package/lib/rest/Preview.d.ts +0 -10
  9. package/lib/rest/Preview.js +0 -46
  10. package/lib/rest/api/v2010/account/address.d.ts +6 -0
  11. package/lib/rest/api/v2010/account/address.js +13 -2
  12. package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts +1 -1
  13. package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js +3 -6
  14. package/lib/rest/content/v1/content/approvalFetch.d.ts +139 -0
  15. package/lib/rest/content/v1/content/approvalFetch.js +328 -0
  16. package/lib/rest/content/v1/content.d.ts +7 -6
  17. package/lib/rest/content/v1/content.js +31 -31
  18. package/lib/rest/flexApi/V1.d.ts +3 -0
  19. package/lib/rest/flexApi/V1.js +11 -0
  20. package/lib/rest/flexApi/V2.d.ts +25 -0
  21. package/lib/rest/flexApi/V2.js +46 -0
  22. package/lib/rest/flexApi/v1/assessments.d.ts +113 -0
  23. package/lib/rest/flexApi/v1/assessments.js +300 -0
  24. package/lib/rest/flexApi/v1/goodData.d.ts +2 -2
  25. package/lib/rest/flexApi/v1/goodData.js +4 -4
  26. package/lib/rest/flexApi/v1/userRoles.js +1 -1
  27. package/lib/rest/flexApi/v2/webChannels.d.ts +101 -0
  28. package/lib/rest/flexApi/v2/webChannels.js +244 -0
  29. package/lib/rest/lookups/v2/phoneNumber.d.ts +22 -0
  30. package/lib/rest/lookups/v2/phoneNumber.js +43 -1
  31. package/lib/rest/messaging/V1.d.ts +6 -0
  32. package/lib/rest/messaging/V1.js +24 -0
  33. package/lib/rest/messaging/v1/domainCert.d.ts +178 -0
  34. package/lib/rest/messaging/v1/domainCert.js +447 -0
  35. package/lib/rest/messaging/v1/domainConfig.d.ts +172 -0
  36. package/lib/rest/messaging/v1/domainConfig.js +421 -0
  37. package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +1 -1
  38. package/lib/rest/messaging/v1/service/usAppToPerson.js +5 -2
  39. package/lib/rest/microvisor/v1/device.d.ts +2 -0
  40. package/lib/rest/microvisor/v1/device.js +2 -0
  41. package/lib/rest/oauth/V1.d.ts +3 -0
  42. package/lib/rest/oauth/V1.js +11 -0
  43. package/lib/rest/oauth/v1/deviceCode.d.ts +107 -0
  44. package/lib/rest/oauth/v1/deviceCode.js +258 -0
  45. package/lib/rest/oauth/v1/openidDiscovery.js +1 -1
  46. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  47. package/lib/rest/supersim/v1/settingsUpdate.d.ts +6 -0
  48. package/lib/rest/supersim/v1/settingsUpdate.js +7 -0
  49. package/lib/twiml/VoiceResponse.d.ts +7 -7
  50. package/lib/twiml/VoiceResponse.js +14 -14
  51. package/package.json +1 -1
  52. package/lib/rest/preview/TrustedComms.d.ts +0 -34
  53. package/lib/rest/preview/TrustedComms.js +0 -84
  54. package/lib/rest/preview/trusted_comms/brandedChannel/channel.d.ts +0 -120
  55. package/lib/rest/preview/trusted_comms/brandedChannel/channel.js +0 -257
  56. package/lib/rest/preview/trusted_comms/brandedChannel.d.ts +0 -150
  57. package/lib/rest/preview/trusted_comms/brandedChannel.js +0 -362
  58. package/lib/rest/preview/trusted_comms/brandsInformation.d.ts +0 -158
  59. package/lib/rest/preview/trusted_comms/brandsInformation.js +0 -338
  60. package/lib/rest/preview/trusted_comms/cps.d.ts +0 -156
  61. package/lib/rest/preview/trusted_comms/cps.js +0 -332
  62. package/lib/rest/preview/trusted_comms/currentCall.d.ts +0 -180
  63. package/lib/rest/preview/trusted_comms/currentCall.js +0 -367
@@ -0,0 +1,300 @@
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 values = require('../../../base/values'); /* jshint ignore:line */
17
+
18
+ var AssessmentsList;
19
+ var AssessmentsPage;
20
+ var AssessmentsInstance;
21
+ var AssessmentsContext;
22
+
23
+ /* jshint ignore:start */
24
+ /**
25
+ * Initialize the AssessmentsList
26
+ *
27
+ * @constructor Twilio.FlexApi.V1.AssessmentsList
28
+ *
29
+ * @param {Twilio.FlexApi.V1} version - Version of the resource
30
+ */
31
+ /* jshint ignore:end */
32
+ AssessmentsList = function AssessmentsList(version) {
33
+ /* jshint ignore:start */
34
+ /**
35
+ * @function assessments
36
+ * @memberof Twilio.FlexApi.V1#
37
+ *
38
+ * @param {string} sid - sid of instance
39
+ *
40
+ * @returns {Twilio.FlexApi.V1.AssessmentsContext}
41
+ */
42
+ /* jshint ignore:end */
43
+ function AssessmentsListInstance(sid) {
44
+ return AssessmentsListInstance.get(sid);
45
+ }
46
+
47
+ AssessmentsListInstance._version = version;
48
+ // Path Solution
49
+ AssessmentsListInstance._solution = {};
50
+ /* jshint ignore:start */
51
+ /**
52
+ * Constructs a assessments
53
+ *
54
+ * @function get
55
+ * @memberof Twilio.FlexApi.V1.AssessmentsList#
56
+ *
57
+ * @returns {Twilio.FlexApi.V1.AssessmentsContext}
58
+ */
59
+ /* jshint ignore:end */
60
+ AssessmentsListInstance.get = function get() {
61
+ return new AssessmentsContext(this._version);
62
+ };
63
+
64
+ /* jshint ignore:start */
65
+ /**
66
+ * Provide a user-friendly representation
67
+ *
68
+ * @function toJSON
69
+ * @memberof Twilio.FlexApi.V1.AssessmentsList#
70
+ *
71
+ * @returns Object
72
+ */
73
+ /* jshint ignore:end */
74
+ AssessmentsListInstance.toJSON = function toJSON() {
75
+ return this._solution;
76
+ };
77
+
78
+ AssessmentsListInstance[util.inspect.custom] = function inspect(depth, options)
79
+ {
80
+ return util.inspect(this.toJSON(), options);
81
+ };
82
+
83
+ return AssessmentsListInstance;
84
+ };
85
+
86
+
87
+ /* jshint ignore:start */
88
+ /**
89
+ * Initialize the AssessmentsPage
90
+ *
91
+ * @constructor Twilio.FlexApi.V1.AssessmentsPage
92
+ *
93
+ * @param {V1} version - Version of the resource
94
+ * @param {Response<string>} response - Response from the API
95
+ * @param {AssessmentsSolution} solution - Path solution
96
+ *
97
+ * @returns AssessmentsPage
98
+ */
99
+ /* jshint ignore:end */
100
+ AssessmentsPage = function AssessmentsPage(version, response, solution) {
101
+ // Path Solution
102
+ this._solution = solution;
103
+
104
+ Page.prototype.constructor.call(this, version, response, this._solution);
105
+ };
106
+
107
+ _.extend(AssessmentsPage.prototype, Page.prototype);
108
+ AssessmentsPage.prototype.constructor = AssessmentsPage;
109
+
110
+ /* jshint ignore:start */
111
+ /**
112
+ * Build an instance of AssessmentsInstance
113
+ *
114
+ * @function getInstance
115
+ * @memberof Twilio.FlexApi.V1.AssessmentsPage#
116
+ *
117
+ * @param {AssessmentsPayload} payload - Payload response from the API
118
+ *
119
+ * @returns AssessmentsInstance
120
+ */
121
+ /* jshint ignore:end */
122
+ AssessmentsPage.prototype.getInstance = function getInstance(payload) {
123
+ return new AssessmentsInstance(this._version, payload);
124
+ };
125
+
126
+ /* jshint ignore:start */
127
+ /**
128
+ * Provide a user-friendly representation
129
+ *
130
+ * @function toJSON
131
+ * @memberof Twilio.FlexApi.V1.AssessmentsPage#
132
+ *
133
+ * @returns Object
134
+ */
135
+ /* jshint ignore:end */
136
+ AssessmentsPage.prototype.toJSON = function toJSON() {
137
+ let clone = {};
138
+ _.forOwn(this, function(value, key) {
139
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
140
+ clone[key] = value;
141
+ }
142
+ });
143
+ return clone;
144
+ };
145
+
146
+ AssessmentsPage.prototype[util.inspect.custom] = function inspect(depth,
147
+ options) {
148
+ return util.inspect(this.toJSON(), options);
149
+ };
150
+
151
+
152
+ /* jshint ignore:start */
153
+ /**
154
+ * Initialize the AssessmentsContext
155
+ *
156
+ * @constructor Twilio.FlexApi.V1.AssessmentsInstance
157
+ *
158
+ * @property {string} url - The URL of this resource.
159
+ *
160
+ * @param {V1} version - Version of the resource
161
+ * @param {AssessmentsPayload} payload - The instance payload
162
+ */
163
+ /* jshint ignore:end */
164
+ AssessmentsInstance = function AssessmentsInstance(version, payload) {
165
+ this._version = version;
166
+
167
+ // Marshaled Properties
168
+ this.url = payload.url; // jshint ignore:line
169
+
170
+ // Context
171
+ this._context = undefined;
172
+ this._solution = {};
173
+ };
174
+
175
+ Object.defineProperty(AssessmentsInstance.prototype,
176
+ '_proxy', {
177
+ get: function() {
178
+ if (!this._context) {
179
+ this._context = new AssessmentsContext(this._version);
180
+ }
181
+
182
+ return this._context;
183
+ }
184
+ });
185
+
186
+ /* jshint ignore:start */
187
+ /**
188
+ * create a AssessmentsInstance
189
+ *
190
+ * @function create
191
+ * @memberof Twilio.FlexApi.V1.AssessmentsInstance#
192
+ *
193
+ * @param {function} [callback] - Callback to handle processed record
194
+ *
195
+ * @returns {Promise} Resolves to processed AssessmentsInstance
196
+ */
197
+ /* jshint ignore:end */
198
+ AssessmentsInstance.prototype.create = function create(callback) {
199
+ return this._proxy.create(callback);
200
+ };
201
+
202
+ /* jshint ignore:start */
203
+ /**
204
+ * Provide a user-friendly representation
205
+ *
206
+ * @function toJSON
207
+ * @memberof Twilio.FlexApi.V1.AssessmentsInstance#
208
+ *
209
+ * @returns Object
210
+ */
211
+ /* jshint ignore:end */
212
+ AssessmentsInstance.prototype.toJSON = function toJSON() {
213
+ let clone = {};
214
+ _.forOwn(this, function(value, key) {
215
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
216
+ clone[key] = value;
217
+ }
218
+ });
219
+ return clone;
220
+ };
221
+
222
+ AssessmentsInstance.prototype[util.inspect.custom] = function inspect(depth,
223
+ options) {
224
+ return util.inspect(this.toJSON(), options);
225
+ };
226
+
227
+
228
+ /* jshint ignore:start */
229
+ /**
230
+ * Initialize the AssessmentsContext
231
+ *
232
+ * @constructor Twilio.FlexApi.V1.AssessmentsContext
233
+ *
234
+ * @param {V1} version - Version of the resource
235
+ */
236
+ /* jshint ignore:end */
237
+ AssessmentsContext = function AssessmentsContext(version) {
238
+ this._version = version;
239
+
240
+ // Path Solution
241
+ this._solution = {};
242
+ this._uri = `/Accounts/Assessments`;
243
+ };
244
+
245
+ /* jshint ignore:start */
246
+ /**
247
+ * create a AssessmentsInstance
248
+ *
249
+ * @function create
250
+ * @memberof Twilio.FlexApi.V1.AssessmentsContext#
251
+ *
252
+ * @param {function} [callback] - Callback to handle processed record
253
+ *
254
+ * @returns {Promise} Resolves to processed AssessmentsInstance
255
+ */
256
+ /* jshint ignore:end */
257
+ AssessmentsContext.prototype.create = function create(callback) {
258
+ var deferred = Q.defer();
259
+ var promise = this._version.create({uri: this._uri, method: 'POST'});
260
+
261
+ promise = promise.then(function(payload) {
262
+ deferred.resolve(new AssessmentsInstance(this._version, payload));
263
+ }.bind(this));
264
+
265
+ promise.catch(function(error) {
266
+ deferred.reject(error);
267
+ });
268
+
269
+ if (_.isFunction(callback)) {
270
+ deferred.promise.nodeify(callback);
271
+ }
272
+
273
+ return deferred.promise;
274
+ };
275
+
276
+ /* jshint ignore:start */
277
+ /**
278
+ * Provide a user-friendly representation
279
+ *
280
+ * @function toJSON
281
+ * @memberof Twilio.FlexApi.V1.AssessmentsContext#
282
+ *
283
+ * @returns Object
284
+ */
285
+ /* jshint ignore:end */
286
+ AssessmentsContext.prototype.toJSON = function toJSON() {
287
+ return this._solution;
288
+ };
289
+
290
+ AssessmentsContext.prototype[util.inspect.custom] = function inspect(depth,
291
+ options) {
292
+ return util.inspect(this.toJSON(), options);
293
+ };
294
+
295
+ module.exports = {
296
+ AssessmentsList: AssessmentsList,
297
+ AssessmentsPage: AssessmentsPage,
298
+ AssessmentsInstance: AssessmentsInstance,
299
+ AssessmentsContext: AssessmentsContext
300
+ };
@@ -45,7 +45,7 @@ interface GoodDataPayload extends GoodDataResource, Page.TwilioResponsePayload {
45
45
  }
46
46
 
47
47
  interface GoodDataResource {
48
- gd_base_url: string;
48
+ base_url: string;
49
49
  session_expiry: string;
50
50
  session_id: string;
51
51
  url: string;
@@ -94,6 +94,7 @@ declare class GoodDataInstance extends SerializableClass {
94
94
  constructor(version: V1, payload: GoodDataPayload);
95
95
 
96
96
  private _proxy: GoodDataContext;
97
+ baseUrl: string;
97
98
  /**
98
99
  * create a GoodDataInstance
99
100
  *
@@ -107,7 +108,6 @@ declare class GoodDataInstance extends SerializableClass {
107
108
  * @param callback - Callback to handle processed record
108
109
  */
109
110
  create(opts?: GoodDataInstanceCreateOptions, callback?: (error: Error | null, items: GoodDataInstance) => any): Promise<GoodDataInstance>;
110
- gdBaseUrl: string;
111
111
  sessionExpiry: string;
112
112
  sessionId: string;
113
113
  /**
@@ -153,10 +153,10 @@ GoodDataPage.prototype[util.inspect.custom] = function inspect(depth, options) {
153
153
  *
154
154
  * @constructor Twilio.FlexApi.V1.GoodDataInstance
155
155
  *
156
- * @property {string} workspaceId - Unique workspace ID in gooddata
156
+ * @property {string} workspaceId - Unique ID to identify the user's workspace
157
157
  * @property {string} sessionExpiry - The session expiry date and time
158
158
  * @property {string} sessionId - Unique session ID
159
- * @property {string} gdBaseUrl - GoodData login base URL
159
+ * @property {string} baseUrl - Base URL to fetch reports and dashboards
160
160
  * @property {string} url - The URL of this resource.
161
161
  *
162
162
  * @param {V1} version - Version of the resource
@@ -170,7 +170,7 @@ GoodDataInstance = function GoodDataInstance(version, payload) {
170
170
  this.workspaceId = payload.workspace_id; // jshint ignore:line
171
171
  this.sessionExpiry = payload.session_expiry; // jshint ignore:line
172
172
  this.sessionId = payload.session_id; // jshint ignore:line
173
- this.gdBaseUrl = payload.gd_base_url; // jshint ignore:line
173
+ this.baseUrl = payload.base_url; // jshint ignore:line
174
174
  this.url = payload.url; // jshint ignore:line
175
175
 
176
176
  // Context
@@ -247,7 +247,7 @@ GoodDataContext = function GoodDataContext(version) {
247
247
 
248
248
  // Path Solution
249
249
  this._solution = {};
250
- this._uri = `/Accounts/GoodData`;
250
+ this._uri = `/Insights/Session`;
251
251
  };
252
252
 
253
253
  /* jshint ignore:start */
@@ -242,7 +242,7 @@ UserRolesContext = function UserRolesContext(version) {
242
242
 
243
243
  // Path Solution
244
244
  this._solution = {};
245
- this._uri = `/Accounts/UserRoles`;
245
+ this._uri = `/Insights/UserRoles`;
246
246
  };
247
247
 
248
248
  /* jshint ignore:start */
@@ -0,0 +1,101 @@
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 WebChannelsList
15
+ *
16
+ * @param version - Version of the resource
17
+ */
18
+ declare function WebChannelsList(version: V2): WebChannelsListInstance;
19
+
20
+ interface WebChannelsListInstance {
21
+ /**
22
+ * create a WebChannelsInstance
23
+ *
24
+ * @param opts - Options for request
25
+ * @param callback - Callback to handle processed record
26
+ */
27
+ create(opts: WebChannelsListInstanceCreateOptions, callback?: (error: Error | null, item: WebChannelsInstance) => any): Promise<WebChannelsInstance>;
28
+ /**
29
+ * Provide a user-friendly representation
30
+ */
31
+ toJSON(): any;
32
+ }
33
+
34
+ /**
35
+ * Options to pass to create
36
+ *
37
+ * @property addressSid - The SID of the Conversations Address
38
+ * @property chatFriendlyName - The Conversation's friendly name
39
+ * @property customerFriendlyName - The Conversation participant's friendly name
40
+ * @property preEngagementData - The pre-engagement data
41
+ */
42
+ interface WebChannelsListInstanceCreateOptions {
43
+ addressSid: string;
44
+ chatFriendlyName?: string;
45
+ customerFriendlyName?: string;
46
+ preEngagementData?: string;
47
+ }
48
+
49
+ interface WebChannelsPayload extends WebChannelsResource, Page.TwilioResponsePayload {
50
+ }
51
+
52
+ interface WebChannelsResource {
53
+ conversation_sid: string;
54
+ identity: string;
55
+ }
56
+
57
+ interface WebChannelsSolution {
58
+ }
59
+
60
+
61
+ declare class WebChannelsInstance extends SerializableClass {
62
+ /**
63
+ * Initialize the WebChannelsContext
64
+ *
65
+ * @param version - Version of the resource
66
+ * @param payload - The instance payload
67
+ */
68
+ constructor(version: V2, payload: WebChannelsPayload);
69
+
70
+ conversationSid: string;
71
+ identity: string;
72
+ /**
73
+ * Provide a user-friendly representation
74
+ */
75
+ toJSON(): any;
76
+ }
77
+
78
+
79
+ declare class WebChannelsPage extends Page<V2, WebChannelsPayload, WebChannelsResource, WebChannelsInstance> {
80
+ /**
81
+ * Initialize the WebChannelsPage
82
+ *
83
+ * @param version - Version of the resource
84
+ * @param response - Response from the API
85
+ * @param solution - Path solution
86
+ */
87
+ constructor(version: V2, response: Response<string>, solution: WebChannelsSolution);
88
+
89
+ /**
90
+ * Build an instance of WebChannelsInstance
91
+ *
92
+ * @param payload - Payload response from the API
93
+ */
94
+ getInstance(payload: WebChannelsPayload): WebChannelsInstance;
95
+ /**
96
+ * Provide a user-friendly representation
97
+ */
98
+ toJSON(): any;
99
+ }
100
+
101
+ export { WebChannelsInstance, WebChannelsList, WebChannelsListInstance, WebChannelsListInstanceCreateOptions, WebChannelsPage, WebChannelsPayload, WebChannelsResource, WebChannelsSolution }
@@ -0,0 +1,244 @@
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 values = require('../../../base/values'); /* jshint ignore:line */
17
+
18
+ var WebChannelsList;
19
+ var WebChannelsPage;
20
+ var WebChannelsInstance;
21
+
22
+ /* jshint ignore:start */
23
+ /**
24
+ * Initialize the WebChannelsList
25
+ *
26
+ * @constructor Twilio.FlexApi.V2.WebChannelsList
27
+ *
28
+ * @param {Twilio.FlexApi.V2} version - Version of the resource
29
+ */
30
+ /* jshint ignore:end */
31
+ WebChannelsList = function WebChannelsList(version) {
32
+ /* jshint ignore:start */
33
+ /**
34
+ * @function webChannels
35
+ * @memberof Twilio.FlexApi.V2#
36
+ *
37
+ * @param {string} sid - sid of instance
38
+ *
39
+ * @returns {Twilio.FlexApi.V2.WebChannelsContext}
40
+ */
41
+ /* jshint ignore:end */
42
+ function WebChannelsListInstance(sid) {
43
+ return WebChannelsListInstance.get(sid);
44
+ }
45
+
46
+ WebChannelsListInstance._version = version;
47
+ // Path Solution
48
+ WebChannelsListInstance._solution = {};
49
+ WebChannelsListInstance._uri = `/WebChats`;
50
+ /* jshint ignore:start */
51
+ /**
52
+ * create a WebChannelsInstance
53
+ *
54
+ * @function create
55
+ * @memberof Twilio.FlexApi.V2.WebChannelsList#
56
+ *
57
+ * @param {object} opts - Options for request
58
+ * @param {string} opts.addressSid - The SID of the Conversations Address
59
+ * @param {string} [opts.chatFriendlyName] - The Conversation's friendly name
60
+ * @param {string} [opts.customerFriendlyName] -
61
+ * The Conversation participant's friendly name
62
+ * @param {string} [opts.preEngagementData] - The pre-engagement data
63
+ * @param {function} [callback] - Callback to handle processed record
64
+ *
65
+ * @returns {Promise} Resolves to processed WebChannelsInstance
66
+ */
67
+ /* jshint ignore:end */
68
+ WebChannelsListInstance.create = function create(opts, callback) {
69
+ if (_.isUndefined(opts)) {
70
+ throw new Error('Required parameter "opts" missing.');
71
+ }
72
+ if (_.isUndefined(opts['addressSid'])) {
73
+ throw new Error('Required parameter "opts[\'addressSid\']" missing.');
74
+ }
75
+
76
+ var deferred = Q.defer();
77
+ var data = values.of({
78
+ 'AddressSid': _.get(opts, 'addressSid'),
79
+ 'ChatFriendlyName': _.get(opts, 'chatFriendlyName'),
80
+ 'CustomerFriendlyName': _.get(opts, 'customerFriendlyName'),
81
+ 'PreEngagementData': _.get(opts, 'preEngagementData')
82
+ });
83
+
84
+ var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
85
+
86
+ promise = promise.then(function(payload) {
87
+ deferred.resolve(new WebChannelsInstance(this._version, payload));
88
+ }.bind(this));
89
+
90
+ promise.catch(function(error) {
91
+ deferred.reject(error);
92
+ });
93
+
94
+ if (_.isFunction(callback)) {
95
+ deferred.promise.nodeify(callback);
96
+ }
97
+
98
+ return deferred.promise;
99
+ };
100
+
101
+ /* jshint ignore:start */
102
+ /**
103
+ * Provide a user-friendly representation
104
+ *
105
+ * @function toJSON
106
+ * @memberof Twilio.FlexApi.V2.WebChannelsList#
107
+ *
108
+ * @returns Object
109
+ */
110
+ /* jshint ignore:end */
111
+ WebChannelsListInstance.toJSON = function toJSON() {
112
+ return this._solution;
113
+ };
114
+
115
+ WebChannelsListInstance[util.inspect.custom] = function inspect(depth, options)
116
+ {
117
+ return util.inspect(this.toJSON(), options);
118
+ };
119
+
120
+ return WebChannelsListInstance;
121
+ };
122
+
123
+
124
+ /* jshint ignore:start */
125
+ /**
126
+ * Initialize the WebChannelsPage
127
+ *
128
+ * @constructor Twilio.FlexApi.V2.WebChannelsPage
129
+ *
130
+ * @param {V2} version - Version of the resource
131
+ * @param {Response<string>} response - Response from the API
132
+ * @param {WebChannelsSolution} solution - Path solution
133
+ *
134
+ * @returns WebChannelsPage
135
+ */
136
+ /* jshint ignore:end */
137
+ WebChannelsPage = function WebChannelsPage(version, response, solution) {
138
+ // Path Solution
139
+ this._solution = solution;
140
+
141
+ Page.prototype.constructor.call(this, version, response, this._solution);
142
+ };
143
+
144
+ _.extend(WebChannelsPage.prototype, Page.prototype);
145
+ WebChannelsPage.prototype.constructor = WebChannelsPage;
146
+
147
+ /* jshint ignore:start */
148
+ /**
149
+ * Build an instance of WebChannelsInstance
150
+ *
151
+ * @function getInstance
152
+ * @memberof Twilio.FlexApi.V2.WebChannelsPage#
153
+ *
154
+ * @param {WebChannelsPayload} payload - Payload response from the API
155
+ *
156
+ * @returns WebChannelsInstance
157
+ */
158
+ /* jshint ignore:end */
159
+ WebChannelsPage.prototype.getInstance = function getInstance(payload) {
160
+ return new WebChannelsInstance(this._version, payload);
161
+ };
162
+
163
+ /* jshint ignore:start */
164
+ /**
165
+ * Provide a user-friendly representation
166
+ *
167
+ * @function toJSON
168
+ * @memberof Twilio.FlexApi.V2.WebChannelsPage#
169
+ *
170
+ * @returns Object
171
+ */
172
+ /* jshint ignore:end */
173
+ WebChannelsPage.prototype.toJSON = function toJSON() {
174
+ let clone = {};
175
+ _.forOwn(this, function(value, key) {
176
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
177
+ clone[key] = value;
178
+ }
179
+ });
180
+ return clone;
181
+ };
182
+
183
+ WebChannelsPage.prototype[util.inspect.custom] = function inspect(depth,
184
+ options) {
185
+ return util.inspect(this.toJSON(), options);
186
+ };
187
+
188
+
189
+ /* jshint ignore:start */
190
+ /**
191
+ * Initialize the WebChannelsContext
192
+ *
193
+ * @constructor Twilio.FlexApi.V2.WebChannelsInstance
194
+ *
195
+ * @property {string} conversationSid -
196
+ * The unique string representing the Conversation resource created
197
+ * @property {string} identity - The unique string representing the User created
198
+ *
199
+ * @param {V2} version - Version of the resource
200
+ * @param {WebChannelsPayload} payload - The instance payload
201
+ */
202
+ /* jshint ignore:end */
203
+ WebChannelsInstance = function WebChannelsInstance(version, payload) {
204
+ this._version = version;
205
+
206
+ // Marshaled Properties
207
+ this.conversationSid = payload.conversation_sid; // jshint ignore:line
208
+ this.identity = payload.identity; // jshint ignore:line
209
+
210
+ // Context
211
+ this._context = undefined;
212
+ this._solution = {};
213
+ };
214
+
215
+ /* jshint ignore:start */
216
+ /**
217
+ * Provide a user-friendly representation
218
+ *
219
+ * @function toJSON
220
+ * @memberof Twilio.FlexApi.V2.WebChannelsInstance#
221
+ *
222
+ * @returns Object
223
+ */
224
+ /* jshint ignore:end */
225
+ WebChannelsInstance.prototype.toJSON = function toJSON() {
226
+ let clone = {};
227
+ _.forOwn(this, function(value, key) {
228
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
229
+ clone[key] = value;
230
+ }
231
+ });
232
+ return clone;
233
+ };
234
+
235
+ WebChannelsInstance.prototype[util.inspect.custom] = function inspect(depth,
236
+ options) {
237
+ return util.inspect(this.toJSON(), options);
238
+ };
239
+
240
+ module.exports = {
241
+ WebChannelsList: WebChannelsList,
242
+ WebChannelsPage: WebChannelsPage,
243
+ WebChannelsInstance: WebChannelsInstance
244
+ };