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.
- package/README.md +6 -0
- package/lib/rest/FlexApi.d.ts +6 -0
- package/lib/rest/FlexApi.js +27 -0
- package/lib/rest/Messaging.d.ts +4 -0
- package/lib/rest/Messaging.js +18 -0
- package/lib/rest/Oauth.d.ts +2 -0
- package/lib/rest/Oauth.js +8 -0
- package/lib/rest/Preview.d.ts +0 -10
- package/lib/rest/Preview.js +0 -46
- package/lib/rest/api/v2010/account/address.d.ts +6 -0
- package/lib/rest/api/v2010/account/address.js +13 -2
- package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js +3 -6
- package/lib/rest/content/v1/content/approvalFetch.d.ts +139 -0
- package/lib/rest/content/v1/content/approvalFetch.js +328 -0
- package/lib/rest/content/v1/content.d.ts +7 -6
- package/lib/rest/content/v1/content.js +31 -31
- package/lib/rest/flexApi/V1.d.ts +3 -0
- package/lib/rest/flexApi/V1.js +11 -0
- package/lib/rest/flexApi/V2.d.ts +25 -0
- package/lib/rest/flexApi/V2.js +46 -0
- package/lib/rest/flexApi/v1/assessments.d.ts +113 -0
- package/lib/rest/flexApi/v1/assessments.js +300 -0
- package/lib/rest/flexApi/v1/goodData.d.ts +2 -2
- package/lib/rest/flexApi/v1/goodData.js +4 -4
- package/lib/rest/flexApi/v1/userRoles.js +1 -1
- package/lib/rest/flexApi/v2/webChannels.d.ts +101 -0
- package/lib/rest/flexApi/v2/webChannels.js +244 -0
- package/lib/rest/lookups/v2/phoneNumber.d.ts +22 -0
- package/lib/rest/lookups/v2/phoneNumber.js +43 -1
- package/lib/rest/messaging/V1.d.ts +6 -0
- package/lib/rest/messaging/V1.js +24 -0
- package/lib/rest/messaging/v1/domainCert.d.ts +178 -0
- package/lib/rest/messaging/v1/domainCert.js +447 -0
- package/lib/rest/messaging/v1/domainConfig.d.ts +172 -0
- package/lib/rest/messaging/v1/domainConfig.js +421 -0
- package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +1 -1
- package/lib/rest/messaging/v1/service/usAppToPerson.js +5 -2
- package/lib/rest/microvisor/v1/device.d.ts +2 -0
- package/lib/rest/microvisor/v1/device.js +2 -0
- package/lib/rest/oauth/V1.d.ts +3 -0
- package/lib/rest/oauth/V1.js +11 -0
- package/lib/rest/oauth/v1/deviceCode.d.ts +107 -0
- package/lib/rest/oauth/v1/deviceCode.js +258 -0
- package/lib/rest/oauth/v1/openidDiscovery.js +1 -1
- package/lib/rest/serverless/v1/service/build.d.ts +1 -1
- package/lib/rest/supersim/v1/settingsUpdate.d.ts +6 -0
- package/lib/rest/supersim/v1/settingsUpdate.js +7 -0
- package/lib/twiml/VoiceResponse.d.ts +7 -7
- package/lib/twiml/VoiceResponse.js +14 -14
- package/package.json +1 -1
- package/lib/rest/preview/TrustedComms.d.ts +0 -34
- package/lib/rest/preview/TrustedComms.js +0 -84
- package/lib/rest/preview/trusted_comms/brandedChannel/channel.d.ts +0 -120
- package/lib/rest/preview/trusted_comms/brandedChannel/channel.js +0 -257
- package/lib/rest/preview/trusted_comms/brandedChannel.d.ts +0 -150
- package/lib/rest/preview/trusted_comms/brandedChannel.js +0 -362
- package/lib/rest/preview/trusted_comms/brandsInformation.d.ts +0 -158
- package/lib/rest/preview/trusted_comms/brandsInformation.js +0 -338
- package/lib/rest/preview/trusted_comms/cps.d.ts +0 -156
- package/lib/rest/preview/trusted_comms/cps.js +0 -332
- package/lib/rest/preview/trusted_comms/currentCall.d.ts +0 -180
- package/lib/rest/preview/trusted_comms/currentCall.js +0 -367
|
@@ -0,0 +1,421 @@
|
|
|
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 serialize = require('../../../base/serialize'); /* jshint ignore:line */
|
|
19
|
+
var values = require('../../../base/values'); /* jshint ignore:line */
|
|
20
|
+
|
|
21
|
+
var DomainConfigList;
|
|
22
|
+
var DomainConfigPage;
|
|
23
|
+
var DomainConfigInstance;
|
|
24
|
+
var DomainConfigContext;
|
|
25
|
+
|
|
26
|
+
/* jshint ignore:start */
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the DomainConfigList
|
|
29
|
+
*
|
|
30
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
31
|
+
* Use them with caution.
|
|
32
|
+
*
|
|
33
|
+
* @constructor Twilio.Messaging.V1.DomainConfigList
|
|
34
|
+
*
|
|
35
|
+
* @param {Twilio.Messaging.V1} version - Version of the resource
|
|
36
|
+
*/
|
|
37
|
+
/* jshint ignore:end */
|
|
38
|
+
DomainConfigList = function DomainConfigList(version) {
|
|
39
|
+
/* jshint ignore:start */
|
|
40
|
+
/**
|
|
41
|
+
* @function domainConfig
|
|
42
|
+
* @memberof Twilio.Messaging.V1#
|
|
43
|
+
*
|
|
44
|
+
* @param {string} sid - sid of instance
|
|
45
|
+
*
|
|
46
|
+
* @returns {Twilio.Messaging.V1.DomainConfigContext}
|
|
47
|
+
*/
|
|
48
|
+
/* jshint ignore:end */
|
|
49
|
+
function DomainConfigListInstance(sid) {
|
|
50
|
+
return DomainConfigListInstance.get(sid);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
DomainConfigListInstance._version = version;
|
|
54
|
+
// Path Solution
|
|
55
|
+
DomainConfigListInstance._solution = {};
|
|
56
|
+
/* jshint ignore:start */
|
|
57
|
+
/**
|
|
58
|
+
* Constructs a domain_config
|
|
59
|
+
*
|
|
60
|
+
* @function get
|
|
61
|
+
* @memberof Twilio.Messaging.V1.DomainConfigList#
|
|
62
|
+
*
|
|
63
|
+
* @param {string} domainSid -
|
|
64
|
+
* Unique string used to identify the domain that this config should be associated with.
|
|
65
|
+
*
|
|
66
|
+
* @returns {Twilio.Messaging.V1.DomainConfigContext}
|
|
67
|
+
*/
|
|
68
|
+
/* jshint ignore:end */
|
|
69
|
+
DomainConfigListInstance.get = function get(domainSid) {
|
|
70
|
+
return new DomainConfigContext(this._version, domainSid);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/* jshint ignore:start */
|
|
74
|
+
/**
|
|
75
|
+
* Provide a user-friendly representation
|
|
76
|
+
*
|
|
77
|
+
* @function toJSON
|
|
78
|
+
* @memberof Twilio.Messaging.V1.DomainConfigList#
|
|
79
|
+
*
|
|
80
|
+
* @returns Object
|
|
81
|
+
*/
|
|
82
|
+
/* jshint ignore:end */
|
|
83
|
+
DomainConfigListInstance.toJSON = function toJSON() {
|
|
84
|
+
return this._solution;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
DomainConfigListInstance[util.inspect.custom] = function inspect(depth, options)
|
|
88
|
+
{
|
|
89
|
+
return util.inspect(this.toJSON(), options);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return DomainConfigListInstance;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/* jshint ignore:start */
|
|
97
|
+
/**
|
|
98
|
+
* Initialize the DomainConfigPage
|
|
99
|
+
*
|
|
100
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
101
|
+
* Use them with caution.
|
|
102
|
+
*
|
|
103
|
+
* @constructor Twilio.Messaging.V1.DomainConfigPage
|
|
104
|
+
*
|
|
105
|
+
* @param {V1} version - Version of the resource
|
|
106
|
+
* @param {Response<string>} response - Response from the API
|
|
107
|
+
* @param {DomainConfigSolution} solution - Path solution
|
|
108
|
+
*
|
|
109
|
+
* @returns DomainConfigPage
|
|
110
|
+
*/
|
|
111
|
+
/* jshint ignore:end */
|
|
112
|
+
DomainConfigPage = function DomainConfigPage(version, response, solution) {
|
|
113
|
+
// Path Solution
|
|
114
|
+
this._solution = solution;
|
|
115
|
+
|
|
116
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
_.extend(DomainConfigPage.prototype, Page.prototype);
|
|
120
|
+
DomainConfigPage.prototype.constructor = DomainConfigPage;
|
|
121
|
+
|
|
122
|
+
/* jshint ignore:start */
|
|
123
|
+
/**
|
|
124
|
+
* Build an instance of DomainConfigInstance
|
|
125
|
+
*
|
|
126
|
+
* @function getInstance
|
|
127
|
+
* @memberof Twilio.Messaging.V1.DomainConfigPage#
|
|
128
|
+
*
|
|
129
|
+
* @param {DomainConfigPayload} payload - Payload response from the API
|
|
130
|
+
*
|
|
131
|
+
* @returns DomainConfigInstance
|
|
132
|
+
*/
|
|
133
|
+
/* jshint ignore:end */
|
|
134
|
+
DomainConfigPage.prototype.getInstance = function getInstance(payload) {
|
|
135
|
+
return new DomainConfigInstance(this._version, payload);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/* jshint ignore:start */
|
|
139
|
+
/**
|
|
140
|
+
* Provide a user-friendly representation
|
|
141
|
+
*
|
|
142
|
+
* @function toJSON
|
|
143
|
+
* @memberof Twilio.Messaging.V1.DomainConfigPage#
|
|
144
|
+
*
|
|
145
|
+
* @returns Object
|
|
146
|
+
*/
|
|
147
|
+
/* jshint ignore:end */
|
|
148
|
+
DomainConfigPage.prototype.toJSON = function toJSON() {
|
|
149
|
+
let clone = {};
|
|
150
|
+
_.forOwn(this, function(value, key) {
|
|
151
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
152
|
+
clone[key] = value;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
return clone;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
DomainConfigPage.prototype[util.inspect.custom] = function inspect(depth,
|
|
159
|
+
options) {
|
|
160
|
+
return util.inspect(this.toJSON(), options);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
/* jshint ignore:start */
|
|
165
|
+
/**
|
|
166
|
+
* Initialize the DomainConfigContext
|
|
167
|
+
*
|
|
168
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
169
|
+
* Use them with caution.
|
|
170
|
+
*
|
|
171
|
+
* @constructor Twilio.Messaging.V1.DomainConfigInstance
|
|
172
|
+
*
|
|
173
|
+
* @property {string} domainSid -
|
|
174
|
+
* The unique string that we created to identify the Domain resource.
|
|
175
|
+
* @property {string} configSid -
|
|
176
|
+
* The unique string that we created to identify the Domain config (prefix ZK).
|
|
177
|
+
* @property {string} messagingServiceSids -
|
|
178
|
+
* A list of messagingServiceSids (with prefix MG).
|
|
179
|
+
* @property {string} fallbackUrl -
|
|
180
|
+
* We will redirect requests to urls we are unable to identify to this url.
|
|
181
|
+
* @property {string} callbackUrl -
|
|
182
|
+
* URL to receive click events to your webhook whenever the recipients click on the shortened links.
|
|
183
|
+
* @property {Date} dateCreated - Date this Domain Config was created.
|
|
184
|
+
* @property {Date} dateUpdated - Date that this Domain Config was last updated.
|
|
185
|
+
* @property {string} url - The url
|
|
186
|
+
*
|
|
187
|
+
* @param {V1} version - Version of the resource
|
|
188
|
+
* @param {DomainConfigPayload} payload - The instance payload
|
|
189
|
+
* @param {sid} domainSid -
|
|
190
|
+
* Unique string used to identify the domain that this config should be associated with.
|
|
191
|
+
*/
|
|
192
|
+
/* jshint ignore:end */
|
|
193
|
+
DomainConfigInstance = function DomainConfigInstance(version, payload,
|
|
194
|
+
domainSid) {
|
|
195
|
+
this._version = version;
|
|
196
|
+
|
|
197
|
+
// Marshaled Properties
|
|
198
|
+
this.domainSid = payload.domain_sid; // jshint ignore:line
|
|
199
|
+
this.configSid = payload.config_sid; // jshint ignore:line
|
|
200
|
+
this.messagingServiceSids = payload.messaging_service_sids; // jshint ignore:line
|
|
201
|
+
this.fallbackUrl = payload.fallback_url; // jshint ignore:line
|
|
202
|
+
this.callbackUrl = payload.callback_url; // jshint ignore:line
|
|
203
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
|
|
204
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
|
|
205
|
+
this.url = payload.url; // jshint ignore:line
|
|
206
|
+
|
|
207
|
+
// Context
|
|
208
|
+
this._context = undefined;
|
|
209
|
+
this._solution = {domainSid: domainSid || this.domainSid, };
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
Object.defineProperty(DomainConfigInstance.prototype,
|
|
213
|
+
'_proxy', {
|
|
214
|
+
get: function() {
|
|
215
|
+
if (!this._context) {
|
|
216
|
+
this._context = new DomainConfigContext(this._version, this._solution.domainSid);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return this._context;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
/* jshint ignore:start */
|
|
224
|
+
/**
|
|
225
|
+
* update a DomainConfigInstance
|
|
226
|
+
*
|
|
227
|
+
* @function update
|
|
228
|
+
* @memberof Twilio.Messaging.V1.DomainConfigInstance#
|
|
229
|
+
*
|
|
230
|
+
* @param {object} opts - Options for request
|
|
231
|
+
* @param {string|list} opts.messagingServiceSids -
|
|
232
|
+
* A list of messagingServiceSids (with prefix MG)
|
|
233
|
+
* @param {string} [opts.fallbackUrl] -
|
|
234
|
+
* We will redirect requests to urls we are unable to identify to this url.
|
|
235
|
+
* @param {string} [opts.callbackUrl] -
|
|
236
|
+
* URL to receive click events to your webhook whenever the recipients click on the shortened links
|
|
237
|
+
* @param {string} [opts.messagingServiceSidsAction] -
|
|
238
|
+
* An action type for messaging_service_sids operation (ADD, DELETE, REPLACE)
|
|
239
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
240
|
+
*
|
|
241
|
+
* @returns {Promise} Resolves to processed DomainConfigInstance
|
|
242
|
+
*/
|
|
243
|
+
/* jshint ignore:end */
|
|
244
|
+
DomainConfigInstance.prototype.update = function update(opts, callback) {
|
|
245
|
+
return this._proxy.update(opts, callback);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/* jshint ignore:start */
|
|
249
|
+
/**
|
|
250
|
+
* fetch a DomainConfigInstance
|
|
251
|
+
*
|
|
252
|
+
* @function fetch
|
|
253
|
+
* @memberof Twilio.Messaging.V1.DomainConfigInstance#
|
|
254
|
+
*
|
|
255
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
256
|
+
*
|
|
257
|
+
* @returns {Promise} Resolves to processed DomainConfigInstance
|
|
258
|
+
*/
|
|
259
|
+
/* jshint ignore:end */
|
|
260
|
+
DomainConfigInstance.prototype.fetch = function fetch(callback) {
|
|
261
|
+
return this._proxy.fetch(callback);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/* jshint ignore:start */
|
|
265
|
+
/**
|
|
266
|
+
* Provide a user-friendly representation
|
|
267
|
+
*
|
|
268
|
+
* @function toJSON
|
|
269
|
+
* @memberof Twilio.Messaging.V1.DomainConfigInstance#
|
|
270
|
+
*
|
|
271
|
+
* @returns Object
|
|
272
|
+
*/
|
|
273
|
+
/* jshint ignore:end */
|
|
274
|
+
DomainConfigInstance.prototype.toJSON = function toJSON() {
|
|
275
|
+
let clone = {};
|
|
276
|
+
_.forOwn(this, function(value, key) {
|
|
277
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
278
|
+
clone[key] = value;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
return clone;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
DomainConfigInstance.prototype[util.inspect.custom] = function inspect(depth,
|
|
285
|
+
options) {
|
|
286
|
+
return util.inspect(this.toJSON(), options);
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
/* jshint ignore:start */
|
|
291
|
+
/**
|
|
292
|
+
* Initialize the DomainConfigContext
|
|
293
|
+
*
|
|
294
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
295
|
+
* Use them with caution.
|
|
296
|
+
*
|
|
297
|
+
* @constructor Twilio.Messaging.V1.DomainConfigContext
|
|
298
|
+
*
|
|
299
|
+
* @param {V1} version - Version of the resource
|
|
300
|
+
* @param {sid} domainSid -
|
|
301
|
+
* Unique string used to identify the domain that this config should be associated with.
|
|
302
|
+
*/
|
|
303
|
+
/* jshint ignore:end */
|
|
304
|
+
DomainConfigContext = function DomainConfigContext(version, domainSid) {
|
|
305
|
+
this._version = version;
|
|
306
|
+
|
|
307
|
+
// Path Solution
|
|
308
|
+
this._solution = {domainSid: domainSid, };
|
|
309
|
+
this._uri = `/LinkShortening/Domains/${domainSid}/Config`;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
/* jshint ignore:start */
|
|
313
|
+
/**
|
|
314
|
+
* update a DomainConfigInstance
|
|
315
|
+
*
|
|
316
|
+
* @function update
|
|
317
|
+
* @memberof Twilio.Messaging.V1.DomainConfigContext#
|
|
318
|
+
*
|
|
319
|
+
* @param {object} opts - Options for request
|
|
320
|
+
* @param {string|list} opts.messagingServiceSids -
|
|
321
|
+
* A list of messagingServiceSids (with prefix MG)
|
|
322
|
+
* @param {string} [opts.fallbackUrl] -
|
|
323
|
+
* We will redirect requests to urls we are unable to identify to this url.
|
|
324
|
+
* @param {string} [opts.callbackUrl] -
|
|
325
|
+
* URL to receive click events to your webhook whenever the recipients click on the shortened links
|
|
326
|
+
* @param {string} [opts.messagingServiceSidsAction] -
|
|
327
|
+
* An action type for messaging_service_sids operation (ADD, DELETE, REPLACE)
|
|
328
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
329
|
+
*
|
|
330
|
+
* @returns {Promise} Resolves to processed DomainConfigInstance
|
|
331
|
+
*/
|
|
332
|
+
/* jshint ignore:end */
|
|
333
|
+
DomainConfigContext.prototype.update = function update(opts, callback) {
|
|
334
|
+
if (_.isUndefined(opts)) {
|
|
335
|
+
throw new Error('Required parameter "opts" missing.');
|
|
336
|
+
}
|
|
337
|
+
if (_.isUndefined(opts['messagingServiceSids'])) {
|
|
338
|
+
throw new Error('Required parameter "opts[\'messagingServiceSids\']" missing.');
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
var deferred = Q.defer();
|
|
342
|
+
var data = values.of({
|
|
343
|
+
'MessagingServiceSids': serialize.map(_.get(opts, 'messagingServiceSids'), function(e) { return e; }),
|
|
344
|
+
'FallbackUrl': _.get(opts, 'fallbackUrl'),
|
|
345
|
+
'CallbackUrl': _.get(opts, 'callbackUrl'),
|
|
346
|
+
'MessagingServiceSidsAction': _.get(opts, 'messagingServiceSidsAction')
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
|
|
350
|
+
|
|
351
|
+
promise = promise.then(function(payload) {
|
|
352
|
+
deferred.resolve(new DomainConfigInstance(this._version, payload, this._solution.domainSid));
|
|
353
|
+
}.bind(this));
|
|
354
|
+
|
|
355
|
+
promise.catch(function(error) {
|
|
356
|
+
deferred.reject(error);
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
if (_.isFunction(callback)) {
|
|
360
|
+
deferred.promise.nodeify(callback);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return deferred.promise;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/* jshint ignore:start */
|
|
367
|
+
/**
|
|
368
|
+
* fetch a DomainConfigInstance
|
|
369
|
+
*
|
|
370
|
+
* @function fetch
|
|
371
|
+
* @memberof Twilio.Messaging.V1.DomainConfigContext#
|
|
372
|
+
*
|
|
373
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
374
|
+
*
|
|
375
|
+
* @returns {Promise} Resolves to processed DomainConfigInstance
|
|
376
|
+
*/
|
|
377
|
+
/* jshint ignore:end */
|
|
378
|
+
DomainConfigContext.prototype.fetch = function fetch(callback) {
|
|
379
|
+
var deferred = Q.defer();
|
|
380
|
+
var promise = this._version.fetch({uri: this._uri, method: 'GET'});
|
|
381
|
+
|
|
382
|
+
promise = promise.then(function(payload) {
|
|
383
|
+
deferred.resolve(new DomainConfigInstance(this._version, payload, this._solution.domainSid));
|
|
384
|
+
}.bind(this));
|
|
385
|
+
|
|
386
|
+
promise.catch(function(error) {
|
|
387
|
+
deferred.reject(error);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
if (_.isFunction(callback)) {
|
|
391
|
+
deferred.promise.nodeify(callback);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
return deferred.promise;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
/* jshint ignore:start */
|
|
398
|
+
/**
|
|
399
|
+
* Provide a user-friendly representation
|
|
400
|
+
*
|
|
401
|
+
* @function toJSON
|
|
402
|
+
* @memberof Twilio.Messaging.V1.DomainConfigContext#
|
|
403
|
+
*
|
|
404
|
+
* @returns Object
|
|
405
|
+
*/
|
|
406
|
+
/* jshint ignore:end */
|
|
407
|
+
DomainConfigContext.prototype.toJSON = function toJSON() {
|
|
408
|
+
return this._solution;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
DomainConfigContext.prototype[util.inspect.custom] = function inspect(depth,
|
|
412
|
+
options) {
|
|
413
|
+
return util.inspect(this.toJSON(), options);
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
module.exports = {
|
|
417
|
+
DomainConfigList: DomainConfigList,
|
|
418
|
+
DomainConfigPage: DomainConfigPage,
|
|
419
|
+
DomainConfigInstance: DomainConfigInstance,
|
|
420
|
+
DomainConfigContext: DomainConfigContext
|
|
421
|
+
};
|
|
@@ -165,7 +165,7 @@ interface UsAppToPersonListInstanceCreateOptions {
|
|
|
165
165
|
hasEmbeddedPhone: boolean;
|
|
166
166
|
helpKeywords?: string | string[];
|
|
167
167
|
helpMessage?: string;
|
|
168
|
-
messageFlow
|
|
168
|
+
messageFlow: string;
|
|
169
169
|
messageSamples: string | string[];
|
|
170
170
|
optInKeywords?: string | string[];
|
|
171
171
|
optInMessage?: string;
|
|
@@ -67,13 +67,13 @@ UsAppToPersonList = function UsAppToPersonList(version, messagingServiceSid) {
|
|
|
67
67
|
* @param {string} opts.brandRegistrationSid - A2P Brand Registration SID
|
|
68
68
|
* @param {string} opts.description -
|
|
69
69
|
* A short description of what this SMS campaign does
|
|
70
|
+
* @param {string} opts.messageFlow - The message flow of the campaign
|
|
70
71
|
* @param {string|list} opts.messageSamples - Message samples
|
|
71
72
|
* @param {string} opts.usAppToPersonUsecase - A2P Campaign Use Case.
|
|
72
73
|
* @param {boolean} opts.hasEmbeddedLinks -
|
|
73
74
|
* Indicates that this SMS campaign will send messages that contain links
|
|
74
75
|
* @param {boolean} opts.hasEmbeddedPhone -
|
|
75
76
|
* Indicates that this SMS campaign will send messages that contain phone numbers
|
|
76
|
-
* @param {string} [opts.messageFlow] - The message flow of the campaign
|
|
77
77
|
* @param {string} [opts.optInMessage] - Opt In Message
|
|
78
78
|
* @param {string} [opts.optOutMessage] - Opt Out Message
|
|
79
79
|
* @param {string} [opts.helpMessage] - Help Message
|
|
@@ -95,6 +95,9 @@ UsAppToPersonList = function UsAppToPersonList(version, messagingServiceSid) {
|
|
|
95
95
|
if (_.isUndefined(opts['description'])) {
|
|
96
96
|
throw new Error('Required parameter "opts[\'description\']" missing.');
|
|
97
97
|
}
|
|
98
|
+
if (_.isUndefined(opts['messageFlow'])) {
|
|
99
|
+
throw new Error('Required parameter "opts[\'messageFlow\']" missing.');
|
|
100
|
+
}
|
|
98
101
|
if (_.isUndefined(opts['messageSamples'])) {
|
|
99
102
|
throw new Error('Required parameter "opts[\'messageSamples\']" missing.');
|
|
100
103
|
}
|
|
@@ -112,11 +115,11 @@ UsAppToPersonList = function UsAppToPersonList(version, messagingServiceSid) {
|
|
|
112
115
|
var data = values.of({
|
|
113
116
|
'BrandRegistrationSid': _.get(opts, 'brandRegistrationSid'),
|
|
114
117
|
'Description': _.get(opts, 'description'),
|
|
118
|
+
'MessageFlow': _.get(opts, 'messageFlow'),
|
|
115
119
|
'MessageSamples': serialize.map(_.get(opts, 'messageSamples'), function(e) { return e; }),
|
|
116
120
|
'UsAppToPersonUsecase': _.get(opts, 'usAppToPersonUsecase'),
|
|
117
121
|
'HasEmbeddedLinks': serialize.bool(_.get(opts, 'hasEmbeddedLinks')),
|
|
118
122
|
'HasEmbeddedPhone': serialize.bool(_.get(opts, 'hasEmbeddedPhone')),
|
|
119
|
-
'MessageFlow': _.get(opts, 'messageFlow'),
|
|
120
123
|
'OptInMessage': _.get(opts, 'optInMessage'),
|
|
121
124
|
'OptOutMessage': _.get(opts, 'optOutMessage'),
|
|
122
125
|
'HelpMessage': _.get(opts, 'helpMessage'),
|
|
@@ -212,6 +212,7 @@ interface DeviceResource {
|
|
|
212
212
|
app: object;
|
|
213
213
|
date_created: Date;
|
|
214
214
|
date_updated: Date;
|
|
215
|
+
links: string;
|
|
215
216
|
logging: object;
|
|
216
217
|
sid: string;
|
|
217
218
|
unique_name: string;
|
|
@@ -286,6 +287,7 @@ declare class DeviceInstance extends SerializableClass {
|
|
|
286
287
|
* @param callback - Callback to handle processed record
|
|
287
288
|
*/
|
|
288
289
|
fetch(callback?: (error: Error | null, items: DeviceInstance) => any): Promise<DeviceInstance>;
|
|
290
|
+
links: string;
|
|
289
291
|
logging: any;
|
|
290
292
|
sid: string;
|
|
291
293
|
/**
|
|
@@ -426,6 +426,7 @@ DevicePage.prototype[util.inspect.custom] = function inspect(depth, options) {
|
|
|
426
426
|
* @property {Date} dateCreated - The date that this Device was created.
|
|
427
427
|
* @property {Date} dateUpdated - The date that this Device was last updated.
|
|
428
428
|
* @property {string} url - The URL of this resource.
|
|
429
|
+
* @property {string} links - The absolute URLs of related resources
|
|
429
430
|
*
|
|
430
431
|
* @param {V1} version - Version of the resource
|
|
431
432
|
* @param {DevicePayload} payload - The instance payload
|
|
@@ -444,6 +445,7 @@ DeviceInstance = function DeviceInstance(version, payload, sid) {
|
|
|
444
445
|
this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
|
|
445
446
|
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
|
|
446
447
|
this.url = payload.url; // jshint ignore:line
|
|
448
|
+
this.links = payload.links; // jshint ignore:line
|
|
447
449
|
|
|
448
450
|
// Context
|
|
449
451
|
this._context = undefined;
|
package/lib/rest/oauth/V1.d.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import Oauth = require('../Oauth');
|
|
9
9
|
import Version = require('../../base/Version');
|
|
10
|
+
import { DeviceCodeList } from './v1/deviceCode';
|
|
11
|
+
import { DeviceCodeListInstance } from './v1/deviceCode';
|
|
10
12
|
import { OauthList } from './v1/oauth';
|
|
11
13
|
import { OauthListInstance } from './v1/oauth';
|
|
12
14
|
import { OpenidDiscoveryList } from './v1/openidDiscovery';
|
|
@@ -25,6 +27,7 @@ declare class V1 extends Version {
|
|
|
25
27
|
*/
|
|
26
28
|
constructor(domain: Oauth);
|
|
27
29
|
|
|
30
|
+
readonly deviceCode: DeviceCodeListInstance;
|
|
28
31
|
readonly oauth: OauthListInstance;
|
|
29
32
|
readonly openidDiscovery: OpenidDiscoveryListInstance;
|
|
30
33
|
readonly token: TokenListInstance;
|
package/lib/rest/oauth/V1.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
/* jshint ignore:end */
|
|
11
11
|
|
|
12
12
|
var _ = require('lodash'); /* jshint ignore:line */
|
|
13
|
+
var DeviceCodeList = require('./v1/deviceCode').DeviceCodeList;
|
|
13
14
|
var OauthList = require('./v1/oauth').OauthList;
|
|
14
15
|
var OpenidDiscoveryList = require('./v1/openidDiscovery').OpenidDiscoveryList;
|
|
15
16
|
var TokenList = require('./v1/token').TokenList;
|
|
@@ -24,6 +25,7 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
|
|
|
24
25
|
* @constructor Twilio.Oauth.V1
|
|
25
26
|
*
|
|
26
27
|
* @property {Twilio.Oauth.V1.OauthList} oauth - oauth resource
|
|
28
|
+
* @property {Twilio.Oauth.V1.DeviceCodeList} deviceCode - deviceCode resource
|
|
27
29
|
* @property {Twilio.Oauth.V1.OpenidDiscoveryList} openidDiscovery -
|
|
28
30
|
* openidDiscovery resource
|
|
29
31
|
* @property {Twilio.Oauth.V1.TokenList} token - token resource
|
|
@@ -37,6 +39,7 @@ function V1(domain) {
|
|
|
37
39
|
|
|
38
40
|
// Resources
|
|
39
41
|
this._oauth = undefined;
|
|
42
|
+
this._deviceCode = undefined;
|
|
40
43
|
this._openidDiscovery = undefined;
|
|
41
44
|
this._token = undefined;
|
|
42
45
|
this._userInfo = undefined;
|
|
@@ -53,6 +56,14 @@ Object.defineProperty(V1.prototype,
|
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
58
|
|
|
59
|
+
Object.defineProperty(V1.prototype,
|
|
60
|
+
'deviceCode', {
|
|
61
|
+
get: function() {
|
|
62
|
+
this._deviceCode = this._deviceCode || new DeviceCodeList(this);
|
|
63
|
+
return this._deviceCode;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
56
67
|
Object.defineProperty(V1.prototype,
|
|
57
68
|
'openidDiscovery', {
|
|
58
69
|
get: function() {
|
|
@@ -0,0 +1,107 @@
|
|
|
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 V1 = require('../V1');
|
|
11
|
+
import { SerializableClass } from '../../../interfaces';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the DeviceCodeList
|
|
15
|
+
*
|
|
16
|
+
* @param version - Version of the resource
|
|
17
|
+
*/
|
|
18
|
+
declare function DeviceCodeList(version: V1): DeviceCodeListInstance;
|
|
19
|
+
|
|
20
|
+
interface DeviceCodeListInstance {
|
|
21
|
+
/**
|
|
22
|
+
* create a DeviceCodeInstance
|
|
23
|
+
*
|
|
24
|
+
* @param opts - Options for request
|
|
25
|
+
* @param callback - Callback to handle processed record
|
|
26
|
+
*/
|
|
27
|
+
create(opts: DeviceCodeListInstanceCreateOptions, callback?: (error: Error | null, item: DeviceCodeInstance) => any): Promise<DeviceCodeInstance>;
|
|
28
|
+
/**
|
|
29
|
+
* Provide a user-friendly representation
|
|
30
|
+
*/
|
|
31
|
+
toJSON(): any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Options to pass to create
|
|
36
|
+
*
|
|
37
|
+
* @property audiences - An array of intended audiences
|
|
38
|
+
* @property clientSid - A string that uniquely identifies this oauth app
|
|
39
|
+
* @property scopes - An Array of scopes
|
|
40
|
+
*/
|
|
41
|
+
interface DeviceCodeListInstanceCreateOptions {
|
|
42
|
+
audiences?: string | string[];
|
|
43
|
+
clientSid: string;
|
|
44
|
+
scopes: string | string[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface DeviceCodePayload extends DeviceCodeResource, Page.TwilioResponsePayload {
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface DeviceCodeResource {
|
|
51
|
+
device_code: string;
|
|
52
|
+
expires_in: number;
|
|
53
|
+
interval: number;
|
|
54
|
+
user_code: string;
|
|
55
|
+
verification_uri: string;
|
|
56
|
+
verification_uri_complete: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface DeviceCodeSolution {
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
declare class DeviceCodeInstance extends SerializableClass {
|
|
64
|
+
/**
|
|
65
|
+
* Initialize the DeviceCodeContext
|
|
66
|
+
*
|
|
67
|
+
* @param version - Version of the resource
|
|
68
|
+
* @param payload - The instance payload
|
|
69
|
+
*/
|
|
70
|
+
constructor(version: V1, payload: DeviceCodePayload);
|
|
71
|
+
|
|
72
|
+
deviceCode: string;
|
|
73
|
+
expiresIn: number;
|
|
74
|
+
interval: number;
|
|
75
|
+
/**
|
|
76
|
+
* Provide a user-friendly representation
|
|
77
|
+
*/
|
|
78
|
+
toJSON(): any;
|
|
79
|
+
userCode: string;
|
|
80
|
+
verificationUri: string;
|
|
81
|
+
verificationUriComplete: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
declare class DeviceCodePage extends Page<V1, DeviceCodePayload, DeviceCodeResource, DeviceCodeInstance> {
|
|
86
|
+
/**
|
|
87
|
+
* Initialize the DeviceCodePage
|
|
88
|
+
*
|
|
89
|
+
* @param version - Version of the resource
|
|
90
|
+
* @param response - Response from the API
|
|
91
|
+
* @param solution - Path solution
|
|
92
|
+
*/
|
|
93
|
+
constructor(version: V1, response: Response<string>, solution: DeviceCodeSolution);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Build an instance of DeviceCodeInstance
|
|
97
|
+
*
|
|
98
|
+
* @param payload - Payload response from the API
|
|
99
|
+
*/
|
|
100
|
+
getInstance(payload: DeviceCodePayload): DeviceCodeInstance;
|
|
101
|
+
/**
|
|
102
|
+
* Provide a user-friendly representation
|
|
103
|
+
*/
|
|
104
|
+
toJSON(): any;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { DeviceCodeInstance, DeviceCodeList, DeviceCodeListInstance, DeviceCodeListInstanceCreateOptions, DeviceCodePage, DeviceCodePayload, DeviceCodeResource, DeviceCodeSolution }
|