twilio 3.67.1 → 3.70.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/CHANGES.md +83 -0
- package/lib/base/RequestClient.js +1 -0
- package/lib/jwt/AccessToken.d.ts +16 -0
- package/lib/jwt/AccessToken.js +20 -0
- package/lib/rest/Media.d.ts +28 -0
- package/lib/rest/Media.js +64 -0
- package/lib/rest/Twilio.d.ts +2 -0
- package/lib/rest/Twilio.js +14 -0
- package/lib/rest/Verify.d.ts +2 -0
- package/lib/rest/Verify.js +8 -0
- package/lib/rest/api/v2010/account/call/siprec.d.ts +776 -0
- package/lib/rest/api/v2010/account/call/siprec.js +811 -0
- package/lib/rest/api/v2010/account/call.d.ts +7 -0
- package/lib/rest/api/v2010/account/call.js +28 -0
- package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +5 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +5 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +5 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +7 -3
- package/lib/rest/api/v2010/account/incomingPhoneNumber.js +7 -4
- package/lib/rest/conversations/v1/service/configuration/notification.d.ts +6 -0
- package/lib/rest/conversations/v1/service/configuration/notification.js +11 -1
- package/lib/rest/events/v1/sink.d.ts +1 -1
- package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
- package/lib/rest/flexApi/v1/configuration.js +2 -0
- package/lib/rest/insights/v1/callSummaries.d.ts +27 -27
- package/lib/rest/insights/v1/callSummaries.js +35 -35
- package/lib/rest/media/V1.d.ts +28 -0
- package/lib/rest/media/V1.js +59 -0
- package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
- package/lib/rest/media/v1/mediaProcessor.js +702 -0
- package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
- package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
- package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
- package/lib/rest/media/v1/playerStreamer.js +729 -0
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +286 -0
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +521 -0
- package/lib/rest/messaging/v1/brandRegistration.d.ts +30 -1
- package/lib/rest/messaging/v1/brandRegistration.js +54 -1
- package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +2 -0
- package/lib/rest/messaging/v1/service/usAppToPerson.js +3 -0
- package/lib/rest/messaging/v1/service.d.ts +8 -0
- package/lib/rest/messaging/v1/service.js +14 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +133 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +268 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +127 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +271 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +14 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +56 -0
- package/lib/rest/serverless/v1/service/environment.js +1 -1
- package/lib/rest/serverless/v1/service.d.ts +2 -0
- package/lib/rest/serverless/v1/service.js +3 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
- package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
- package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
- package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
- package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
- package/lib/rest/trunking/v1/trunk.d.ts +9 -1
- package/lib/rest/trunking/v1/trunk.js +13 -2
- package/lib/rest/verify/V2.d.ts +3 -0
- package/lib/rest/verify/V2.js +11 -0
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verification.js +1 -1
- package/lib/rest/verify/v2/template.d.ts +242 -0
- package/lib/rest/verify/v2/template.js +440 -0
- package/lib/rest/video/v1/room.d.ts +4 -0
- package/lib/rest/video/v1/room.js +7 -1
- package/package.json +2 -2
|
@@ -0,0 +1,521 @@
|
|
|
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 BrandVettingList;
|
|
21
|
+
var BrandVettingPage;
|
|
22
|
+
var BrandVettingInstance;
|
|
23
|
+
|
|
24
|
+
/* jshint ignore:start */
|
|
25
|
+
/**
|
|
26
|
+
* Initialize the BrandVettingList
|
|
27
|
+
*
|
|
28
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
29
|
+
* Use them with caution.
|
|
30
|
+
*
|
|
31
|
+
* @constructor Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList
|
|
32
|
+
*
|
|
33
|
+
* @param {Twilio.Messaging.V1} version - Version of the resource
|
|
34
|
+
* @param {string} brandSid - A2P BrandRegistration Sid
|
|
35
|
+
*/
|
|
36
|
+
/* jshint ignore:end */
|
|
37
|
+
BrandVettingList = function BrandVettingList(version, brandSid) {
|
|
38
|
+
/* jshint ignore:start */
|
|
39
|
+
/**
|
|
40
|
+
* @function brandVettings
|
|
41
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext#
|
|
42
|
+
*
|
|
43
|
+
* @param {string} sid - sid of instance
|
|
44
|
+
*
|
|
45
|
+
* @returns {Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingContext}
|
|
46
|
+
*/
|
|
47
|
+
/* jshint ignore:end */
|
|
48
|
+
function BrandVettingListInstance(sid) {
|
|
49
|
+
return BrandVettingListInstance.get(sid);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
BrandVettingListInstance._version = version;
|
|
53
|
+
// Path Solution
|
|
54
|
+
BrandVettingListInstance._solution = {brandSid: brandSid};
|
|
55
|
+
BrandVettingListInstance._uri = `/a2p/BrandRegistrations/${brandSid}/Vettings`;
|
|
56
|
+
/* jshint ignore:start */
|
|
57
|
+
/**
|
|
58
|
+
* create a BrandVettingInstance
|
|
59
|
+
*
|
|
60
|
+
* @function create
|
|
61
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
|
|
62
|
+
*
|
|
63
|
+
* @param {object} opts - Options for request
|
|
64
|
+
* @param {brand_vetting.vetting_provider} opts.vettingProvider -
|
|
65
|
+
* Third-party provider of the vettings to create
|
|
66
|
+
* @param {string} [opts.vettingId] - The unique ID of the vetting
|
|
67
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
68
|
+
*
|
|
69
|
+
* @returns {Promise} Resolves to processed BrandVettingInstance
|
|
70
|
+
*/
|
|
71
|
+
/* jshint ignore:end */
|
|
72
|
+
BrandVettingListInstance.create = function create(opts, callback) {
|
|
73
|
+
if (_.isUndefined(opts)) {
|
|
74
|
+
throw new Error('Required parameter "opts" missing.');
|
|
75
|
+
}
|
|
76
|
+
if (_.isUndefined(opts.vettingProvider)) {
|
|
77
|
+
throw new Error('Required parameter "opts.vettingProvider" missing.');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var deferred = Q.defer();
|
|
81
|
+
var data = values.of({
|
|
82
|
+
'VettingProvider': _.get(opts, 'vettingProvider'),
|
|
83
|
+
'VettingId': _.get(opts, 'vettingId')
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
87
|
+
|
|
88
|
+
promise = promise.then(function(payload) {
|
|
89
|
+
deferred.resolve(new BrandVettingInstance(this._version, payload));
|
|
90
|
+
}.bind(this));
|
|
91
|
+
|
|
92
|
+
promise.catch(function(error) {
|
|
93
|
+
deferred.reject(error);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
if (_.isFunction(callback)) {
|
|
97
|
+
deferred.promise.nodeify(callback);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return deferred.promise;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/* jshint ignore:start */
|
|
104
|
+
/**
|
|
105
|
+
* Streams BrandVettingInstance records from the API.
|
|
106
|
+
*
|
|
107
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
108
|
+
* is reached.
|
|
109
|
+
*
|
|
110
|
+
* The results are passed into the callback function, so this operation is memory
|
|
111
|
+
* efficient.
|
|
112
|
+
*
|
|
113
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
114
|
+
* function.
|
|
115
|
+
*
|
|
116
|
+
* @function each
|
|
117
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
|
|
118
|
+
*
|
|
119
|
+
* @param {object} [opts] - Options for request
|
|
120
|
+
* @param {brand_vetting.vetting_provider} [opts.vettingProvider] -
|
|
121
|
+
* Third-party provider of the vettings to create
|
|
122
|
+
* @param {number} [opts.limit] -
|
|
123
|
+
* Upper limit for the number of records to return.
|
|
124
|
+
* each() guarantees never to return more than limit.
|
|
125
|
+
* Default is no limit
|
|
126
|
+
* @param {number} [opts.pageSize] -
|
|
127
|
+
* Number of records to fetch per request,
|
|
128
|
+
* when not set will use the default value of 50 records.
|
|
129
|
+
* If no pageSize is defined but a limit is defined,
|
|
130
|
+
* each() will attempt to read the limit with the most efficient
|
|
131
|
+
* page size, i.e. min(limit, 1000)
|
|
132
|
+
* @param {Function} [opts.callback] -
|
|
133
|
+
* Function to process each record. If this and a positional
|
|
134
|
+
* callback are passed, this one will be used
|
|
135
|
+
* @param {Function} [opts.done] -
|
|
136
|
+
* Function to be called upon completion of streaming
|
|
137
|
+
* @param {Function} [callback] - Function to process each record
|
|
138
|
+
*/
|
|
139
|
+
/* jshint ignore:end */
|
|
140
|
+
BrandVettingListInstance.each = function each(opts, callback) {
|
|
141
|
+
if (_.isFunction(opts)) {
|
|
142
|
+
callback = opts;
|
|
143
|
+
opts = {};
|
|
144
|
+
}
|
|
145
|
+
opts = opts || {};
|
|
146
|
+
if (opts.callback) {
|
|
147
|
+
callback = opts.callback;
|
|
148
|
+
}
|
|
149
|
+
if (_.isUndefined(callback)) {
|
|
150
|
+
throw new Error('Callback function must be provided');
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var done = false;
|
|
154
|
+
var currentPage = 1;
|
|
155
|
+
var currentResource = 0;
|
|
156
|
+
var limits = this._version.readLimits({
|
|
157
|
+
limit: opts.limit,
|
|
158
|
+
pageSize: opts.pageSize
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
function onComplete(error) {
|
|
162
|
+
done = true;
|
|
163
|
+
if (_.isFunction(opts.done)) {
|
|
164
|
+
opts.done(error);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function fetchNextPage(fn) {
|
|
169
|
+
var promise = fn();
|
|
170
|
+
if (_.isUndefined(promise)) {
|
|
171
|
+
onComplete();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
promise.then(function(page) {
|
|
176
|
+
_.each(page.instances, function(instance) {
|
|
177
|
+
if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) {
|
|
178
|
+
done = true;
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
currentResource++;
|
|
183
|
+
callback(instance, onComplete);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
if (!done) {
|
|
187
|
+
currentPage++;
|
|
188
|
+
fetchNextPage(_.bind(page.nextPage, page));
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
promise.catch(onComplete);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
fetchNextPage(_.bind(this.page, this, _.merge(opts, limits)));
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
/* jshint ignore:start */
|
|
199
|
+
/**
|
|
200
|
+
* Lists BrandVettingInstance records from the API as a list.
|
|
201
|
+
*
|
|
202
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
203
|
+
* function.
|
|
204
|
+
*
|
|
205
|
+
* @function list
|
|
206
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
|
|
207
|
+
*
|
|
208
|
+
* @param {object} [opts] - Options for request
|
|
209
|
+
* @param {brand_vetting.vetting_provider} [opts.vettingProvider] -
|
|
210
|
+
* Third-party provider of the vettings to create
|
|
211
|
+
* @param {number} [opts.limit] -
|
|
212
|
+
* Upper limit for the number of records to return.
|
|
213
|
+
* list() guarantees never to return more than limit.
|
|
214
|
+
* Default is no limit
|
|
215
|
+
* @param {number} [opts.pageSize] -
|
|
216
|
+
* Number of records to fetch per request,
|
|
217
|
+
* when not set will use the default value of 50 records.
|
|
218
|
+
* If no page_size is defined but a limit is defined,
|
|
219
|
+
* list() will attempt to read the limit with the most
|
|
220
|
+
* efficient page size, i.e. min(limit, 1000)
|
|
221
|
+
* @param {function} [callback] - Callback to handle list of records
|
|
222
|
+
*
|
|
223
|
+
* @returns {Promise} Resolves to a list of records
|
|
224
|
+
*/
|
|
225
|
+
/* jshint ignore:end */
|
|
226
|
+
BrandVettingListInstance.list = function list(opts, callback) {
|
|
227
|
+
if (_.isFunction(opts)) {
|
|
228
|
+
callback = opts;
|
|
229
|
+
opts = {};
|
|
230
|
+
}
|
|
231
|
+
opts = opts || {};
|
|
232
|
+
var deferred = Q.defer();
|
|
233
|
+
var allResources = [];
|
|
234
|
+
opts.callback = function(resource, done) {
|
|
235
|
+
allResources.push(resource);
|
|
236
|
+
|
|
237
|
+
if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) {
|
|
238
|
+
done();
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
opts.done = function(error) {
|
|
243
|
+
if (_.isUndefined(error)) {
|
|
244
|
+
deferred.resolve(allResources);
|
|
245
|
+
} else {
|
|
246
|
+
deferred.reject(error);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
if (_.isFunction(callback)) {
|
|
251
|
+
deferred.promise.nodeify(callback);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
this.each(opts);
|
|
255
|
+
return deferred.promise;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
/* jshint ignore:start */
|
|
259
|
+
/**
|
|
260
|
+
* Retrieve a single page of BrandVettingInstance records from the API.
|
|
261
|
+
*
|
|
262
|
+
* The request is executed immediately.
|
|
263
|
+
*
|
|
264
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
265
|
+
* function.
|
|
266
|
+
*
|
|
267
|
+
* @function page
|
|
268
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
|
|
269
|
+
*
|
|
270
|
+
* @param {object} [opts] - Options for request
|
|
271
|
+
* @param {brand_vetting.vetting_provider} [opts.vettingProvider] -
|
|
272
|
+
* Third-party provider of the vettings to create
|
|
273
|
+
* @param {string} [opts.pageToken] - PageToken provided by the API
|
|
274
|
+
* @param {number} [opts.pageNumber] -
|
|
275
|
+
* Page Number, this value is simply for client state
|
|
276
|
+
* @param {number} [opts.pageSize] - Number of records to return, defaults to 50
|
|
277
|
+
* @param {function} [callback] - Callback to handle list of records
|
|
278
|
+
*
|
|
279
|
+
* @returns {Promise} Resolves to a list of records
|
|
280
|
+
*/
|
|
281
|
+
/* jshint ignore:end */
|
|
282
|
+
BrandVettingListInstance.page = function page(opts, callback) {
|
|
283
|
+
if (_.isFunction(opts)) {
|
|
284
|
+
callback = opts;
|
|
285
|
+
opts = {};
|
|
286
|
+
}
|
|
287
|
+
opts = opts || {};
|
|
288
|
+
|
|
289
|
+
var deferred = Q.defer();
|
|
290
|
+
var data = values.of({
|
|
291
|
+
'VettingProvider': _.get(opts, 'vettingProvider'),
|
|
292
|
+
'PageToken': opts.pageToken,
|
|
293
|
+
'Page': opts.pageNumber,
|
|
294
|
+
'PageSize': opts.pageSize
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
var promise = this._version.page({uri: this._uri, method: 'GET', params: data});
|
|
298
|
+
|
|
299
|
+
promise = promise.then(function(payload) {
|
|
300
|
+
deferred.resolve(new BrandVettingPage(this._version, payload, this._solution));
|
|
301
|
+
}.bind(this));
|
|
302
|
+
|
|
303
|
+
promise.catch(function(error) {
|
|
304
|
+
deferred.reject(error);
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
if (_.isFunction(callback)) {
|
|
308
|
+
deferred.promise.nodeify(callback);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return deferred.promise;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/* jshint ignore:start */
|
|
315
|
+
/**
|
|
316
|
+
* Retrieve a single target page of BrandVettingInstance records from the API.
|
|
317
|
+
*
|
|
318
|
+
* The request is executed immediately.
|
|
319
|
+
*
|
|
320
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
321
|
+
* function.
|
|
322
|
+
*
|
|
323
|
+
* @function getPage
|
|
324
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
|
|
325
|
+
*
|
|
326
|
+
* @param {string} [targetUrl] - API-generated URL for the requested results page
|
|
327
|
+
* @param {function} [callback] - Callback to handle list of records
|
|
328
|
+
*
|
|
329
|
+
* @returns {Promise} Resolves to a list of records
|
|
330
|
+
*/
|
|
331
|
+
/* jshint ignore:end */
|
|
332
|
+
BrandVettingListInstance.getPage = function getPage(targetUrl, callback) {
|
|
333
|
+
var deferred = Q.defer();
|
|
334
|
+
|
|
335
|
+
var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});
|
|
336
|
+
|
|
337
|
+
promise = promise.then(function(payload) {
|
|
338
|
+
deferred.resolve(new BrandVettingPage(this._version, payload, this._solution));
|
|
339
|
+
}.bind(this));
|
|
340
|
+
|
|
341
|
+
promise.catch(function(error) {
|
|
342
|
+
deferred.reject(error);
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
if (_.isFunction(callback)) {
|
|
346
|
+
deferred.promise.nodeify(callback);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return deferred.promise;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
/* jshint ignore:start */
|
|
353
|
+
/**
|
|
354
|
+
* Provide a user-friendly representation
|
|
355
|
+
*
|
|
356
|
+
* @function toJSON
|
|
357
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList#
|
|
358
|
+
*
|
|
359
|
+
* @returns Object
|
|
360
|
+
*/
|
|
361
|
+
/* jshint ignore:end */
|
|
362
|
+
BrandVettingListInstance.toJSON = function toJSON() {
|
|
363
|
+
return this._solution;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
BrandVettingListInstance[util.inspect.custom] = function inspect(depth, options)
|
|
367
|
+
{
|
|
368
|
+
return util.inspect(this.toJSON(), options);
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
return BrandVettingListInstance;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
/* jshint ignore:start */
|
|
376
|
+
/**
|
|
377
|
+
* Initialize the BrandVettingPage
|
|
378
|
+
*
|
|
379
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
380
|
+
* Use them with caution.
|
|
381
|
+
*
|
|
382
|
+
* @constructor Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingPage
|
|
383
|
+
*
|
|
384
|
+
* @param {V1} version - Version of the resource
|
|
385
|
+
* @param {Response<string>} response - Response from the API
|
|
386
|
+
* @param {BrandVettingSolution} solution - Path solution
|
|
387
|
+
*
|
|
388
|
+
* @returns BrandVettingPage
|
|
389
|
+
*/
|
|
390
|
+
/* jshint ignore:end */
|
|
391
|
+
BrandVettingPage = function BrandVettingPage(version, response, solution) {
|
|
392
|
+
// Path Solution
|
|
393
|
+
this._solution = solution;
|
|
394
|
+
|
|
395
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
_.extend(BrandVettingPage.prototype, Page.prototype);
|
|
399
|
+
BrandVettingPage.prototype.constructor = BrandVettingPage;
|
|
400
|
+
|
|
401
|
+
/* jshint ignore:start */
|
|
402
|
+
/**
|
|
403
|
+
* Build an instance of BrandVettingInstance
|
|
404
|
+
*
|
|
405
|
+
* @function getInstance
|
|
406
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingPage#
|
|
407
|
+
*
|
|
408
|
+
* @param {BrandVettingPayload} payload - Payload response from the API
|
|
409
|
+
*
|
|
410
|
+
* @returns BrandVettingInstance
|
|
411
|
+
*/
|
|
412
|
+
/* jshint ignore:end */
|
|
413
|
+
BrandVettingPage.prototype.getInstance = function getInstance(payload) {
|
|
414
|
+
return new BrandVettingInstance(this._version, payload, this._solution.brandSid);
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
/* jshint ignore:start */
|
|
418
|
+
/**
|
|
419
|
+
* Provide a user-friendly representation
|
|
420
|
+
*
|
|
421
|
+
* @function toJSON
|
|
422
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingPage#
|
|
423
|
+
*
|
|
424
|
+
* @returns Object
|
|
425
|
+
*/
|
|
426
|
+
/* jshint ignore:end */
|
|
427
|
+
BrandVettingPage.prototype.toJSON = function toJSON() {
|
|
428
|
+
let clone = {};
|
|
429
|
+
_.forOwn(this, function(value, key) {
|
|
430
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
431
|
+
clone[key] = value;
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
return clone;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
BrandVettingPage.prototype[util.inspect.custom] = function inspect(depth,
|
|
438
|
+
options) {
|
|
439
|
+
return util.inspect(this.toJSON(), options);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
/* jshint ignore:start */
|
|
444
|
+
/**
|
|
445
|
+
* Initialize the BrandVettingContext
|
|
446
|
+
*
|
|
447
|
+
* PLEASE NOTE that this class contains beta products that are subject to change.
|
|
448
|
+
* Use them with caution.
|
|
449
|
+
*
|
|
450
|
+
* @constructor Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingInstance
|
|
451
|
+
*
|
|
452
|
+
* @property {string} accountSid - The SID of the Account that created the vetting
|
|
453
|
+
* @property {string} brandSid - A2P BrandRegistration Sid
|
|
454
|
+
* @property {string} brandVettingSid - SID for third-party vetting record
|
|
455
|
+
* @property {Date} dateUpdated -
|
|
456
|
+
* The ISO 8601 date and time in GMT when the resource was last updated
|
|
457
|
+
* @property {Date} dateCreated -
|
|
458
|
+
* The ISO 8601 date and time in GMT when the resource was created
|
|
459
|
+
* @property {string} vettingId - The unique ID of the vetting
|
|
460
|
+
* @property {string} vettingClass - The type of vetting
|
|
461
|
+
* @property {string} vettingStatus - Status of vetting attempt
|
|
462
|
+
* @property {brand_vetting.vetting_provider} vettingProvider -
|
|
463
|
+
* Third-party provider that has conducted the vetting
|
|
464
|
+
* @property {string} url - The absolute URL of the Brand Vetting
|
|
465
|
+
*
|
|
466
|
+
* @param {V1} version - Version of the resource
|
|
467
|
+
* @param {BrandVettingPayload} payload - The instance payload
|
|
468
|
+
* @param {sid} brandSid - A2P BrandRegistration Sid
|
|
469
|
+
*/
|
|
470
|
+
/* jshint ignore:end */
|
|
471
|
+
BrandVettingInstance = function BrandVettingInstance(version, payload, brandSid)
|
|
472
|
+
{
|
|
473
|
+
this._version = version;
|
|
474
|
+
|
|
475
|
+
// Marshaled Properties
|
|
476
|
+
this.accountSid = payload.account_sid; // jshint ignore:line
|
|
477
|
+
this.brandSid = payload.brand_sid; // jshint ignore:line
|
|
478
|
+
this.brandVettingSid = payload.brand_vetting_sid; // jshint ignore:line
|
|
479
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
|
|
480
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
|
|
481
|
+
this.vettingId = payload.vetting_id; // jshint ignore:line
|
|
482
|
+
this.vettingClass = payload.vetting_class; // jshint ignore:line
|
|
483
|
+
this.vettingStatus = payload.vetting_status; // jshint ignore:line
|
|
484
|
+
this.vettingProvider = payload.vetting_provider; // jshint ignore:line
|
|
485
|
+
this.url = payload.url; // jshint ignore:line
|
|
486
|
+
|
|
487
|
+
// Context
|
|
488
|
+
this._context = undefined;
|
|
489
|
+
this._solution = {brandSid: brandSid, };
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/* jshint ignore:start */
|
|
493
|
+
/**
|
|
494
|
+
* Provide a user-friendly representation
|
|
495
|
+
*
|
|
496
|
+
* @function toJSON
|
|
497
|
+
* @memberof Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingInstance#
|
|
498
|
+
*
|
|
499
|
+
* @returns Object
|
|
500
|
+
*/
|
|
501
|
+
/* jshint ignore:end */
|
|
502
|
+
BrandVettingInstance.prototype.toJSON = function toJSON() {
|
|
503
|
+
let clone = {};
|
|
504
|
+
_.forOwn(this, function(value, key) {
|
|
505
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
506
|
+
clone[key] = value;
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
return clone;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
BrandVettingInstance.prototype[util.inspect.custom] = function inspect(depth,
|
|
513
|
+
options) {
|
|
514
|
+
return util.inspect(this.toJSON(), options);
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
module.exports = {
|
|
518
|
+
BrandVettingList: BrandVettingList,
|
|
519
|
+
BrandVettingPage: BrandVettingPage,
|
|
520
|
+
BrandVettingInstance: BrandVettingInstance
|
|
521
|
+
};
|
|
@@ -8,8 +8,14 @@
|
|
|
8
8
|
import Page = require('../../../base/Page');
|
|
9
9
|
import Response = require('../../../http/response');
|
|
10
10
|
import V1 = require('../V1');
|
|
11
|
+
import { BrandVettingList } from './brandRegistration/brandVetting';
|
|
12
|
+
import { BrandVettingListInstance } from './brandRegistration/brandVetting';
|
|
11
13
|
import { SerializableClass } from '../../../interfaces';
|
|
12
14
|
|
|
15
|
+
type BrandRegistrationBrandFeedback = 'TAX_ID'|'STOCK_SYMBOL'|'NONPROFIT'|'GOVERNMENT_ENTITY'|'OTHERS';
|
|
16
|
+
|
|
17
|
+
type BrandRegistrationIdentityStatus = 'SELF_DECLARED'|'UNVERIFIED'|'VERIFIED'|'VETTED_VERIFIED';
|
|
18
|
+
|
|
13
19
|
type BrandRegistrationStatus = 'PENDING'|'APPROVED'|'FAILED';
|
|
14
20
|
|
|
15
21
|
/**
|
|
@@ -148,11 +154,15 @@ interface BrandRegistrationListInstance {
|
|
|
148
154
|
* @property a2PProfileBundleSid - A2P Messaging Profile Bundle Sid
|
|
149
155
|
* @property brandType - Type of brand being created. One of: "STANDARD", "STARTER".
|
|
150
156
|
* @property customerProfileBundleSid - Customer Profile Bundle Sid
|
|
157
|
+
* @property mock - A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided.
|
|
158
|
+
* @property skipAutomaticSecVet - Skip Automatic Secondary Vetting
|
|
151
159
|
*/
|
|
152
160
|
interface BrandRegistrationListInstanceCreateOptions {
|
|
153
161
|
a2PProfileBundleSid: string;
|
|
154
162
|
brandType?: string;
|
|
155
163
|
customerProfileBundleSid: string;
|
|
164
|
+
mock?: boolean;
|
|
165
|
+
skipAutomaticSecVet?: boolean;
|
|
156
166
|
}
|
|
157
167
|
|
|
158
168
|
/**
|
|
@@ -218,14 +228,21 @@ interface BrandRegistrationPayload extends BrandRegistrationResource, Page.Twili
|
|
|
218
228
|
interface BrandRegistrationResource {
|
|
219
229
|
a2p_profile_bundle_sid: string;
|
|
220
230
|
account_sid: string;
|
|
231
|
+
brand_feedback: BrandRegistrationBrandFeedback[];
|
|
221
232
|
brand_score: number;
|
|
222
233
|
brand_type: string;
|
|
223
234
|
customer_profile_bundle_sid: string;
|
|
224
235
|
date_created: Date;
|
|
225
236
|
date_updated: Date;
|
|
226
237
|
failure_reason: string;
|
|
238
|
+
identity_status: BrandRegistrationIdentityStatus;
|
|
239
|
+
links: string;
|
|
240
|
+
mock: boolean;
|
|
241
|
+
russell_3000: boolean;
|
|
227
242
|
sid: string;
|
|
243
|
+
skip_automatic_sec_vet: boolean;
|
|
228
244
|
status: BrandRegistrationStatus;
|
|
245
|
+
tax_exempt_status: string;
|
|
229
246
|
tcr_id: string;
|
|
230
247
|
url: string;
|
|
231
248
|
}
|
|
@@ -246,6 +263,7 @@ declare class BrandRegistrationContext {
|
|
|
246
263
|
*/
|
|
247
264
|
constructor(version: V1, sid: string);
|
|
248
265
|
|
|
266
|
+
brandVettings: BrandVettingListInstance;
|
|
249
267
|
/**
|
|
250
268
|
* fetch a BrandRegistrationInstance
|
|
251
269
|
*
|
|
@@ -275,8 +293,13 @@ declare class BrandRegistrationInstance extends SerializableClass {
|
|
|
275
293
|
private _proxy: BrandRegistrationContext;
|
|
276
294
|
a2PProfileBundleSid: string;
|
|
277
295
|
accountSid: string;
|
|
296
|
+
brandFeedback: BrandRegistrationBrandFeedback[];
|
|
278
297
|
brandScore: number;
|
|
279
298
|
brandType: string;
|
|
299
|
+
/**
|
|
300
|
+
* Access the brandVettings
|
|
301
|
+
*/
|
|
302
|
+
brandVettings(): BrandVettingListInstance;
|
|
280
303
|
customerProfileBundleSid: string;
|
|
281
304
|
dateCreated: Date;
|
|
282
305
|
dateUpdated: Date;
|
|
@@ -287,8 +310,14 @@ declare class BrandRegistrationInstance extends SerializableClass {
|
|
|
287
310
|
* @param callback - Callback to handle processed record
|
|
288
311
|
*/
|
|
289
312
|
fetch(callback?: (error: Error | null, items: BrandRegistrationInstance) => any): Promise<BrandRegistrationInstance>;
|
|
313
|
+
identityStatus: BrandRegistrationIdentityStatus;
|
|
314
|
+
links: string;
|
|
315
|
+
mock: boolean;
|
|
316
|
+
russell3000: boolean;
|
|
290
317
|
sid: string;
|
|
318
|
+
skipAutomaticSecVet: boolean;
|
|
291
319
|
status: BrandRegistrationStatus;
|
|
320
|
+
taxExemptStatus: string;
|
|
292
321
|
tcrId: string;
|
|
293
322
|
/**
|
|
294
323
|
* Provide a user-friendly representation
|
|
@@ -323,4 +352,4 @@ declare class BrandRegistrationPage extends Page<V1, BrandRegistrationPayload, B
|
|
|
323
352
|
toJSON(): any;
|
|
324
353
|
}
|
|
325
354
|
|
|
326
|
-
export { BrandRegistrationContext, BrandRegistrationInstance, BrandRegistrationList, BrandRegistrationListInstance, BrandRegistrationListInstanceCreateOptions, BrandRegistrationListInstanceEachOptions, BrandRegistrationListInstanceOptions, BrandRegistrationListInstancePageOptions, BrandRegistrationPage, BrandRegistrationPayload, BrandRegistrationResource, BrandRegistrationSolution, BrandRegistrationStatus }
|
|
355
|
+
export { BrandRegistrationBrandFeedback, BrandRegistrationContext, BrandRegistrationIdentityStatus, BrandRegistrationInstance, BrandRegistrationList, BrandRegistrationListInstance, BrandRegistrationListInstanceCreateOptions, BrandRegistrationListInstanceEachOptions, BrandRegistrationListInstanceOptions, BrandRegistrationListInstancePageOptions, BrandRegistrationPage, BrandRegistrationPayload, BrandRegistrationResource, BrandRegistrationSolution, BrandRegistrationStatus }
|