twilio 3.83.0 → 3.83.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.
- package/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts +107 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessage.js +259 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts +153 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js +407 -0
- package/lib/rest/api/v2010/account/call.d.ts +14 -0
- package/lib/rest/api/v2010/account/call.js +67 -0
- package/lib/rest/api/v2010/account/message.d.ts +4 -0
- package/lib/rest/api/v2010/account/message.js +7 -1
- package/lib/rest/proxy/v1/service/session/participant.d.ts +0 -2
- package/lib/rest/proxy/v1/service/session/participant.js +1 -6
- package/lib/rest/proxy/v1/service/session.d.ts +0 -4
- package/lib/rest/proxy/v1/service/session.js +2 -10
- package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +6 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.js +7 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts +6 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue.js +4 -0
- package/lib/rest/taskrouter/v1/workspace/worker.d.ts +6 -0
- package/lib/rest/taskrouter/v1/workspace/worker.js +4 -0
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verification.js +2 -1
- package/lib/rest/verify/v2/template.js +1 -1
- package/lib/twiml/VoiceResponse.d.ts +4 -0
- package/lib/twiml/VoiceResponse.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,407 @@
|
|
|
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 UserDefinedMessageSubscriptionList;
|
|
21
|
+
var UserDefinedMessageSubscriptionPage;
|
|
22
|
+
var UserDefinedMessageSubscriptionInstance;
|
|
23
|
+
var UserDefinedMessageSubscriptionContext;
|
|
24
|
+
|
|
25
|
+
/* jshint ignore:start */
|
|
26
|
+
/**
|
|
27
|
+
* Initialize the UserDefinedMessageSubscriptionList
|
|
28
|
+
*
|
|
29
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList
|
|
30
|
+
*
|
|
31
|
+
* @param {Twilio.Api.V2010} version - Version of the resource
|
|
32
|
+
* @param {string} accountSid - Account Sid.
|
|
33
|
+
* @param {string} callSid - Call Sid.
|
|
34
|
+
*/
|
|
35
|
+
/* jshint ignore:end */
|
|
36
|
+
UserDefinedMessageSubscriptionList = function
|
|
37
|
+
UserDefinedMessageSubscriptionList(version, accountSid, callSid) {
|
|
38
|
+
/* jshint ignore:start */
|
|
39
|
+
/**
|
|
40
|
+
* @function userDefinedMessageSubscriptions
|
|
41
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext#
|
|
42
|
+
*
|
|
43
|
+
* @param {string} sid - sid of instance
|
|
44
|
+
*
|
|
45
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext}
|
|
46
|
+
*/
|
|
47
|
+
/* jshint ignore:end */
|
|
48
|
+
function UserDefinedMessageSubscriptionListInstance(sid) {
|
|
49
|
+
return UserDefinedMessageSubscriptionListInstance.get(sid);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
UserDefinedMessageSubscriptionListInstance._version = version;
|
|
53
|
+
// Path Solution
|
|
54
|
+
UserDefinedMessageSubscriptionListInstance._solution = {accountSid: accountSid, callSid: callSid};
|
|
55
|
+
UserDefinedMessageSubscriptionListInstance._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessageSubscriptions.json`;
|
|
56
|
+
/* jshint ignore:start */
|
|
57
|
+
/**
|
|
58
|
+
* create a UserDefinedMessageSubscriptionInstance
|
|
59
|
+
*
|
|
60
|
+
* @function create
|
|
61
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList#
|
|
62
|
+
*
|
|
63
|
+
* @param {object} opts - Options for request
|
|
64
|
+
* @param {string} opts.callback -
|
|
65
|
+
* The URL we should call to send user defined messages.
|
|
66
|
+
* @param {string} opts.method - HTTP method used with the callback.
|
|
67
|
+
* @param {string} [opts.idempotencyKey] -
|
|
68
|
+
* A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
|
|
69
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
70
|
+
*
|
|
71
|
+
* @returns {Promise} Resolves to processed UserDefinedMessageSubscriptionInstance
|
|
72
|
+
*/
|
|
73
|
+
/* jshint ignore:end */
|
|
74
|
+
UserDefinedMessageSubscriptionListInstance.create = function create(opts,
|
|
75
|
+
callback) {
|
|
76
|
+
if (_.isUndefined(opts)) {
|
|
77
|
+
throw new Error('Required parameter "opts" missing.');
|
|
78
|
+
}
|
|
79
|
+
if (_.isUndefined(opts['callback'])) {
|
|
80
|
+
throw new Error('Required parameter "opts[\'callback\']" missing.');
|
|
81
|
+
}
|
|
82
|
+
if (_.isUndefined(opts['method'])) {
|
|
83
|
+
throw new Error('Required parameter "opts[\'method\']" missing.');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var deferred = Q.defer();
|
|
87
|
+
var data = values.of({
|
|
88
|
+
'Callback': _.get(opts, 'callback'),
|
|
89
|
+
'Method': _.get(opts, 'method'),
|
|
90
|
+
'IdempotencyKey': _.get(opts, 'idempotencyKey')
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
94
|
+
|
|
95
|
+
promise = promise.then(function(payload) {
|
|
96
|
+
deferred.resolve(new UserDefinedMessageSubscriptionInstance(
|
|
97
|
+
this._version,
|
|
98
|
+
payload,
|
|
99
|
+
this._solution.accountSid,
|
|
100
|
+
this._solution.callSid,
|
|
101
|
+
this._solution.sid
|
|
102
|
+
));
|
|
103
|
+
}.bind(this));
|
|
104
|
+
|
|
105
|
+
promise.catch(function(error) {
|
|
106
|
+
deferred.reject(error);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
if (_.isFunction(callback)) {
|
|
110
|
+
deferred.promise.nodeify(callback);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return deferred.promise;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/* jshint ignore:start */
|
|
117
|
+
/**
|
|
118
|
+
* Constructs a user_defined_message_subscription
|
|
119
|
+
*
|
|
120
|
+
* @function get
|
|
121
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList#
|
|
122
|
+
*
|
|
123
|
+
* @param {string} sid - User Defined Message Subscription Sid
|
|
124
|
+
*
|
|
125
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext}
|
|
126
|
+
*/
|
|
127
|
+
/* jshint ignore:end */
|
|
128
|
+
UserDefinedMessageSubscriptionListInstance.get = function get(sid) {
|
|
129
|
+
return new UserDefinedMessageSubscriptionContext(
|
|
130
|
+
this._version,
|
|
131
|
+
this._solution.accountSid,
|
|
132
|
+
this._solution.callSid,
|
|
133
|
+
sid
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/* jshint ignore:start */
|
|
138
|
+
/**
|
|
139
|
+
* Provide a user-friendly representation
|
|
140
|
+
*
|
|
141
|
+
* @function toJSON
|
|
142
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList#
|
|
143
|
+
*
|
|
144
|
+
* @returns Object
|
|
145
|
+
*/
|
|
146
|
+
/* jshint ignore:end */
|
|
147
|
+
UserDefinedMessageSubscriptionListInstance.toJSON = function toJSON() {
|
|
148
|
+
return this._solution;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
UserDefinedMessageSubscriptionListInstance[util.inspect.custom] = function
|
|
152
|
+
inspect(depth, options) {
|
|
153
|
+
return util.inspect(this.toJSON(), options);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
return UserDefinedMessageSubscriptionListInstance;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/* jshint ignore:start */
|
|
161
|
+
/**
|
|
162
|
+
* Initialize the UserDefinedMessageSubscriptionPage
|
|
163
|
+
*
|
|
164
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionPage
|
|
165
|
+
*
|
|
166
|
+
* @param {V2010} version - Version of the resource
|
|
167
|
+
* @param {Response<string>} response - Response from the API
|
|
168
|
+
* @param {UserDefinedMessageSubscriptionSolution} solution - Path solution
|
|
169
|
+
*
|
|
170
|
+
* @returns UserDefinedMessageSubscriptionPage
|
|
171
|
+
*/
|
|
172
|
+
/* jshint ignore:end */
|
|
173
|
+
UserDefinedMessageSubscriptionPage = function
|
|
174
|
+
UserDefinedMessageSubscriptionPage(version, response, solution) {
|
|
175
|
+
// Path Solution
|
|
176
|
+
this._solution = solution;
|
|
177
|
+
|
|
178
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
_.extend(UserDefinedMessageSubscriptionPage.prototype, Page.prototype);
|
|
182
|
+
UserDefinedMessageSubscriptionPage.prototype.constructor = UserDefinedMessageSubscriptionPage;
|
|
183
|
+
|
|
184
|
+
/* jshint ignore:start */
|
|
185
|
+
/**
|
|
186
|
+
* Build an instance of UserDefinedMessageSubscriptionInstance
|
|
187
|
+
*
|
|
188
|
+
* @function getInstance
|
|
189
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionPage#
|
|
190
|
+
*
|
|
191
|
+
* @param {UserDefinedMessageSubscriptionPayload} payload -
|
|
192
|
+
* Payload response from the API
|
|
193
|
+
*
|
|
194
|
+
* @returns UserDefinedMessageSubscriptionInstance
|
|
195
|
+
*/
|
|
196
|
+
/* jshint ignore:end */
|
|
197
|
+
UserDefinedMessageSubscriptionPage.prototype.getInstance = function
|
|
198
|
+
getInstance(payload) {
|
|
199
|
+
return new UserDefinedMessageSubscriptionInstance(
|
|
200
|
+
this._version,
|
|
201
|
+
payload,
|
|
202
|
+
this._solution.accountSid,
|
|
203
|
+
this._solution.callSid
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/* jshint ignore:start */
|
|
208
|
+
/**
|
|
209
|
+
* Provide a user-friendly representation
|
|
210
|
+
*
|
|
211
|
+
* @function toJSON
|
|
212
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionPage#
|
|
213
|
+
*
|
|
214
|
+
* @returns Object
|
|
215
|
+
*/
|
|
216
|
+
/* jshint ignore:end */
|
|
217
|
+
UserDefinedMessageSubscriptionPage.prototype.toJSON = function toJSON() {
|
|
218
|
+
let clone = {};
|
|
219
|
+
_.forOwn(this, function(value, key) {
|
|
220
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
221
|
+
clone[key] = value;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
return clone;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
UserDefinedMessageSubscriptionPage.prototype[util.inspect.custom] = function
|
|
228
|
+
inspect(depth, options) {
|
|
229
|
+
return util.inspect(this.toJSON(), options);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
/* jshint ignore:start */
|
|
234
|
+
/**
|
|
235
|
+
* Initialize the UserDefinedMessageSubscriptionContext
|
|
236
|
+
*
|
|
237
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionInstance
|
|
238
|
+
*
|
|
239
|
+
* @property {string} accountSid - Account Sid.
|
|
240
|
+
* @property {string} callSid - Call Sid.
|
|
241
|
+
* @property {string} sid - User Defined Message Subscription Sid
|
|
242
|
+
* @property {Date} dateCreated -
|
|
243
|
+
* The date this User Defined Message Subscription was created
|
|
244
|
+
* @property {string} uri -
|
|
245
|
+
* The URI of the resource, relative to `https://api.twilio.com`.
|
|
246
|
+
*
|
|
247
|
+
* @param {V2010} version - Version of the resource
|
|
248
|
+
* @param {UserDefinedMessageSubscriptionPayload} payload - The instance payload
|
|
249
|
+
* @param {sid} accountSid - Account Sid.
|
|
250
|
+
* @param {sid} callSid - Call Sid.
|
|
251
|
+
* @param {sid} sid - User Defined Message Subscription Sid
|
|
252
|
+
*/
|
|
253
|
+
/* jshint ignore:end */
|
|
254
|
+
UserDefinedMessageSubscriptionInstance = function
|
|
255
|
+
UserDefinedMessageSubscriptionInstance(version, payload, accountSid,
|
|
256
|
+
callSid, sid) {
|
|
257
|
+
this._version = version;
|
|
258
|
+
|
|
259
|
+
// Marshaled Properties
|
|
260
|
+
this.accountSid = payload.account_sid; // jshint ignore:line
|
|
261
|
+
this.callSid = payload.call_sid; // jshint ignore:line
|
|
262
|
+
this.sid = payload.sid; // jshint ignore:line
|
|
263
|
+
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); // jshint ignore:line
|
|
264
|
+
this.uri = payload.uri; // jshint ignore:line
|
|
265
|
+
|
|
266
|
+
// Context
|
|
267
|
+
this._context = undefined;
|
|
268
|
+
this._solution = {accountSid: accountSid, callSid: callSid, sid: sid || this.sid, };
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
Object.defineProperty(UserDefinedMessageSubscriptionInstance.prototype,
|
|
272
|
+
'_proxy', {
|
|
273
|
+
get: function() {
|
|
274
|
+
if (!this._context) {
|
|
275
|
+
this._context = new UserDefinedMessageSubscriptionContext(
|
|
276
|
+
this._version,
|
|
277
|
+
this._solution.accountSid,
|
|
278
|
+
this._solution.callSid,
|
|
279
|
+
this._solution.sid
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return this._context;
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
/* jshint ignore:start */
|
|
288
|
+
/**
|
|
289
|
+
* remove a UserDefinedMessageSubscriptionInstance
|
|
290
|
+
*
|
|
291
|
+
* @function remove
|
|
292
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionInstance#
|
|
293
|
+
*
|
|
294
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
295
|
+
*
|
|
296
|
+
* @returns {Promise} Resolves to processed UserDefinedMessageSubscriptionInstance
|
|
297
|
+
*/
|
|
298
|
+
/* jshint ignore:end */
|
|
299
|
+
UserDefinedMessageSubscriptionInstance.prototype.remove = function
|
|
300
|
+
remove(callback) {
|
|
301
|
+
return this._proxy.remove(callback);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/* jshint ignore:start */
|
|
305
|
+
/**
|
|
306
|
+
* Provide a user-friendly representation
|
|
307
|
+
*
|
|
308
|
+
* @function toJSON
|
|
309
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionInstance#
|
|
310
|
+
*
|
|
311
|
+
* @returns Object
|
|
312
|
+
*/
|
|
313
|
+
/* jshint ignore:end */
|
|
314
|
+
UserDefinedMessageSubscriptionInstance.prototype.toJSON = function toJSON() {
|
|
315
|
+
let clone = {};
|
|
316
|
+
_.forOwn(this, function(value, key) {
|
|
317
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
318
|
+
clone[key] = value;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
return clone;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
UserDefinedMessageSubscriptionInstance.prototype[util.inspect.custom] = function
|
|
325
|
+
inspect(depth, options) {
|
|
326
|
+
return util.inspect(this.toJSON(), options);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
/* jshint ignore:start */
|
|
331
|
+
/**
|
|
332
|
+
* Initialize the UserDefinedMessageSubscriptionContext
|
|
333
|
+
*
|
|
334
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext
|
|
335
|
+
*
|
|
336
|
+
* @param {V2010} version - Version of the resource
|
|
337
|
+
* @param {sid} accountSid - Account Sid.
|
|
338
|
+
* @param {sid} callSid - Call Sid.
|
|
339
|
+
* @param {sid} sid - User Defined Message Subscription Sid
|
|
340
|
+
*/
|
|
341
|
+
/* jshint ignore:end */
|
|
342
|
+
UserDefinedMessageSubscriptionContext = function
|
|
343
|
+
UserDefinedMessageSubscriptionContext(version, accountSid, callSid, sid) {
|
|
344
|
+
this._version = version;
|
|
345
|
+
|
|
346
|
+
// Path Solution
|
|
347
|
+
this._solution = {accountSid: accountSid, callSid: callSid, sid: sid, };
|
|
348
|
+
this._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessageSubscriptions/${sid}.json`;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/* jshint ignore:start */
|
|
352
|
+
/**
|
|
353
|
+
* remove a UserDefinedMessageSubscriptionInstance
|
|
354
|
+
*
|
|
355
|
+
* @function remove
|
|
356
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext#
|
|
357
|
+
*
|
|
358
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
359
|
+
*
|
|
360
|
+
* @returns {Promise} Resolves to processed UserDefinedMessageSubscriptionInstance
|
|
361
|
+
*/
|
|
362
|
+
/* jshint ignore:end */
|
|
363
|
+
UserDefinedMessageSubscriptionContext.prototype.remove = function
|
|
364
|
+
remove(callback) {
|
|
365
|
+
var deferred = Q.defer();
|
|
366
|
+
var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
|
|
367
|
+
|
|
368
|
+
promise = promise.then(function(payload) {
|
|
369
|
+
deferred.resolve(payload);
|
|
370
|
+
}.bind(this));
|
|
371
|
+
|
|
372
|
+
promise.catch(function(error) {
|
|
373
|
+
deferred.reject(error);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
if (_.isFunction(callback)) {
|
|
377
|
+
deferred.promise.nodeify(callback);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return deferred.promise;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
/* jshint ignore:start */
|
|
384
|
+
/**
|
|
385
|
+
* Provide a user-friendly representation
|
|
386
|
+
*
|
|
387
|
+
* @function toJSON
|
|
388
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext#
|
|
389
|
+
*
|
|
390
|
+
* @returns Object
|
|
391
|
+
*/
|
|
392
|
+
/* jshint ignore:end */
|
|
393
|
+
UserDefinedMessageSubscriptionContext.prototype.toJSON = function toJSON() {
|
|
394
|
+
return this._solution;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
UserDefinedMessageSubscriptionContext.prototype[util.inspect.custom] = function
|
|
398
|
+
inspect(depth, options) {
|
|
399
|
+
return util.inspect(this.toJSON(), options);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
module.exports = {
|
|
403
|
+
UserDefinedMessageSubscriptionList: UserDefinedMessageSubscriptionList,
|
|
404
|
+
UserDefinedMessageSubscriptionPage: UserDefinedMessageSubscriptionPage,
|
|
405
|
+
UserDefinedMessageSubscriptionInstance: UserDefinedMessageSubscriptionInstance,
|
|
406
|
+
UserDefinedMessageSubscriptionContext: UserDefinedMessageSubscriptionContext
|
|
407
|
+
};
|
|
@@ -24,6 +24,10 @@ import { SiprecList } from './call/siprec';
|
|
|
24
24
|
import { SiprecListInstance } from './call/siprec';
|
|
25
25
|
import { StreamList } from './call/stream';
|
|
26
26
|
import { StreamListInstance } from './call/stream';
|
|
27
|
+
import { UserDefinedMessageList } from './call/userDefinedMessage';
|
|
28
|
+
import { UserDefinedMessageListInstance } from './call/userDefinedMessage';
|
|
29
|
+
import { UserDefinedMessageSubscriptionList } from './call/userDefinedMessageSubscription';
|
|
30
|
+
import { UserDefinedMessageSubscriptionListInstance } from './call/userDefinedMessageSubscription';
|
|
27
31
|
|
|
28
32
|
type CallEvent = 'initiated'|'ringing'|'answered'|'completed';
|
|
29
33
|
|
|
@@ -462,6 +466,8 @@ declare class CallContext {
|
|
|
462
466
|
* @param callback - Callback to handle processed record
|
|
463
467
|
*/
|
|
464
468
|
update(opts?: CallInstanceUpdateOptions, callback?: (error: Error | null, items: CallInstance) => any): Promise<CallInstance>;
|
|
469
|
+
userDefinedMessageSubscriptions: UserDefinedMessageSubscriptionListInstance;
|
|
470
|
+
userDefinedMessages: UserDefinedMessageListInstance;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
|
|
@@ -560,6 +566,14 @@ declare class CallInstance extends SerializableClass {
|
|
|
560
566
|
*/
|
|
561
567
|
update(opts?: CallInstanceUpdateOptions, callback?: (error: Error | null, items: CallInstance) => any): Promise<CallInstance>;
|
|
562
568
|
uri: string;
|
|
569
|
+
/**
|
|
570
|
+
* Access the userDefinedMessageSubscriptions
|
|
571
|
+
*/
|
|
572
|
+
userDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionListInstance;
|
|
573
|
+
/**
|
|
574
|
+
* Access the userDefinedMessages
|
|
575
|
+
*/
|
|
576
|
+
userDefinedMessages(): UserDefinedMessageListInstance;
|
|
563
577
|
}
|
|
564
578
|
|
|
565
579
|
|
|
@@ -21,6 +21,10 @@ var PaymentList = require('./call/payment').PaymentList;
|
|
|
21
21
|
var RecordingList = require('./call/recording').RecordingList;
|
|
22
22
|
var SiprecList = require('./call/siprec').SiprecList;
|
|
23
23
|
var StreamList = require('./call/stream').StreamList;
|
|
24
|
+
var UserDefinedMessageList = require(
|
|
25
|
+
'./call/userDefinedMessage').UserDefinedMessageList;
|
|
26
|
+
var UserDefinedMessageSubscriptionList = require(
|
|
27
|
+
'./call/userDefinedMessageSubscription').UserDefinedMessageSubscriptionList;
|
|
24
28
|
var deserialize = require(
|
|
25
29
|
'../../../../base/deserialize'); /* jshint ignore:line */
|
|
26
30
|
var serialize = require('../../../../base/serialize'); /* jshint ignore:line */
|
|
@@ -881,6 +885,35 @@ CallInstance.prototype.streams = function streams() {
|
|
|
881
885
|
return this._proxy.streams;
|
|
882
886
|
};
|
|
883
887
|
|
|
888
|
+
/* jshint ignore:start */
|
|
889
|
+
/**
|
|
890
|
+
* Access the userDefinedMessageSubscriptions
|
|
891
|
+
*
|
|
892
|
+
* @function userDefinedMessageSubscriptions
|
|
893
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallInstance#
|
|
894
|
+
*
|
|
895
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList}
|
|
896
|
+
*/
|
|
897
|
+
/* jshint ignore:end */
|
|
898
|
+
CallInstance.prototype.userDefinedMessageSubscriptions = function
|
|
899
|
+
userDefinedMessageSubscriptions() {
|
|
900
|
+
return this._proxy.userDefinedMessageSubscriptions;
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
/* jshint ignore:start */
|
|
904
|
+
/**
|
|
905
|
+
* Access the userDefinedMessages
|
|
906
|
+
*
|
|
907
|
+
* @function userDefinedMessages
|
|
908
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallInstance#
|
|
909
|
+
*
|
|
910
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList}
|
|
911
|
+
*/
|
|
912
|
+
/* jshint ignore:end */
|
|
913
|
+
CallInstance.prototype.userDefinedMessages = function userDefinedMessages() {
|
|
914
|
+
return this._proxy.userDefinedMessages;
|
|
915
|
+
};
|
|
916
|
+
|
|
884
917
|
/* jshint ignore:start */
|
|
885
918
|
/**
|
|
886
919
|
* Provide a user-friendly representation
|
|
@@ -926,6 +959,10 @@ CallInstance.prototype[util.inspect.custom] = function inspect(depth, options) {
|
|
|
926
959
|
* siprec resource
|
|
927
960
|
* @property {Twilio.Api.V2010.AccountContext.CallContext.StreamList} streams -
|
|
928
961
|
* streams resource
|
|
962
|
+
* @property {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList} userDefinedMessageSubscriptions -
|
|
963
|
+
* userDefinedMessageSubscriptions resource
|
|
964
|
+
* @property {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList} userDefinedMessages -
|
|
965
|
+
* userDefinedMessages resource
|
|
929
966
|
*
|
|
930
967
|
* @param {V2010} version - Version of the resource
|
|
931
968
|
* @param {sid} accountSid -
|
|
@@ -948,6 +985,8 @@ CallContext = function CallContext(version, accountSid, sid) {
|
|
|
948
985
|
this._payments = undefined;
|
|
949
986
|
this._siprec = undefined;
|
|
950
987
|
this._streams = undefined;
|
|
988
|
+
this._userDefinedMessageSubscriptions = undefined;
|
|
989
|
+
this._userDefinedMessages = undefined;
|
|
951
990
|
};
|
|
952
991
|
|
|
953
992
|
/* jshint ignore:start */
|
|
@@ -1158,6 +1197,34 @@ Object.defineProperty(CallContext.prototype,
|
|
|
1158
1197
|
}
|
|
1159
1198
|
});
|
|
1160
1199
|
|
|
1200
|
+
Object.defineProperty(CallContext.prototype,
|
|
1201
|
+
'userDefinedMessageSubscriptions', {
|
|
1202
|
+
get: function() {
|
|
1203
|
+
if (!this._userDefinedMessageSubscriptions) {
|
|
1204
|
+
this._userDefinedMessageSubscriptions = new UserDefinedMessageSubscriptionList(
|
|
1205
|
+
this._version,
|
|
1206
|
+
this._solution.accountSid,
|
|
1207
|
+
this._solution.sid
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
return this._userDefinedMessageSubscriptions;
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
|
|
1214
|
+
Object.defineProperty(CallContext.prototype,
|
|
1215
|
+
'userDefinedMessages', {
|
|
1216
|
+
get: function() {
|
|
1217
|
+
if (!this._userDefinedMessages) {
|
|
1218
|
+
this._userDefinedMessages = new UserDefinedMessageList(
|
|
1219
|
+
this._version,
|
|
1220
|
+
this._solution.accountSid,
|
|
1221
|
+
this._solution.sid
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
return this._userDefinedMessages;
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1161
1228
|
/* jshint ignore:start */
|
|
1162
1229
|
/**
|
|
1163
1230
|
* Provide a user-friendly representation
|
|
@@ -175,6 +175,8 @@ interface MessageListInstance {
|
|
|
175
175
|
* @property attempt - Total numer of attempts made , this inclusive to send out the message
|
|
176
176
|
* @property body - The text of the message you want to send. Can be up to 1,600 characters in length.
|
|
177
177
|
* @property contentRetention - Determines if the message content can be stored or redacted based on privacy settings
|
|
178
|
+
* @property contentSid - The SID of the preconfigured Content object you want to associate with the message.
|
|
179
|
+
* @property contentVariables - Key-value pairs of variable names to substitution values, used alongside a content_sid.
|
|
178
180
|
* @property forceDelivery - Reserved
|
|
179
181
|
* @property from - The phone number that initiated the message
|
|
180
182
|
* @property maxPrice - The total maximum price up to 4 decimal places in US dollars acceptable for the message to be delivered.
|
|
@@ -197,6 +199,8 @@ interface MessageListInstanceCreateOptions {
|
|
|
197
199
|
attempt?: number;
|
|
198
200
|
body?: string;
|
|
199
201
|
contentRetention?: MessageContentRetention;
|
|
202
|
+
contentSid?: string;
|
|
203
|
+
contentVariables?: string;
|
|
200
204
|
forceDelivery?: boolean;
|
|
201
205
|
from?: string;
|
|
202
206
|
maxPrice?: number;
|
|
@@ -91,6 +91,10 @@ MessageList = function MessageList(version, accountSid) {
|
|
|
91
91
|
* The time that Twilio will send the message. Must be in ISO 8601 format.
|
|
92
92
|
* @param {boolean} [opts.sendAsMms] -
|
|
93
93
|
* If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.
|
|
94
|
+
* @param {string} [opts.contentSid] -
|
|
95
|
+
* The SID of the preconfigured Content object you want to associate with the message.
|
|
96
|
+
* @param {string} [opts.contentVariables] -
|
|
97
|
+
* Key-value pairs of variable names to substitution values, used alongside a content_sid.
|
|
94
98
|
* @param {string} [opts.from] - The phone number that initiated the message
|
|
95
99
|
* @param {string} [opts.messagingServiceSid] -
|
|
96
100
|
* The SID of the Messaging Service you want to associate with the message.
|
|
@@ -132,7 +136,9 @@ MessageList = function MessageList(version, accountSid) {
|
|
|
132
136
|
'ShortenUrls': serialize.bool(_.get(opts, 'shortenUrls')),
|
|
133
137
|
'ScheduleType': _.get(opts, 'scheduleType'),
|
|
134
138
|
'SendAt': serialize.iso8601DateTime(_.get(opts, 'sendAt')),
|
|
135
|
-
'SendAsMms': serialize.bool(_.get(opts, 'sendAsMms'))
|
|
139
|
+
'SendAsMms': serialize.bool(_.get(opts, 'sendAsMms')),
|
|
140
|
+
'ContentSid': _.get(opts, 'contentSid'),
|
|
141
|
+
'ContentVariables': _.get(opts, 'contentVariables')
|
|
136
142
|
});
|
|
137
143
|
|
|
138
144
|
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
@@ -147,14 +147,12 @@ interface ParticipantListInstance {
|
|
|
147
147
|
/**
|
|
148
148
|
* Options to pass to create
|
|
149
149
|
*
|
|
150
|
-
* @property failOnParticipantConflict - An experimental parameter to override the ProxyAllowParticipantConflict account flag on a per-request basis.
|
|
151
150
|
* @property friendlyName - The string that you assigned to describe the participant
|
|
152
151
|
* @property identifier - The phone number of the Participant
|
|
153
152
|
* @property proxyIdentifier - The proxy phone number to use for the Participant
|
|
154
153
|
* @property proxyIdentifierSid - The Proxy Identifier Sid
|
|
155
154
|
*/
|
|
156
155
|
interface ParticipantListInstanceCreateOptions {
|
|
157
|
-
failOnParticipantConflict?: boolean;
|
|
158
156
|
friendlyName?: string;
|
|
159
157
|
identifier: string;
|
|
160
158
|
proxyIdentifier?: string;
|
|
@@ -17,8 +17,6 @@ var MessageInteractionList = require(
|
|
|
17
17
|
var Page = require('../../../../../base/Page'); /* jshint ignore:line */
|
|
18
18
|
var deserialize = require(
|
|
19
19
|
'../../../../../base/deserialize'); /* jshint ignore:line */
|
|
20
|
-
var serialize = require(
|
|
21
|
-
'../../../../../base/serialize'); /* jshint ignore:line */
|
|
22
20
|
var values = require('../../../../../base/values'); /* jshint ignore:line */
|
|
23
21
|
|
|
24
22
|
var ParticipantList;
|
|
@@ -317,8 +315,6 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) {
|
|
|
317
315
|
* @param {string} [opts.proxyIdentifier] -
|
|
318
316
|
* The proxy phone number to use for the Participant
|
|
319
317
|
* @param {string} [opts.proxyIdentifierSid] - The Proxy Identifier Sid
|
|
320
|
-
* @param {boolean} [opts.failOnParticipantConflict] -
|
|
321
|
-
* An experimental parameter to override the ProxyAllowParticipantConflict account flag on a per-request basis.
|
|
322
318
|
* @param {function} [callback] - Callback to handle processed record
|
|
323
319
|
*
|
|
324
320
|
* @returns {Promise} Resolves to processed ParticipantInstance
|
|
@@ -337,8 +333,7 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) {
|
|
|
337
333
|
'Identifier': _.get(opts, 'identifier'),
|
|
338
334
|
'FriendlyName': _.get(opts, 'friendlyName'),
|
|
339
335
|
'ProxyIdentifier': _.get(opts, 'proxyIdentifier'),
|
|
340
|
-
'ProxyIdentifierSid': _.get(opts, 'proxyIdentifierSid')
|
|
341
|
-
'FailOnParticipantConflict': serialize.bool(_.get(opts, 'failOnParticipantConflict'))
|
|
336
|
+
'ProxyIdentifierSid': _.get(opts, 'proxyIdentifierSid')
|
|
342
337
|
});
|
|
343
338
|
|
|
344
339
|
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
@@ -33,13 +33,11 @@ declare function SessionList(version: V1, serviceSid: string): SessionListInstan
|
|
|
33
33
|
* Options to pass to update
|
|
34
34
|
*
|
|
35
35
|
* @property dateExpiry - The ISO 8601 date when the Session should expire
|
|
36
|
-
* @property failOnParticipantConflict - An experimental parameter to override the ProxyAllowParticipantConflict account flag on a per-request basis.
|
|
37
36
|
* @property status - The new status of the resource
|
|
38
37
|
* @property ttl - When the session will expire
|
|
39
38
|
*/
|
|
40
39
|
interface SessionInstanceUpdateOptions {
|
|
41
40
|
dateExpiry?: Date;
|
|
42
|
-
failOnParticipantConflict?: boolean;
|
|
43
41
|
status?: SessionStatus;
|
|
44
42
|
ttl?: number;
|
|
45
43
|
}
|
|
@@ -174,7 +172,6 @@ interface SessionListInstance {
|
|
|
174
172
|
* Options to pass to create
|
|
175
173
|
*
|
|
176
174
|
* @property dateExpiry - The ISO 8601 date when the Session should expire
|
|
177
|
-
* @property failOnParticipantConflict - An experimental parameter to override the ProxyAllowParticipantConflict account flag on a per-request basis.
|
|
178
175
|
* @property mode - The Mode of the Session
|
|
179
176
|
* @property participants - The Participant objects to include in the new session
|
|
180
177
|
* @property status - Session status
|
|
@@ -183,7 +180,6 @@ interface SessionListInstance {
|
|
|
183
180
|
*/
|
|
184
181
|
interface SessionListInstanceCreateOptions {
|
|
185
182
|
dateExpiry?: Date;
|
|
186
|
-
failOnParticipantConflict?: boolean;
|
|
187
183
|
mode?: SessionMode;
|
|
188
184
|
participants?: object | object[];
|
|
189
185
|
status?: SessionStatus;
|