twilio 3.75.0 → 3.76.1

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 (86) hide show
  1. package/README.md +0 -2
  2. package/lib/rest/Chat.d.ts +4 -0
  3. package/lib/rest/Chat.js +19 -0
  4. package/lib/rest/FlexApi.d.ts +2 -0
  5. package/lib/rest/FlexApi.js +8 -0
  6. package/lib/rest/Insights.d.ts +2 -0
  7. package/lib/rest/Insights.js +8 -0
  8. package/lib/rest/Media.d.ts +2 -0
  9. package/lib/rest/Media.js +9 -0
  10. package/lib/rest/Supersim.d.ts +0 -2
  11. package/lib/rest/Supersim.js +0 -8
  12. package/lib/rest/Verify.d.ts +2 -0
  13. package/lib/rest/Verify.js +9 -0
  14. package/lib/rest/api/v2010/account/call/payment.d.ts +1 -1
  15. package/lib/rest/api/v2010/account/call/payment.js +1 -1
  16. package/lib/rest/api/v2010/account/call/stream.d.ts +2 -8
  17. package/lib/rest/api/v2010/account/call/stream.js +8 -7
  18. package/lib/rest/api/v2010/account/call.d.ts +0 -2
  19. package/lib/rest/api/v2010/account/call.js +0 -2
  20. package/lib/rest/api/v2010/account/recording.d.ts +31 -2
  21. package/lib/rest/api/v2010/account/recording.js +25 -4
  22. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +1 -1
  23. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +1 -1
  24. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +1 -1
  25. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +1 -1
  26. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +1 -1
  27. package/lib/rest/api/v2010/account/usage/record/today.d.ts +1 -1
  28. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +1 -1
  29. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +1 -1
  30. package/lib/rest/api/v2010/account/usage/record.d.ts +1 -1
  31. package/lib/rest/api/v2010/account/usage/trigger.d.ts +1 -1
  32. package/lib/rest/chat/V3.d.ts +25 -0
  33. package/lib/rest/chat/V3.js +46 -0
  34. package/lib/rest/chat/v2/service/user/userChannel.d.ts +26 -1
  35. package/lib/rest/chat/v2/service/user/userChannel.js +18 -4
  36. package/lib/rest/chat/v3/channel.d.ts +177 -0
  37. package/lib/rest/chat/v3/channel.js +373 -0
  38. package/lib/rest/flexApi/V1.d.ts +3 -0
  39. package/lib/rest/flexApi/V1.js +11 -0
  40. package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
  41. package/lib/rest/flexApi/v1/configuration.js +3 -0
  42. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts +266 -0
  43. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js +505 -0
  44. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts +323 -0
  45. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js +674 -0
  46. package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +327 -0
  47. package/lib/rest/flexApi/v1/interaction/interactionChannel.js +718 -0
  48. package/lib/rest/flexApi/v1/interaction.d.ts +152 -0
  49. package/lib/rest/flexApi/v1/interaction.js +395 -0
  50. package/lib/rest/insights/V1.d.ts +3 -0
  51. package/lib/rest/insights/V1.js +11 -0
  52. package/lib/rest/insights/v1/annotation.d.ts +188 -0
  53. package/lib/rest/insights/v1/annotation.js +406 -0
  54. package/lib/rest/media/V1.d.ts +3 -0
  55. package/lib/rest/media/V1.js +12 -0
  56. package/lib/rest/media/v1/mediaProcessor.js +1 -1
  57. package/lib/rest/media/v1/mediaRecording.d.ts +358 -0
  58. package/lib/rest/{supersim/v1/command.js → media/v1/mediaRecording.js} +190 -176
  59. package/lib/rest/media/v1/playerStreamer.d.ts +4 -0
  60. package/lib/rest/media/v1/playerStreamer.js +5 -1
  61. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts +2 -0
  62. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js +3 -0
  63. package/lib/rest/supersim/V1.d.ts +0 -3
  64. package/lib/rest/supersim/V1.js +0 -11
  65. package/lib/rest/supersim/v1/fleet.d.ts +0 -16
  66. package/lib/rest/supersim/v1/fleet.js +0 -18
  67. package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts +1 -1
  68. package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js +2 -2
  69. package/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts +1 -1
  70. package/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js +2 -2
  71. package/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts +1 -1
  72. package/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js +2 -2
  73. package/lib/rest/verify/V2.d.ts +3 -0
  74. package/lib/rest/verify/V2.js +13 -0
  75. package/lib/rest/verify/v2/service/accessToken.d.ts +6 -0
  76. package/lib/rest/verify/v2/service/accessToken.js +9 -1
  77. package/lib/rest/verify/v2/service/entity/challenge.d.ts +4 -0
  78. package/lib/rest/verify/v2/service/entity/challenge.js +8 -1
  79. package/lib/rest/verify/v2/verificationAttemptsSummary.d.ts +156 -0
  80. package/lib/rest/verify/v2/verificationAttemptsSummary.js +362 -0
  81. package/lib/rest/video/v1/composition.d.ts +4 -0
  82. package/lib/rest/video/v1/composition.js +6 -0
  83. package/lib/rest/video/v1/recording.d.ts +4 -0
  84. package/lib/rest/video/v1/recording.js +6 -0
  85. package/package.json +3 -3
  86. package/lib/rest/supersim/v1/command.d.ts +0 -342
@@ -512,13 +512,16 @@ UserChannelInstance.prototype.fetch = function fetch(callback) {
512
512
  * @function remove
513
513
  * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserChannelInstance#
514
514
  *
515
+ * @param {object} [opts] - Options for request
516
+ * @param {user_channel.webhook_enabled_type} [opts.xTwilioWebhookEnabled] -
517
+ * The X-Twilio-Webhook-Enabled HTTP request header
515
518
  * @param {function} [callback] - Callback to handle processed record
516
519
  *
517
520
  * @returns {Promise} Resolves to processed UserChannelInstance
518
521
  */
519
522
  /* jshint ignore:end */
520
- UserChannelInstance.prototype.remove = function remove(callback) {
521
- return this._proxy.remove(callback);
523
+ UserChannelInstance.prototype.remove = function remove(opts, callback) {
524
+ return this._proxy.remove(opts, callback);
522
525
  };
523
526
 
524
527
  /* jshint ignore:start */
@@ -638,14 +641,25 @@ UserChannelContext.prototype.fetch = function fetch(callback) {
638
641
  * @function remove
639
642
  * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserChannelContext#
640
643
  *
644
+ * @param {object} [opts] - Options for request
645
+ * @param {user_channel.webhook_enabled_type} [opts.xTwilioWebhookEnabled] -
646
+ * The X-Twilio-Webhook-Enabled HTTP request header
641
647
  * @param {function} [callback] - Callback to handle processed record
642
648
  *
643
649
  * @returns {Promise} Resolves to processed UserChannelInstance
644
650
  */
645
651
  /* jshint ignore:end */
646
- UserChannelContext.prototype.remove = function remove(callback) {
652
+ UserChannelContext.prototype.remove = function remove(opts, callback) {
653
+ if (_.isFunction(opts)) {
654
+ callback = opts;
655
+ opts = {};
656
+ }
657
+ opts = opts || {};
658
+
647
659
  var deferred = Q.defer();
648
- var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
660
+ var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});
661
+
662
+ var promise = this._version.remove({uri: this._uri, method: 'DELETE', headers: headers});
649
663
 
650
664
  promise = promise.then(function(payload) {
651
665
  deferred.resolve(payload);
@@ -0,0 +1,177 @@
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 V3 = require('../V3');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ type ChannelChannelType = 'public'|'private';
14
+
15
+ type ChannelWebhookEnabledType = 'true'|'false';
16
+
17
+ /**
18
+ * Initialize the ChannelList
19
+ *
20
+ * @param version - Version of the resource
21
+ */
22
+ declare function ChannelList(version: V3): ChannelListInstance;
23
+
24
+ /**
25
+ * Options to pass to update
26
+ *
27
+ * @property messagingServiceSid - The unique ID of the Messaging Service this channel belongs to.
28
+ * @property type - The Type for this Channel to migrate to.
29
+ * @property xTwilioWebhookEnabled - The X-Twilio-Webhook-Enabled HTTP request header
30
+ */
31
+ interface ChannelInstanceUpdateOptions {
32
+ messagingServiceSid?: string;
33
+ type?: ChannelChannelType;
34
+ xTwilioWebhookEnabled?: ChannelWebhookEnabledType;
35
+ }
36
+
37
+ interface ChannelListInstance {
38
+ /**
39
+ * @param sid - sid of instance
40
+ */
41
+ (sid: string): ChannelContext;
42
+ /**
43
+ * Constructs a channel
44
+ *
45
+ * @param serviceSid - Service Sid.
46
+ * @param sid - A string that uniquely identifies this Channel.
47
+ */
48
+ get(serviceSid: string, sid: string): ChannelContext;
49
+ /**
50
+ * Provide a user-friendly representation
51
+ */
52
+ toJSON(): any;
53
+ }
54
+
55
+ interface ChannelPayload extends ChannelResource, Page.TwilioResponsePayload {
56
+ }
57
+
58
+ interface ChannelResource {
59
+ account_sid: string;
60
+ attributes: string;
61
+ created_by: string;
62
+ date_created: Date;
63
+ date_updated: Date;
64
+ friendly_name: string;
65
+ members_count: number;
66
+ messages_count: number;
67
+ messaging_service_sid: string;
68
+ service_sid: string;
69
+ sid: string;
70
+ type: ChannelChannelType;
71
+ unique_name: string;
72
+ url: string;
73
+ }
74
+
75
+ interface ChannelSolution {
76
+ }
77
+
78
+
79
+ declare class ChannelContext {
80
+ /**
81
+ * Initialize the ChannelContext
82
+ *
83
+ * @param version - Version of the resource
84
+ * @param serviceSid - Service Sid.
85
+ * @param sid - A string that uniquely identifies this Channel.
86
+ */
87
+ constructor(version: V3, serviceSid: string, sid: string);
88
+
89
+ /**
90
+ * Provide a user-friendly representation
91
+ */
92
+ toJSON(): any;
93
+ /**
94
+ * update a ChannelInstance
95
+ *
96
+ * @param callback - Callback to handle processed record
97
+ */
98
+ update(callback?: (error: Error | null, items: ChannelInstance) => any): Promise<ChannelInstance>;
99
+ /**
100
+ * update a ChannelInstance
101
+ *
102
+ * @param opts - Options for request
103
+ * @param callback - Callback to handle processed record
104
+ */
105
+ update(opts?: ChannelInstanceUpdateOptions, callback?: (error: Error | null, items: ChannelInstance) => any): Promise<ChannelInstance>;
106
+ }
107
+
108
+
109
+ declare class ChannelInstance extends SerializableClass {
110
+ /**
111
+ * Initialize the ChannelContext
112
+ *
113
+ * @param version - Version of the resource
114
+ * @param payload - The instance payload
115
+ * @param serviceSid - Service Sid.
116
+ * @param sid - A string that uniquely identifies this Channel.
117
+ */
118
+ constructor(version: V3, payload: ChannelPayload, serviceSid: string, sid: string);
119
+
120
+ private _proxy: ChannelContext;
121
+ accountSid: string;
122
+ attributes: string;
123
+ createdBy: string;
124
+ dateCreated: Date;
125
+ dateUpdated: Date;
126
+ friendlyName: string;
127
+ membersCount: number;
128
+ messagesCount: number;
129
+ messagingServiceSid: string;
130
+ serviceSid: string;
131
+ sid: string;
132
+ /**
133
+ * Provide a user-friendly representation
134
+ */
135
+ toJSON(): any;
136
+ type: ChannelChannelType;
137
+ uniqueName: string;
138
+ /**
139
+ * update a ChannelInstance
140
+ *
141
+ * @param callback - Callback to handle processed record
142
+ */
143
+ update(callback?: (error: Error | null, items: ChannelInstance) => any): Promise<ChannelInstance>;
144
+ /**
145
+ * update a ChannelInstance
146
+ *
147
+ * @param opts - Options for request
148
+ * @param callback - Callback to handle processed record
149
+ */
150
+ update(opts?: ChannelInstanceUpdateOptions, callback?: (error: Error | null, items: ChannelInstance) => any): Promise<ChannelInstance>;
151
+ url: string;
152
+ }
153
+
154
+
155
+ declare class ChannelPage extends Page<V3, ChannelPayload, ChannelResource, ChannelInstance> {
156
+ /**
157
+ * Initialize the ChannelPage
158
+ *
159
+ * @param version - Version of the resource
160
+ * @param response - Response from the API
161
+ * @param solution - Path solution
162
+ */
163
+ constructor(version: V3, response: Response<string>, solution: ChannelSolution);
164
+
165
+ /**
166
+ * Build an instance of ChannelInstance
167
+ *
168
+ * @param payload - Payload response from the API
169
+ */
170
+ getInstance(payload: ChannelPayload): ChannelInstance;
171
+ /**
172
+ * Provide a user-friendly representation
173
+ */
174
+ toJSON(): any;
175
+ }
176
+
177
+ export { ChannelChannelType, ChannelContext, ChannelInstance, ChannelInstanceUpdateOptions, ChannelList, ChannelListInstance, ChannelPage, ChannelPayload, ChannelResource, ChannelSolution, ChannelWebhookEnabledType }
@@ -0,0 +1,373 @@
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 ChannelList;
21
+ var ChannelPage;
22
+ var ChannelInstance;
23
+ var ChannelContext;
24
+
25
+ /* jshint ignore:start */
26
+ /**
27
+ * Initialize the ChannelList
28
+ *
29
+ * @constructor Twilio.Chat.V3.ChannelList
30
+ *
31
+ * @param {Twilio.Chat.V3} version - Version of the resource
32
+ */
33
+ /* jshint ignore:end */
34
+ ChannelList = function ChannelList(version) {
35
+ /* jshint ignore:start */
36
+ /**
37
+ * @function channels
38
+ * @memberof Twilio.Chat.V3#
39
+ *
40
+ * @param {string} sid - sid of instance
41
+ *
42
+ * @returns {Twilio.Chat.V3.ChannelContext}
43
+ */
44
+ /* jshint ignore:end */
45
+ function ChannelListInstance(sid) {
46
+ return ChannelListInstance.get(sid);
47
+ }
48
+
49
+ ChannelListInstance._version = version;
50
+ // Path Solution
51
+ ChannelListInstance._solution = {};
52
+ /* jshint ignore:start */
53
+ /**
54
+ * Constructs a channel
55
+ *
56
+ * @function get
57
+ * @memberof Twilio.Chat.V3.ChannelList#
58
+ *
59
+ * @param {string} serviceSid - Service Sid.
60
+ * @param {string} sid - A string that uniquely identifies this Channel.
61
+ *
62
+ * @returns {Twilio.Chat.V3.ChannelContext}
63
+ */
64
+ /* jshint ignore:end */
65
+ ChannelListInstance.get = function get(serviceSid, sid) {
66
+ return new ChannelContext(this._version, serviceSid, sid);
67
+ };
68
+
69
+ /* jshint ignore:start */
70
+ /**
71
+ * Provide a user-friendly representation
72
+ *
73
+ * @function toJSON
74
+ * @memberof Twilio.Chat.V3.ChannelList#
75
+ *
76
+ * @returns Object
77
+ */
78
+ /* jshint ignore:end */
79
+ ChannelListInstance.toJSON = function toJSON() {
80
+ return this._solution;
81
+ };
82
+
83
+ ChannelListInstance[util.inspect.custom] = function inspect(depth, options) {
84
+ return util.inspect(this.toJSON(), options);
85
+ };
86
+
87
+ return ChannelListInstance;
88
+ };
89
+
90
+
91
+ /* jshint ignore:start */
92
+ /**
93
+ * Initialize the ChannelPage
94
+ *
95
+ * @constructor Twilio.Chat.V3.ChannelPage
96
+ *
97
+ * @param {V3} version - Version of the resource
98
+ * @param {Response<string>} response - Response from the API
99
+ * @param {ChannelSolution} solution - Path solution
100
+ *
101
+ * @returns ChannelPage
102
+ */
103
+ /* jshint ignore:end */
104
+ ChannelPage = function ChannelPage(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(ChannelPage.prototype, Page.prototype);
112
+ ChannelPage.prototype.constructor = ChannelPage;
113
+
114
+ /* jshint ignore:start */
115
+ /**
116
+ * Build an instance of ChannelInstance
117
+ *
118
+ * @function getInstance
119
+ * @memberof Twilio.Chat.V3.ChannelPage#
120
+ *
121
+ * @param {ChannelPayload} payload - Payload response from the API
122
+ *
123
+ * @returns ChannelInstance
124
+ */
125
+ /* jshint ignore:end */
126
+ ChannelPage.prototype.getInstance = function getInstance(payload) {
127
+ return new ChannelInstance(this._version, payload);
128
+ };
129
+
130
+ /* jshint ignore:start */
131
+ /**
132
+ * Provide a user-friendly representation
133
+ *
134
+ * @function toJSON
135
+ * @memberof Twilio.Chat.V3.ChannelPage#
136
+ *
137
+ * @returns Object
138
+ */
139
+ /* jshint ignore:end */
140
+ ChannelPage.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
+ ChannelPage.prototype[util.inspect.custom] = function inspect(depth, options) {
151
+ return util.inspect(this.toJSON(), options);
152
+ };
153
+
154
+
155
+ /* jshint ignore:start */
156
+ /**
157
+ * Initialize the ChannelContext
158
+ *
159
+ * @constructor Twilio.Chat.V3.ChannelInstance
160
+ *
161
+ * @property {string} sid - The unique string that identifies the resource
162
+ * @property {string} accountSid - The SID of the Account that created the resource
163
+ * @property {string} serviceSid -
164
+ * The SID of the Service that the resource is associated with
165
+ * @property {string} friendlyName -
166
+ * The string that you assigned to describe the resource
167
+ * @property {string} uniqueName -
168
+ * An application-defined string that uniquely identifies the resource
169
+ * @property {string} attributes -
170
+ * The JSON string that stores application-specific data
171
+ * @property {channel.channel_type} type -
172
+ * The visibility of the channel. Can be: `public` or `private`
173
+ * @property {Date} dateCreated -
174
+ * The ISO 8601 date and time in GMT when the resource was created
175
+ * @property {Date} dateUpdated -
176
+ * The ISO 8601 date and time in GMT when the resource was last updated
177
+ * @property {string} createdBy - The identity of the User that created the channel
178
+ * @property {number} membersCount - The number of Members in the Channel
179
+ * @property {number} messagesCount -
180
+ * The number of Messages that have been passed in the Channel
181
+ * @property {string} messagingServiceSid -
182
+ * The unique ID of the Messaging Service this channel belongs to.
183
+ * @property {string} url - The absolute URL of the Channel resource
184
+ *
185
+ * @param {V3} version - Version of the resource
186
+ * @param {ChannelPayload} payload - The instance payload
187
+ * @param {sid} serviceSid - Service Sid.
188
+ * @param {sid_like} sid - A string that uniquely identifies this Channel.
189
+ */
190
+ /* jshint ignore:end */
191
+ ChannelInstance = function ChannelInstance(version, payload, serviceSid, sid) {
192
+ this._version = version;
193
+
194
+ // Marshaled Properties
195
+ this.sid = payload.sid; // jshint ignore:line
196
+ this.accountSid = payload.account_sid; // jshint ignore:line
197
+ this.serviceSid = payload.service_sid; // jshint ignore:line
198
+ this.friendlyName = payload.friendly_name; // jshint ignore:line
199
+ this.uniqueName = payload.unique_name; // jshint ignore:line
200
+ this.attributes = payload.attributes; // jshint ignore:line
201
+ this.type = payload.type; // jshint ignore:line
202
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
203
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
204
+ this.createdBy = payload.created_by; // jshint ignore:line
205
+ this.membersCount = deserialize.integer(payload.members_count); // jshint ignore:line
206
+ this.messagesCount = deserialize.integer(payload.messages_count); // jshint ignore:line
207
+ this.messagingServiceSid = payload.messaging_service_sid; // jshint ignore:line
208
+ this.url = payload.url; // jshint ignore:line
209
+
210
+ // Context
211
+ this._context = undefined;
212
+ this._solution = {serviceSid: serviceSid || this.serviceSid, sid: sid || this.sid, };
213
+ };
214
+
215
+ Object.defineProperty(ChannelInstance.prototype,
216
+ '_proxy', {
217
+ get: function() {
218
+ if (!this._context) {
219
+ this._context = new ChannelContext(this._version, this._solution.serviceSid, this._solution.sid);
220
+ }
221
+
222
+ return this._context;
223
+ }
224
+ });
225
+
226
+ /* jshint ignore:start */
227
+ /**
228
+ * update a ChannelInstance
229
+ *
230
+ * @function update
231
+ * @memberof Twilio.Chat.V3.ChannelInstance#
232
+ *
233
+ * @param {object} [opts] - Options for request
234
+ * @param {channel.channel_type} [opts.type] -
235
+ * The Type for this Channel to migrate to.
236
+ * @param {string} [opts.messagingServiceSid] -
237
+ * The unique ID of the Messaging Service this channel belongs to.
238
+ * @param {channel.webhook_enabled_type} [opts.xTwilioWebhookEnabled] -
239
+ * The X-Twilio-Webhook-Enabled HTTP request header
240
+ * @param {function} [callback] - Callback to handle processed record
241
+ *
242
+ * @returns {Promise} Resolves to processed ChannelInstance
243
+ */
244
+ /* jshint ignore:end */
245
+ ChannelInstance.prototype.update = function update(opts, callback) {
246
+ return this._proxy.update(opts, callback);
247
+ };
248
+
249
+ /* jshint ignore:start */
250
+ /**
251
+ * Provide a user-friendly representation
252
+ *
253
+ * @function toJSON
254
+ * @memberof Twilio.Chat.V3.ChannelInstance#
255
+ *
256
+ * @returns Object
257
+ */
258
+ /* jshint ignore:end */
259
+ ChannelInstance.prototype.toJSON = function toJSON() {
260
+ let clone = {};
261
+ _.forOwn(this, function(value, key) {
262
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
263
+ clone[key] = value;
264
+ }
265
+ });
266
+ return clone;
267
+ };
268
+
269
+ ChannelInstance.prototype[util.inspect.custom] = function inspect(depth,
270
+ options) {
271
+ return util.inspect(this.toJSON(), options);
272
+ };
273
+
274
+
275
+ /* jshint ignore:start */
276
+ /**
277
+ * Initialize the ChannelContext
278
+ *
279
+ * @constructor Twilio.Chat.V3.ChannelContext
280
+ *
281
+ * @param {V3} version - Version of the resource
282
+ * @param {sid} serviceSid - Service Sid.
283
+ * @param {sid_like} sid - A string that uniquely identifies this Channel.
284
+ */
285
+ /* jshint ignore:end */
286
+ ChannelContext = function ChannelContext(version, serviceSid, sid) {
287
+ this._version = version;
288
+
289
+ // Path Solution
290
+ this._solution = {serviceSid: serviceSid, sid: sid, };
291
+ this._uri = `/Services/${serviceSid}/Channels/${sid}`;
292
+ };
293
+
294
+ /* jshint ignore:start */
295
+ /**
296
+ * update a ChannelInstance
297
+ *
298
+ * @function update
299
+ * @memberof Twilio.Chat.V3.ChannelContext#
300
+ *
301
+ * @param {object} [opts] - Options for request
302
+ * @param {channel.channel_type} [opts.type] -
303
+ * The Type for this Channel to migrate to.
304
+ * @param {string} [opts.messagingServiceSid] -
305
+ * The unique ID of the Messaging Service this channel belongs to.
306
+ * @param {channel.webhook_enabled_type} [opts.xTwilioWebhookEnabled] -
307
+ * The X-Twilio-Webhook-Enabled HTTP request header
308
+ * @param {function} [callback] - Callback to handle processed record
309
+ *
310
+ * @returns {Promise} Resolves to processed ChannelInstance
311
+ */
312
+ /* jshint ignore:end */
313
+ ChannelContext.prototype.update = function update(opts, callback) {
314
+ if (_.isFunction(opts)) {
315
+ callback = opts;
316
+ opts = {};
317
+ }
318
+ opts = opts || {};
319
+
320
+ var deferred = Q.defer();
321
+ var data = values.of({
322
+ 'Type': _.get(opts, 'type'),
323
+ 'MessagingServiceSid': _.get(opts, 'messagingServiceSid')
324
+ });
325
+ var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});
326
+
327
+ var promise = this._version.update({uri: this._uri, method: 'POST', data: data, headers: headers});
328
+
329
+ promise = promise.then(function(payload) {
330
+ deferred.resolve(new ChannelInstance(
331
+ this._version,
332
+ payload,
333
+ this._solution.serviceSid,
334
+ this._solution.sid
335
+ ));
336
+ }.bind(this));
337
+
338
+ promise.catch(function(error) {
339
+ deferred.reject(error);
340
+ });
341
+
342
+ if (_.isFunction(callback)) {
343
+ deferred.promise.nodeify(callback);
344
+ }
345
+
346
+ return deferred.promise;
347
+ };
348
+
349
+ /* jshint ignore:start */
350
+ /**
351
+ * Provide a user-friendly representation
352
+ *
353
+ * @function toJSON
354
+ * @memberof Twilio.Chat.V3.ChannelContext#
355
+ *
356
+ * @returns Object
357
+ */
358
+ /* jshint ignore:end */
359
+ ChannelContext.prototype.toJSON = function toJSON() {
360
+ return this._solution;
361
+ };
362
+
363
+ ChannelContext.prototype[util.inspect.custom] = function inspect(depth, options)
364
+ {
365
+ return util.inspect(this.toJSON(), options);
366
+ };
367
+
368
+ module.exports = {
369
+ ChannelList: ChannelList,
370
+ ChannelPage: ChannelPage,
371
+ ChannelInstance: ChannelInstance,
372
+ ChannelContext: ChannelContext
373
+ };
@@ -13,6 +13,8 @@ import { ConfigurationList } from './v1/configuration';
13
13
  import { ConfigurationListInstance } from './v1/configuration';
14
14
  import { FlexFlowList } from './v1/flexFlow';
15
15
  import { FlexFlowListInstance } from './v1/flexFlow';
16
+ import { InteractionList } from './v1/interaction';
17
+ import { InteractionListInstance } from './v1/interaction';
16
18
  import { WebChannelList } from './v1/webChannel';
17
19
  import { WebChannelListInstance } from './v1/webChannel';
18
20
 
@@ -28,6 +30,7 @@ declare class V1 extends Version {
28
30
  readonly channel: ChannelListInstance;
29
31
  readonly configuration: ConfigurationListInstance;
30
32
  readonly flexFlow: FlexFlowListInstance;
33
+ readonly interaction: InteractionListInstance;
31
34
  readonly webChannel: WebChannelListInstance;
32
35
  }
33
36
 
@@ -13,6 +13,7 @@ var _ = require('lodash'); /* jshint ignore:line */
13
13
  var ChannelList = require('./v1/channel').ChannelList;
14
14
  var ConfigurationList = require('./v1/configuration').ConfigurationList;
15
15
  var FlexFlowList = require('./v1/flexFlow').FlexFlowList;
16
+ var InteractionList = require('./v1/interaction').InteractionList;
16
17
  var Version = require('../../base/Version'); /* jshint ignore:line */
17
18
  var WebChannelList = require('./v1/webChannel').WebChannelList;
18
19
 
@@ -27,6 +28,7 @@ var WebChannelList = require('./v1/webChannel').WebChannelList;
27
28
  * @property {Twilio.FlexApi.V1.ConfigurationList} configuration -
28
29
  * configuration resource
29
30
  * @property {Twilio.FlexApi.V1.FlexFlowList} flexFlow - flexFlow resource
31
+ * @property {Twilio.FlexApi.V1.InteractionList} interaction - interaction resource
30
32
  * @property {Twilio.FlexApi.V1.WebChannelList} webChannel - webChannel resource
31
33
  *
32
34
  * @param {Twilio.FlexApi} domain - The twilio domain
@@ -39,6 +41,7 @@ function V1(domain) {
39
41
  this._channel = undefined;
40
42
  this._configuration = undefined;
41
43
  this._flexFlow = undefined;
44
+ this._interaction = undefined;
42
45
  this._webChannel = undefined;
43
46
  }
44
47
 
@@ -69,6 +72,14 @@ Object.defineProperty(V1.prototype,
69
72
  }
70
73
  });
71
74
 
75
+ Object.defineProperty(V1.prototype,
76
+ 'interaction', {
77
+ get: function() {
78
+ this._interaction = this._interaction || new InteractionList(this);
79
+ return this._interaction;
80
+ }
81
+ });
82
+
72
83
  Object.defineProperty(V1.prototype,
73
84
  'webChannel', {
74
85
  get: function() {
@@ -51,6 +51,7 @@ interface ConfigurationResource {
51
51
  attributes: object;
52
52
  call_recording_enabled: boolean;
53
53
  call_recording_webhook_url: string;
54
+ channel_configs: object[];
54
55
  chat_service_instance_sid: string;
55
56
  crm_attributes: object;
56
57
  crm_callback_url: string;
@@ -149,6 +150,7 @@ declare class ConfigurationInstance extends SerializableClass {
149
150
  attributes: any;
150
151
  callRecordingEnabled: boolean;
151
152
  callRecordingWebhookUrl: string;
153
+ channelConfigs: object[];
152
154
  chatServiceInstanceSid: string;
153
155
  /**
154
156
  * create a ConfigurationInstance
@@ -214,6 +214,8 @@ ConfigurationPage.prototype[util.inspect.custom] = function inspect(depth,
214
214
  * @property {boolean} flexInsightsDrilldown -
215
215
  * Setting to enable Flex UI redirection
216
216
  * @property {string} flexUrl - URL to redirect to in case drilldown is enabled.
217
+ * @property {object} channelConfigs -
218
+ * Flex Conversations channels' attachments configurations
217
219
  *
218
220
  * @param {V1} version - Version of the resource
219
221
  * @param {ConfigurationPayload} payload - The instance payload
@@ -265,6 +267,7 @@ ConfigurationInstance = function ConfigurationInstance(version, payload) {
265
267
  this.flexInsightsHr = payload.flex_insights_hr; // jshint ignore:line
266
268
  this.flexInsightsDrilldown = payload.flex_insights_drilldown; // jshint ignore:line
267
269
  this.flexUrl = payload.flex_url; // jshint ignore:line
270
+ this.channelConfigs = payload.channel_configs; // jshint ignore:line
268
271
 
269
272
  // Context
270
273
  this._context = undefined;