twilio 3.83.2 → 3.83.4
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/LICENSE +1 -1
- package/lib/rest/Content.d.ts +26 -0
- package/lib/rest/Content.js +54 -0
- package/lib/rest/FlexApi.d.ts +2 -0
- package/lib/rest/FlexApi.js +8 -0
- package/lib/rest/Messaging.d.ts +4 -0
- package/lib/rest/Messaging.js +18 -0
- package/lib/rest/Preview.d.ts +0 -10
- package/lib/rest/Preview.js +0 -46
- package/lib/rest/Twilio.d.ts +2 -0
- package/lib/rest/Twilio.js +14 -0
- package/lib/rest/content/V1.d.ts +25 -0
- package/lib/rest/content/V1.js +46 -0
- 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 +323 -0
- package/lib/rest/content/v1/content.js +668 -0
- package/lib/rest/flexApi/V1.d.ts +3 -0
- package/lib/rest/flexApi/V1.js +11 -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 -0
- package/lib/rest/flexApi/v1/goodData.js +2 -0
- package/lib/rest/insights/v1/call/summary.d.ts +5 -1
- package/lib/rest/insights/v1/call/summary.js +2 -0
- package/lib/rest/insights/v1/callSummaries.d.ts +5 -1
- package/lib/rest/insights/v1/callSummaries.js +2 -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/microvisor/v1/device.d.ts +2 -0
- package/lib/rest/microvisor/v1/device.js +2 -0
- package/lib/rest/serverless/v1/service/build.d.ts +1 -1
- 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,328 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* jshint ignore:start */
|
|
4
|
+
/**
|
|
5
|
+
* This code was generated by
|
|
6
|
+
* \ / _ _ _| _ _
|
|
7
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
8
|
+
* / /
|
|
9
|
+
*/
|
|
10
|
+
/* jshint ignore:end */
|
|
11
|
+
|
|
12
|
+
var Q = require('q'); /* jshint ignore:line */
|
|
13
|
+
var _ = require('lodash'); /* jshint ignore:line */
|
|
14
|
+
var util = require('util'); /* jshint ignore:line */
|
|
15
|
+
var Page = require('../../../../base/Page'); /* jshint ignore:line */
|
|
16
|
+
var values = require('../../../../base/values'); /* jshint ignore:line */
|
|
17
|
+
|
|
18
|
+
var ApprovalFetchList;
|
|
19
|
+
var ApprovalFetchPage;
|
|
20
|
+
var ApprovalFetchInstance;
|
|
21
|
+
var ApprovalFetchContext;
|
|
22
|
+
|
|
23
|
+
/* jshint ignore:start */
|
|
24
|
+
/**
|
|
25
|
+
* Initialize the ApprovalFetchList
|
|
26
|
+
*
|
|
27
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
28
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
29
|
+
* access, please contact help@twilio.com.
|
|
30
|
+
*
|
|
31
|
+
* @constructor Twilio.Content.V1.ContentContext.ApprovalFetchList
|
|
32
|
+
*
|
|
33
|
+
* @param {Twilio.Content.V1} version - Version of the resource
|
|
34
|
+
* @param {string} sid - The unique string that identifies the Content resource
|
|
35
|
+
*/
|
|
36
|
+
/* jshint ignore:end */
|
|
37
|
+
ApprovalFetchList = function ApprovalFetchList(version, sid) {
|
|
38
|
+
/* jshint ignore:start */
|
|
39
|
+
/**
|
|
40
|
+
* @function approvalFetch
|
|
41
|
+
* @memberof Twilio.Content.V1.ContentContext#
|
|
42
|
+
*
|
|
43
|
+
* @param {string} sid - sid of instance
|
|
44
|
+
*
|
|
45
|
+
* @returns {Twilio.Content.V1.ContentContext.ApprovalFetchContext}
|
|
46
|
+
*/
|
|
47
|
+
/* jshint ignore:end */
|
|
48
|
+
function ApprovalFetchListInstance(sid) {
|
|
49
|
+
return ApprovalFetchListInstance.get(sid);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ApprovalFetchListInstance._version = version;
|
|
53
|
+
// Path Solution
|
|
54
|
+
ApprovalFetchListInstance._solution = {sid: sid};
|
|
55
|
+
/* jshint ignore:start */
|
|
56
|
+
/**
|
|
57
|
+
* Constructs a approval_fetch
|
|
58
|
+
*
|
|
59
|
+
* @function get
|
|
60
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchList#
|
|
61
|
+
*
|
|
62
|
+
* @returns {Twilio.Content.V1.ContentContext.ApprovalFetchContext}
|
|
63
|
+
*/
|
|
64
|
+
/* jshint ignore:end */
|
|
65
|
+
ApprovalFetchListInstance.get = function get() {
|
|
66
|
+
return new ApprovalFetchContext(this._version, this._solution.sid);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/* jshint ignore:start */
|
|
70
|
+
/**
|
|
71
|
+
* Provide a user-friendly representation
|
|
72
|
+
*
|
|
73
|
+
* @function toJSON
|
|
74
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchList#
|
|
75
|
+
*
|
|
76
|
+
* @returns Object
|
|
77
|
+
*/
|
|
78
|
+
/* jshint ignore:end */
|
|
79
|
+
ApprovalFetchListInstance.toJSON = function toJSON() {
|
|
80
|
+
return this._solution;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
ApprovalFetchListInstance[util.inspect.custom] = function inspect(depth,
|
|
84
|
+
options) {
|
|
85
|
+
return util.inspect(this.toJSON(), options);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return ApprovalFetchListInstance;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
/* jshint ignore:start */
|
|
93
|
+
/**
|
|
94
|
+
* Initialize the ApprovalFetchPage
|
|
95
|
+
*
|
|
96
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
97
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
98
|
+
* access, please contact help@twilio.com.
|
|
99
|
+
*
|
|
100
|
+
* @constructor Twilio.Content.V1.ContentContext.ApprovalFetchPage
|
|
101
|
+
*
|
|
102
|
+
* @param {V1} version - Version of the resource
|
|
103
|
+
* @param {Response<string>} response - Response from the API
|
|
104
|
+
* @param {ApprovalFetchSolution} solution - Path solution
|
|
105
|
+
*
|
|
106
|
+
* @returns ApprovalFetchPage
|
|
107
|
+
*/
|
|
108
|
+
/* jshint ignore:end */
|
|
109
|
+
ApprovalFetchPage = function ApprovalFetchPage(version, response, solution) {
|
|
110
|
+
// Path Solution
|
|
111
|
+
this._solution = solution;
|
|
112
|
+
|
|
113
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
_.extend(ApprovalFetchPage.prototype, Page.prototype);
|
|
117
|
+
ApprovalFetchPage.prototype.constructor = ApprovalFetchPage;
|
|
118
|
+
|
|
119
|
+
/* jshint ignore:start */
|
|
120
|
+
/**
|
|
121
|
+
* Build an instance of ApprovalFetchInstance
|
|
122
|
+
*
|
|
123
|
+
* @function getInstance
|
|
124
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchPage#
|
|
125
|
+
*
|
|
126
|
+
* @param {ApprovalFetchPayload} payload - Payload response from the API
|
|
127
|
+
*
|
|
128
|
+
* @returns ApprovalFetchInstance
|
|
129
|
+
*/
|
|
130
|
+
/* jshint ignore:end */
|
|
131
|
+
ApprovalFetchPage.prototype.getInstance = function getInstance(payload) {
|
|
132
|
+
return new ApprovalFetchInstance(this._version, payload, this._solution.sid);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/* jshint ignore:start */
|
|
136
|
+
/**
|
|
137
|
+
* Provide a user-friendly representation
|
|
138
|
+
*
|
|
139
|
+
* @function toJSON
|
|
140
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchPage#
|
|
141
|
+
*
|
|
142
|
+
* @returns Object
|
|
143
|
+
*/
|
|
144
|
+
/* jshint ignore:end */
|
|
145
|
+
ApprovalFetchPage.prototype.toJSON = function toJSON() {
|
|
146
|
+
let clone = {};
|
|
147
|
+
_.forOwn(this, function(value, key) {
|
|
148
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
149
|
+
clone[key] = value;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return clone;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
ApprovalFetchPage.prototype[util.inspect.custom] = function inspect(depth,
|
|
156
|
+
options) {
|
|
157
|
+
return util.inspect(this.toJSON(), options);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
/* jshint ignore:start */
|
|
162
|
+
/**
|
|
163
|
+
* Initialize the ApprovalFetchContext
|
|
164
|
+
*
|
|
165
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
166
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
167
|
+
* access, please contact help@twilio.com.
|
|
168
|
+
*
|
|
169
|
+
* @constructor Twilio.Content.V1.ContentContext.ApprovalFetchInstance
|
|
170
|
+
*
|
|
171
|
+
* @property {string} sid - The unique string that identifies the Content resource
|
|
172
|
+
* @property {string} accountSid -
|
|
173
|
+
* The SID of the Account that created the Content resource
|
|
174
|
+
* @property {object} whatsapp -
|
|
175
|
+
* Contains the whatsapp approval information for the Content resource
|
|
176
|
+
* @property {string} url -
|
|
177
|
+
* The URL of the resource, relative to `https://content.twilio.com`
|
|
178
|
+
*
|
|
179
|
+
* @param {V1} version - Version of the resource
|
|
180
|
+
* @param {ApprovalFetchPayload} payload - The instance payload
|
|
181
|
+
* @param {sid} sid - The unique string that identifies the Content resource
|
|
182
|
+
*/
|
|
183
|
+
/* jshint ignore:end */
|
|
184
|
+
ApprovalFetchInstance = function ApprovalFetchInstance(version, payload, sid) {
|
|
185
|
+
this._version = version;
|
|
186
|
+
|
|
187
|
+
// Marshaled Properties
|
|
188
|
+
this.sid = payload.sid; // jshint ignore:line
|
|
189
|
+
this.accountSid = payload.account_sid; // jshint ignore:line
|
|
190
|
+
this.whatsapp = payload.whatsapp; // jshint ignore:line
|
|
191
|
+
this.url = payload.url; // jshint ignore:line
|
|
192
|
+
|
|
193
|
+
// Context
|
|
194
|
+
this._context = undefined;
|
|
195
|
+
this._solution = {sid: sid, };
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
Object.defineProperty(ApprovalFetchInstance.prototype,
|
|
199
|
+
'_proxy', {
|
|
200
|
+
get: function() {
|
|
201
|
+
if (!this._context) {
|
|
202
|
+
this._context = new ApprovalFetchContext(this._version, this._solution.sid);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return this._context;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
/* jshint ignore:start */
|
|
210
|
+
/**
|
|
211
|
+
* fetch a ApprovalFetchInstance
|
|
212
|
+
*
|
|
213
|
+
* @function fetch
|
|
214
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchInstance#
|
|
215
|
+
*
|
|
216
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
217
|
+
*
|
|
218
|
+
* @returns {Promise} Resolves to processed ApprovalFetchInstance
|
|
219
|
+
*/
|
|
220
|
+
/* jshint ignore:end */
|
|
221
|
+
ApprovalFetchInstance.prototype.fetch = function fetch(callback) {
|
|
222
|
+
return this._proxy.fetch(callback);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/* jshint ignore:start */
|
|
226
|
+
/**
|
|
227
|
+
* Provide a user-friendly representation
|
|
228
|
+
*
|
|
229
|
+
* @function toJSON
|
|
230
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchInstance#
|
|
231
|
+
*
|
|
232
|
+
* @returns Object
|
|
233
|
+
*/
|
|
234
|
+
/* jshint ignore:end */
|
|
235
|
+
ApprovalFetchInstance.prototype.toJSON = function toJSON() {
|
|
236
|
+
let clone = {};
|
|
237
|
+
_.forOwn(this, function(value, key) {
|
|
238
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
239
|
+
clone[key] = value;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return clone;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
ApprovalFetchInstance.prototype[util.inspect.custom] = function inspect(depth,
|
|
246
|
+
options) {
|
|
247
|
+
return util.inspect(this.toJSON(), options);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
/* jshint ignore:start */
|
|
252
|
+
/**
|
|
253
|
+
* Initialize the ApprovalFetchContext
|
|
254
|
+
*
|
|
255
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
256
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
257
|
+
* access, please contact help@twilio.com.
|
|
258
|
+
*
|
|
259
|
+
* @constructor Twilio.Content.V1.ContentContext.ApprovalFetchContext
|
|
260
|
+
*
|
|
261
|
+
* @param {V1} version - Version of the resource
|
|
262
|
+
* @param {sid} sid - The unique string that identifies the Content resource
|
|
263
|
+
*/
|
|
264
|
+
/* jshint ignore:end */
|
|
265
|
+
ApprovalFetchContext = function ApprovalFetchContext(version, sid) {
|
|
266
|
+
this._version = version;
|
|
267
|
+
|
|
268
|
+
// Path Solution
|
|
269
|
+
this._solution = {sid: sid, };
|
|
270
|
+
this._uri = `/Content/${sid}/ApprovalRequests`;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/* jshint ignore:start */
|
|
274
|
+
/**
|
|
275
|
+
* fetch a ApprovalFetchInstance
|
|
276
|
+
*
|
|
277
|
+
* @function fetch
|
|
278
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchContext#
|
|
279
|
+
*
|
|
280
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
281
|
+
*
|
|
282
|
+
* @returns {Promise} Resolves to processed ApprovalFetchInstance
|
|
283
|
+
*/
|
|
284
|
+
/* jshint ignore:end */
|
|
285
|
+
ApprovalFetchContext.prototype.fetch = function fetch(callback) {
|
|
286
|
+
var deferred = Q.defer();
|
|
287
|
+
var promise = this._version.fetch({uri: this._uri, method: 'GET'});
|
|
288
|
+
|
|
289
|
+
promise = promise.then(function(payload) {
|
|
290
|
+
deferred.resolve(new ApprovalFetchInstance(this._version, payload, this._solution.sid));
|
|
291
|
+
}.bind(this));
|
|
292
|
+
|
|
293
|
+
promise.catch(function(error) {
|
|
294
|
+
deferred.reject(error);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
if (_.isFunction(callback)) {
|
|
298
|
+
deferred.promise.nodeify(callback);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return deferred.promise;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/* jshint ignore:start */
|
|
305
|
+
/**
|
|
306
|
+
* Provide a user-friendly representation
|
|
307
|
+
*
|
|
308
|
+
* @function toJSON
|
|
309
|
+
* @memberof Twilio.Content.V1.ContentContext.ApprovalFetchContext#
|
|
310
|
+
*
|
|
311
|
+
* @returns Object
|
|
312
|
+
*/
|
|
313
|
+
/* jshint ignore:end */
|
|
314
|
+
ApprovalFetchContext.prototype.toJSON = function toJSON() {
|
|
315
|
+
return this._solution;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
ApprovalFetchContext.prototype[util.inspect.custom] = function inspect(depth,
|
|
319
|
+
options) {
|
|
320
|
+
return util.inspect(this.toJSON(), options);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
module.exports = {
|
|
324
|
+
ApprovalFetchList: ApprovalFetchList,
|
|
325
|
+
ApprovalFetchPage: ApprovalFetchPage,
|
|
326
|
+
ApprovalFetchInstance: ApprovalFetchInstance,
|
|
327
|
+
ApprovalFetchContext: ApprovalFetchContext
|
|
328
|
+
};
|
|
@@ -0,0 +1,323 @@
|
|
|
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 { ApprovalFetchList } from './content/approvalFetch';
|
|
12
|
+
import { ApprovalFetchListInstance } from './content/approvalFetch';
|
|
13
|
+
import { SerializableClass } from '../../../interfaces';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the ContentList
|
|
17
|
+
*
|
|
18
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
19
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
20
|
+
* access, please contact help@twilio.com.
|
|
21
|
+
*
|
|
22
|
+
* @param version - Version of the resource
|
|
23
|
+
*/
|
|
24
|
+
declare function ContentList(version: V1): ContentListInstance;
|
|
25
|
+
|
|
26
|
+
interface ContentListInstance {
|
|
27
|
+
/**
|
|
28
|
+
* @param sid - sid of instance
|
|
29
|
+
*/
|
|
30
|
+
(sid: string): ContentContext;
|
|
31
|
+
/**
|
|
32
|
+
* Streams ContentInstance records from the API.
|
|
33
|
+
*
|
|
34
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
35
|
+
* is reached.
|
|
36
|
+
*
|
|
37
|
+
* The results are passed into the callback function, so this operation is memory
|
|
38
|
+
* efficient.
|
|
39
|
+
*
|
|
40
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
41
|
+
* function.
|
|
42
|
+
*
|
|
43
|
+
* @param callback - Function to process each record
|
|
44
|
+
*/
|
|
45
|
+
each(callback?: (item: ContentInstance, done: (err?: Error) => void) => void): void;
|
|
46
|
+
/**
|
|
47
|
+
* Streams ContentInstance records from the API.
|
|
48
|
+
*
|
|
49
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
50
|
+
* is reached.
|
|
51
|
+
*
|
|
52
|
+
* The results are passed into the callback function, so this operation is memory
|
|
53
|
+
* efficient.
|
|
54
|
+
*
|
|
55
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
56
|
+
* function.
|
|
57
|
+
*
|
|
58
|
+
* @param opts - Options for request
|
|
59
|
+
* @param callback - Function to process each record
|
|
60
|
+
*/
|
|
61
|
+
each(opts?: ContentListInstanceEachOptions, callback?: (item: ContentInstance, done: (err?: Error) => void) => void): void;
|
|
62
|
+
/**
|
|
63
|
+
* Constructs a content
|
|
64
|
+
*
|
|
65
|
+
* @param sid - The unique string that identifies the resource
|
|
66
|
+
*/
|
|
67
|
+
get(sid: string): ContentContext;
|
|
68
|
+
/**
|
|
69
|
+
* Retrieve a single target page of ContentInstance records from the API.
|
|
70
|
+
*
|
|
71
|
+
* The request is executed immediately.
|
|
72
|
+
*
|
|
73
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
74
|
+
* function.
|
|
75
|
+
*
|
|
76
|
+
* @param callback - Callback to handle list of records
|
|
77
|
+
*/
|
|
78
|
+
getPage(callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
|
|
79
|
+
/**
|
|
80
|
+
* Retrieve a single target page of ContentInstance records from the API.
|
|
81
|
+
*
|
|
82
|
+
* The request is executed immediately.
|
|
83
|
+
*
|
|
84
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
85
|
+
* function.
|
|
86
|
+
*
|
|
87
|
+
* @param targetUrl - API-generated URL for the requested results page
|
|
88
|
+
* @param callback - Callback to handle list of records
|
|
89
|
+
*/
|
|
90
|
+
getPage(targetUrl?: string, callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
|
|
91
|
+
/**
|
|
92
|
+
* Lists ContentInstance records from the API as a list.
|
|
93
|
+
*
|
|
94
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
95
|
+
* function.
|
|
96
|
+
*
|
|
97
|
+
* @param callback - Callback to handle list of records
|
|
98
|
+
*/
|
|
99
|
+
list(callback?: (error: Error | null, items: ContentInstance[]) => any): Promise<ContentInstance[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Lists ContentInstance records from the API as a list.
|
|
102
|
+
*
|
|
103
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
104
|
+
* function.
|
|
105
|
+
*
|
|
106
|
+
* @param opts - Options for request
|
|
107
|
+
* @param callback - Callback to handle list of records
|
|
108
|
+
*/
|
|
109
|
+
list(opts?: ContentListInstanceOptions, callback?: (error: Error | null, items: ContentInstance[]) => any): Promise<ContentInstance[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Retrieve a single page of ContentInstance records from the API.
|
|
112
|
+
*
|
|
113
|
+
* The request is executed immediately.
|
|
114
|
+
*
|
|
115
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
116
|
+
* function.
|
|
117
|
+
*
|
|
118
|
+
* @param callback - Callback to handle list of records
|
|
119
|
+
*/
|
|
120
|
+
page(callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
|
|
121
|
+
/**
|
|
122
|
+
* Retrieve a single page of ContentInstance records from the API.
|
|
123
|
+
*
|
|
124
|
+
* The request is executed immediately.
|
|
125
|
+
*
|
|
126
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
127
|
+
* function.
|
|
128
|
+
*
|
|
129
|
+
* @param opts - Options for request
|
|
130
|
+
* @param callback - Callback to handle list of records
|
|
131
|
+
*/
|
|
132
|
+
page(opts?: ContentListInstancePageOptions, callback?: (error: Error | null, items: ContentPage) => any): Promise<ContentPage>;
|
|
133
|
+
/**
|
|
134
|
+
* Provide a user-friendly representation
|
|
135
|
+
*/
|
|
136
|
+
toJSON(): any;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Options to pass to each
|
|
141
|
+
*
|
|
142
|
+
* @property callback -
|
|
143
|
+
* Function to process each record. If this and a positional
|
|
144
|
+
* callback are passed, this one will be used
|
|
145
|
+
* @property done - Function to be called upon completion of streaming
|
|
146
|
+
* @property limit -
|
|
147
|
+
* Upper limit for the number of records to return.
|
|
148
|
+
* each() guarantees never to return more than limit.
|
|
149
|
+
* Default is no limit
|
|
150
|
+
* @property pageSize -
|
|
151
|
+
* Number of records to fetch per request,
|
|
152
|
+
* when not set will use the default value of 50 records.
|
|
153
|
+
* If no pageSize is defined but a limit is defined,
|
|
154
|
+
* each() will attempt to read the limit with the most efficient
|
|
155
|
+
* page size, i.e. min(limit, 1000)
|
|
156
|
+
*/
|
|
157
|
+
interface ContentListInstanceEachOptions {
|
|
158
|
+
callback?: (item: ContentInstance, done: (err?: Error) => void) => void;
|
|
159
|
+
done?: Function;
|
|
160
|
+
limit?: number;
|
|
161
|
+
pageSize?: number;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Options to pass to list
|
|
166
|
+
*
|
|
167
|
+
* @property limit -
|
|
168
|
+
* Upper limit for the number of records to return.
|
|
169
|
+
* list() guarantees never to return more than limit.
|
|
170
|
+
* Default is no limit
|
|
171
|
+
* @property pageSize -
|
|
172
|
+
* Number of records to fetch per request,
|
|
173
|
+
* when not set will use the default value of 50 records.
|
|
174
|
+
* If no page_size is defined but a limit is defined,
|
|
175
|
+
* list() will attempt to read the limit with the most
|
|
176
|
+
* efficient page size, i.e. min(limit, 1000)
|
|
177
|
+
*/
|
|
178
|
+
interface ContentListInstanceOptions {
|
|
179
|
+
limit?: number;
|
|
180
|
+
pageSize?: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Options to pass to page
|
|
185
|
+
*
|
|
186
|
+
* @property pageNumber - Page Number, this value is simply for client state
|
|
187
|
+
* @property pageSize - Number of records to return, defaults to 50
|
|
188
|
+
* @property pageToken - PageToken provided by the API
|
|
189
|
+
*/
|
|
190
|
+
interface ContentListInstancePageOptions {
|
|
191
|
+
pageNumber?: number;
|
|
192
|
+
pageSize?: number;
|
|
193
|
+
pageToken?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface ContentPayload extends ContentResource, Page.TwilioResponsePayload {
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
interface ContentResource {
|
|
200
|
+
account_sid: string;
|
|
201
|
+
date_created: Date;
|
|
202
|
+
date_updated: Date;
|
|
203
|
+
friendly_name: string;
|
|
204
|
+
language: string;
|
|
205
|
+
links: string;
|
|
206
|
+
sid: string;
|
|
207
|
+
types: object;
|
|
208
|
+
url: string;
|
|
209
|
+
variables: object;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
interface ContentSolution {
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
declare class ContentContext {
|
|
217
|
+
/**
|
|
218
|
+
* Initialize the ContentContext
|
|
219
|
+
*
|
|
220
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
221
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
222
|
+
* access, please contact help@twilio.com.
|
|
223
|
+
*
|
|
224
|
+
* @param version - Version of the resource
|
|
225
|
+
* @param sid - The unique string that identifies the resource
|
|
226
|
+
*/
|
|
227
|
+
constructor(version: V1, sid: string);
|
|
228
|
+
|
|
229
|
+
approvalFetch: ApprovalFetchListInstance;
|
|
230
|
+
/**
|
|
231
|
+
* fetch a ContentInstance
|
|
232
|
+
*
|
|
233
|
+
* @param callback - Callback to handle processed record
|
|
234
|
+
*/
|
|
235
|
+
fetch(callback?: (error: Error | null, items: ContentInstance) => any): Promise<ContentInstance>;
|
|
236
|
+
/**
|
|
237
|
+
* remove a ContentInstance
|
|
238
|
+
*
|
|
239
|
+
* @param callback - Callback to handle processed record
|
|
240
|
+
*/
|
|
241
|
+
remove(callback?: (error: Error | null, items: ContentInstance) => any): Promise<boolean>;
|
|
242
|
+
/**
|
|
243
|
+
* Provide a user-friendly representation
|
|
244
|
+
*/
|
|
245
|
+
toJSON(): any;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
declare class ContentInstance extends SerializableClass {
|
|
250
|
+
/**
|
|
251
|
+
* Initialize the ContentContext
|
|
252
|
+
*
|
|
253
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
254
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
255
|
+
* access, please contact help@twilio.com.
|
|
256
|
+
*
|
|
257
|
+
* @param version - Version of the resource
|
|
258
|
+
* @param payload - The instance payload
|
|
259
|
+
* @param sid - The unique string that identifies the resource
|
|
260
|
+
*/
|
|
261
|
+
constructor(version: V1, payload: ContentPayload, sid: string);
|
|
262
|
+
|
|
263
|
+
private _proxy: ContentContext;
|
|
264
|
+
accountSid: string;
|
|
265
|
+
/**
|
|
266
|
+
* Access the approvalFetch
|
|
267
|
+
*/
|
|
268
|
+
approvalFetch(): ApprovalFetchListInstance;
|
|
269
|
+
dateCreated: Date;
|
|
270
|
+
dateUpdated: Date;
|
|
271
|
+
/**
|
|
272
|
+
* fetch a ContentInstance
|
|
273
|
+
*
|
|
274
|
+
* @param callback - Callback to handle processed record
|
|
275
|
+
*/
|
|
276
|
+
fetch(callback?: (error: Error | null, items: ContentInstance) => any): Promise<ContentInstance>;
|
|
277
|
+
friendlyName: string;
|
|
278
|
+
language: string;
|
|
279
|
+
links: string;
|
|
280
|
+
/**
|
|
281
|
+
* remove a ContentInstance
|
|
282
|
+
*
|
|
283
|
+
* @param callback - Callback to handle processed record
|
|
284
|
+
*/
|
|
285
|
+
remove(callback?: (error: Error | null, items: ContentInstance) => any): Promise<boolean>;
|
|
286
|
+
sid: string;
|
|
287
|
+
/**
|
|
288
|
+
* Provide a user-friendly representation
|
|
289
|
+
*/
|
|
290
|
+
toJSON(): any;
|
|
291
|
+
types: any;
|
|
292
|
+
url: string;
|
|
293
|
+
variables: any;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
declare class ContentPage extends Page<V1, ContentPayload, ContentResource, ContentInstance> {
|
|
298
|
+
/**
|
|
299
|
+
* Initialize the ContentPage
|
|
300
|
+
*
|
|
301
|
+
* PLEASE NOTE that this class contains preview products that are subject to
|
|
302
|
+
* change. Use them with caution. If you currently do not have developer preview
|
|
303
|
+
* access, please contact help@twilio.com.
|
|
304
|
+
*
|
|
305
|
+
* @param version - Version of the resource
|
|
306
|
+
* @param response - Response from the API
|
|
307
|
+
* @param solution - Path solution
|
|
308
|
+
*/
|
|
309
|
+
constructor(version: V1, response: Response<string>, solution: ContentSolution);
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Build an instance of ContentInstance
|
|
313
|
+
*
|
|
314
|
+
* @param payload - Payload response from the API
|
|
315
|
+
*/
|
|
316
|
+
getInstance(payload: ContentPayload): ContentInstance;
|
|
317
|
+
/**
|
|
318
|
+
* Provide a user-friendly representation
|
|
319
|
+
*/
|
|
320
|
+
toJSON(): any;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export { ContentContext, ContentInstance, ContentList, ContentListInstance, ContentListInstanceEachOptions, ContentListInstanceOptions, ContentListInstancePageOptions, ContentPage, ContentPayload, ContentResource, ContentSolution }
|