twilio 3.80.1 → 3.81.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/lib/base/RequestClient.d.ts +26 -2
- package/lib/base/RequestClient.js +14 -2
- package/lib/rest/routes/v2/phoneNumber.d.ts +17 -42
- package/lib/rest/routes/v2/phoneNumber.js +5 -77
- package/lib/rest/routes/v2/sipDomain.d.ts +1 -38
- package/lib/rest/routes/v2/sipDomain.js +0 -64
- package/lib/rest/routes/v2/trunk.d.ts +1 -38
- package/lib/rest/routes/v2/trunk.js +0 -68
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verification.js +1 -1
- package/lib/twiml/VoiceResponse.d.ts +2 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ declare class RequestClient {
|
|
|
5
5
|
constructor(opts?: RequestClient.RequestClientOptions);
|
|
6
6
|
/**
|
|
7
7
|
* Make an HTTP request
|
|
8
|
-
* @param opts The
|
|
8
|
+
* @param opts The options https.Agent takes in
|
|
9
9
|
*/
|
|
10
10
|
request<TData>(
|
|
11
11
|
opts: RequestClient.RequestOptions<TData>
|
|
@@ -59,9 +59,33 @@ declare namespace RequestClient {
|
|
|
59
59
|
export interface RequestClientOptions {
|
|
60
60
|
/**
|
|
61
61
|
* A timeout in milliseconds. This will be used as the HTTPS agent's socket
|
|
62
|
-
* timeout,
|
|
62
|
+
* timeout, AND as the default request timeout.
|
|
63
63
|
*/
|
|
64
64
|
timeout?: number;
|
|
65
|
+
/**
|
|
66
|
+
* https.Agent keepAlive option
|
|
67
|
+
*/
|
|
68
|
+
keepAlive?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* https.Agent keepAliveMSecs option
|
|
71
|
+
*/
|
|
72
|
+
keepAliveMsecs?: number;
|
|
73
|
+
/**
|
|
74
|
+
* https.Agent maxSockets option
|
|
75
|
+
*/
|
|
76
|
+
maxSockets?: number;
|
|
77
|
+
/**
|
|
78
|
+
* https.Agent maxTotalSockets option
|
|
79
|
+
*/
|
|
80
|
+
maxTotalSockets?: number;
|
|
81
|
+
/**
|
|
82
|
+
* https.Agent maxFreeSockets option
|
|
83
|
+
*/
|
|
84
|
+
maxFreeSockets?: number;
|
|
85
|
+
/**
|
|
86
|
+
* https.Agent scheduling option
|
|
87
|
+
*/
|
|
88
|
+
scheduling?: string;
|
|
65
89
|
}
|
|
66
90
|
|
|
67
91
|
export interface Headers {
|
|
@@ -16,8 +16,14 @@ const DEFAULT_TIMEOUT = 30000;
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Make http request
|
|
19
|
-
* @param {object} opts - The options
|
|
20
|
-
* @param {
|
|
19
|
+
* @param {object} opts - The options passed to https.Agent
|
|
20
|
+
* @param {number} opts.timeout - https.Agent timeout option. Used as the socket timeout, AND as the default request timeout.
|
|
21
|
+
* @param {boolean} opts.keepAlive - https.Agent keepAlive option
|
|
22
|
+
* @param {number} opts.keepAliveMsecs - https.Agent keepAliveMsecs option
|
|
23
|
+
* @param {number} opts.maxSockets - https.Agent maxSockets option
|
|
24
|
+
* @param {number} opts.maxTotalSockets - https.Agent maxTotalSockets option
|
|
25
|
+
* @param {number} opts.maxFreeSockets - https.Agent maxFreeSockets option
|
|
26
|
+
* @param {string} opts.scheduling - https.Agent scheduling option
|
|
21
27
|
*/
|
|
22
28
|
var RequestClient = function (opts) {
|
|
23
29
|
opts = opts || {};
|
|
@@ -26,6 +32,12 @@ var RequestClient = function (opts) {
|
|
|
26
32
|
// construct an https agent
|
|
27
33
|
let agentOpts = {
|
|
28
34
|
timeout: this.defaultTimeout,
|
|
35
|
+
keepAlive: opts.keepAlive,
|
|
36
|
+
keepAliveMsecs: opts.keepAliveMsecs,
|
|
37
|
+
maxSockets: opts.maxSockets,
|
|
38
|
+
maxTotalSockets: opts.maxTotalSockets,
|
|
39
|
+
maxFreeSockets: opts.maxFreeSockets,
|
|
40
|
+
scheduling: opts.scheduling,
|
|
29
41
|
};
|
|
30
42
|
|
|
31
43
|
let agent;
|
|
@@ -17,17 +17,6 @@ import { SerializableClass } from '../../../interfaces';
|
|
|
17
17
|
*/
|
|
18
18
|
declare function PhoneNumberList(version: V2): PhoneNumberListInstance;
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Options to pass to create
|
|
22
|
-
*
|
|
23
|
-
* @property friendlyName - A human readable description of this resource.
|
|
24
|
-
* @property voiceRegion - The Inbound Processing Region used for this phone number for voice
|
|
25
|
-
*/
|
|
26
|
-
interface PhoneNumberInstanceCreateOptions {
|
|
27
|
-
friendlyName?: string;
|
|
28
|
-
voiceRegion?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
20
|
/**
|
|
32
21
|
* Options to pass to update
|
|
33
22
|
*
|
|
@@ -35,8 +24,8 @@ interface PhoneNumberInstanceCreateOptions {
|
|
|
35
24
|
* @property voiceRegion - The Inbound Processing Region used for this phone number for voice
|
|
36
25
|
*/
|
|
37
26
|
interface PhoneNumberInstanceUpdateOptions {
|
|
38
|
-
friendlyName
|
|
39
|
-
voiceRegion
|
|
27
|
+
friendlyName?: string;
|
|
28
|
+
voiceRegion?: string;
|
|
40
29
|
}
|
|
41
30
|
|
|
42
31
|
interface PhoneNumberListInstance {
|
|
@@ -83,19 +72,6 @@ declare class PhoneNumberContext {
|
|
|
83
72
|
*/
|
|
84
73
|
constructor(version: V2, phoneNumber: string);
|
|
85
74
|
|
|
86
|
-
/**
|
|
87
|
-
* create a PhoneNumberInstance
|
|
88
|
-
*
|
|
89
|
-
* @param callback - Callback to handle processed record
|
|
90
|
-
*/
|
|
91
|
-
create(callback?: (error: Error | null, item: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
92
|
-
/**
|
|
93
|
-
* create a PhoneNumberInstance
|
|
94
|
-
*
|
|
95
|
-
* @param opts - Options for request
|
|
96
|
-
* @param callback - Callback to handle processed record
|
|
97
|
-
*/
|
|
98
|
-
create(opts?: PhoneNumberInstanceCreateOptions, callback?: (error: Error | null, item: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
99
75
|
/**
|
|
100
76
|
* fetch a PhoneNumberInstance
|
|
101
77
|
*
|
|
@@ -106,13 +82,19 @@ declare class PhoneNumberContext {
|
|
|
106
82
|
* Provide a user-friendly representation
|
|
107
83
|
*/
|
|
108
84
|
toJSON(): any;
|
|
85
|
+
/**
|
|
86
|
+
* update a PhoneNumberInstance
|
|
87
|
+
*
|
|
88
|
+
* @param callback - Callback to handle processed record
|
|
89
|
+
*/
|
|
90
|
+
update(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
109
91
|
/**
|
|
110
92
|
* update a PhoneNumberInstance
|
|
111
93
|
*
|
|
112
94
|
* @param opts - Options for request
|
|
113
95
|
* @param callback - Callback to handle processed record
|
|
114
96
|
*/
|
|
115
|
-
update(opts
|
|
97
|
+
update(opts?: PhoneNumberInstanceUpdateOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
116
98
|
}
|
|
117
99
|
|
|
118
100
|
|
|
@@ -128,19 +110,6 @@ declare class PhoneNumberInstance extends SerializableClass {
|
|
|
128
110
|
|
|
129
111
|
private _proxy: PhoneNumberContext;
|
|
130
112
|
accountSid: string;
|
|
131
|
-
/**
|
|
132
|
-
* create a PhoneNumberInstance
|
|
133
|
-
*
|
|
134
|
-
* @param callback - Callback to handle processed record
|
|
135
|
-
*/
|
|
136
|
-
create(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
137
|
-
/**
|
|
138
|
-
* create a PhoneNumberInstance
|
|
139
|
-
*
|
|
140
|
-
* @param opts - Options for request
|
|
141
|
-
* @param callback - Callback to handle processed record
|
|
142
|
-
*/
|
|
143
|
-
create(opts?: PhoneNumberInstanceCreateOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
144
113
|
dateCreated: Date;
|
|
145
114
|
dateUpdated: Date;
|
|
146
115
|
/**
|
|
@@ -156,13 +125,19 @@ declare class PhoneNumberInstance extends SerializableClass {
|
|
|
156
125
|
* Provide a user-friendly representation
|
|
157
126
|
*/
|
|
158
127
|
toJSON(): any;
|
|
128
|
+
/**
|
|
129
|
+
* update a PhoneNumberInstance
|
|
130
|
+
*
|
|
131
|
+
* @param callback - Callback to handle processed record
|
|
132
|
+
*/
|
|
133
|
+
update(callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
159
134
|
/**
|
|
160
135
|
* update a PhoneNumberInstance
|
|
161
136
|
*
|
|
162
137
|
* @param opts - Options for request
|
|
163
138
|
* @param callback - Callback to handle processed record
|
|
164
139
|
*/
|
|
165
|
-
update(opts
|
|
140
|
+
update(opts?: PhoneNumberInstanceUpdateOptions, callback?: (error: Error | null, items: PhoneNumberInstance) => any): Promise<PhoneNumberInstance>;
|
|
166
141
|
url: string;
|
|
167
142
|
voiceRegion: string;
|
|
168
143
|
}
|
|
@@ -190,4 +165,4 @@ declare class PhoneNumberPage extends Page<V2, PhoneNumberPayload, PhoneNumberRe
|
|
|
190
165
|
toJSON(): any;
|
|
191
166
|
}
|
|
192
167
|
|
|
193
|
-
export { PhoneNumberContext, PhoneNumberInstance,
|
|
168
|
+
export { PhoneNumberContext, PhoneNumberInstance, PhoneNumberInstanceUpdateOptions, PhoneNumberList, PhoneNumberListInstance, PhoneNumberPage, PhoneNumberPayload, PhoneNumberResource, PhoneNumberSolution }
|
|
@@ -210,9 +210,9 @@ Object.defineProperty(PhoneNumberInstance.prototype,
|
|
|
210
210
|
|
|
211
211
|
/* jshint ignore:start */
|
|
212
212
|
/**
|
|
213
|
-
*
|
|
213
|
+
* update a PhoneNumberInstance
|
|
214
214
|
*
|
|
215
|
-
* @function
|
|
215
|
+
* @function update
|
|
216
216
|
* @memberof Twilio.Routes.V2.PhoneNumberInstance#
|
|
217
217
|
*
|
|
218
218
|
* @param {object} [opts] - Options for request
|
|
@@ -225,27 +225,6 @@ Object.defineProperty(PhoneNumberInstance.prototype,
|
|
|
225
225
|
* @returns {Promise} Resolves to processed PhoneNumberInstance
|
|
226
226
|
*/
|
|
227
227
|
/* jshint ignore:end */
|
|
228
|
-
PhoneNumberInstance.prototype.create = function create(opts, callback) {
|
|
229
|
-
return this._proxy.create(opts, callback);
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
/* jshint ignore:start */
|
|
233
|
-
/**
|
|
234
|
-
* update a PhoneNumberInstance
|
|
235
|
-
*
|
|
236
|
-
* @function update
|
|
237
|
-
* @memberof Twilio.Routes.V2.PhoneNumberInstance#
|
|
238
|
-
*
|
|
239
|
-
* @param {object} opts - Options for request
|
|
240
|
-
* @param {string} opts.voiceRegion -
|
|
241
|
-
* The Inbound Processing Region used for this phone number for voice
|
|
242
|
-
* @param {string} opts.friendlyName -
|
|
243
|
-
* A human readable description of this resource.
|
|
244
|
-
* @param {function} [callback] - Callback to handle processed record
|
|
245
|
-
*
|
|
246
|
-
* @returns {Promise} Resolves to processed PhoneNumberInstance
|
|
247
|
-
*/
|
|
248
|
-
/* jshint ignore:end */
|
|
249
228
|
PhoneNumberInstance.prototype.update = function update(opts, callback) {
|
|
250
229
|
return this._proxy.update(opts, callback);
|
|
251
230
|
};
|
|
@@ -312,9 +291,9 @@ PhoneNumberContext = function PhoneNumberContext(version, phoneNumber) {
|
|
|
312
291
|
|
|
313
292
|
/* jshint ignore:start */
|
|
314
293
|
/**
|
|
315
|
-
*
|
|
294
|
+
* update a PhoneNumberInstance
|
|
316
295
|
*
|
|
317
|
-
* @function
|
|
296
|
+
* @function update
|
|
318
297
|
* @memberof Twilio.Routes.V2.PhoneNumberContext#
|
|
319
298
|
*
|
|
320
299
|
* @param {object} [opts] - Options for request
|
|
@@ -327,7 +306,7 @@ PhoneNumberContext = function PhoneNumberContext(version, phoneNumber) {
|
|
|
327
306
|
* @returns {Promise} Resolves to processed PhoneNumberInstance
|
|
328
307
|
*/
|
|
329
308
|
/* jshint ignore:end */
|
|
330
|
-
PhoneNumberContext.prototype.
|
|
309
|
+
PhoneNumberContext.prototype.update = function update(opts, callback) {
|
|
331
310
|
if (_.isFunction(opts)) {
|
|
332
311
|
callback = opts;
|
|
333
312
|
opts = {};
|
|
@@ -340,57 +319,6 @@ PhoneNumberContext.prototype.create = function create(opts, callback) {
|
|
|
340
319
|
'FriendlyName': _.get(opts, 'friendlyName')
|
|
341
320
|
});
|
|
342
321
|
|
|
343
|
-
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
344
|
-
|
|
345
|
-
promise = promise.then(function(payload) {
|
|
346
|
-
deferred.resolve(new PhoneNumberInstance(this._version, payload, this._solution.phoneNumber));
|
|
347
|
-
}.bind(this));
|
|
348
|
-
|
|
349
|
-
promise.catch(function(error) {
|
|
350
|
-
deferred.reject(error);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
if (_.isFunction(callback)) {
|
|
354
|
-
deferred.promise.nodeify(callback);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return deferred.promise;
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
/* jshint ignore:start */
|
|
361
|
-
/**
|
|
362
|
-
* update a PhoneNumberInstance
|
|
363
|
-
*
|
|
364
|
-
* @function update
|
|
365
|
-
* @memberof Twilio.Routes.V2.PhoneNumberContext#
|
|
366
|
-
*
|
|
367
|
-
* @param {object} opts - Options for request
|
|
368
|
-
* @param {string} opts.voiceRegion -
|
|
369
|
-
* The Inbound Processing Region used for this phone number for voice
|
|
370
|
-
* @param {string} opts.friendlyName -
|
|
371
|
-
* A human readable description of this resource.
|
|
372
|
-
* @param {function} [callback] - Callback to handle processed record
|
|
373
|
-
*
|
|
374
|
-
* @returns {Promise} Resolves to processed PhoneNumberInstance
|
|
375
|
-
*/
|
|
376
|
-
/* jshint ignore:end */
|
|
377
|
-
PhoneNumberContext.prototype.update = function update(opts, callback) {
|
|
378
|
-
if (_.isUndefined(opts)) {
|
|
379
|
-
throw new Error('Required parameter "opts" missing.');
|
|
380
|
-
}
|
|
381
|
-
if (_.isUndefined(opts['voiceRegion'])) {
|
|
382
|
-
throw new Error('Required parameter "opts[\'voiceRegion\']" missing.');
|
|
383
|
-
}
|
|
384
|
-
if (_.isUndefined(opts['friendlyName'])) {
|
|
385
|
-
throw new Error('Required parameter "opts[\'friendlyName\']" missing.');
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
var deferred = Q.defer();
|
|
389
|
-
var data = values.of({
|
|
390
|
-
'VoiceRegion': _.get(opts, 'voiceRegion'),
|
|
391
|
-
'FriendlyName': _.get(opts, 'friendlyName')
|
|
392
|
-
});
|
|
393
|
-
|
|
394
322
|
var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
|
|
395
323
|
|
|
396
324
|
promise = promise.then(function(payload) {
|
|
@@ -17,17 +17,6 @@ import { SerializableClass } from '../../../interfaces';
|
|
|
17
17
|
*/
|
|
18
18
|
declare function SipDomainList(version: V2): SipDomainListInstance;
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Options to pass to create
|
|
22
|
-
*
|
|
23
|
-
* @property friendlyName - The friendly_name
|
|
24
|
-
* @property voiceRegion - The voice_region
|
|
25
|
-
*/
|
|
26
|
-
interface SipDomainInstanceCreateOptions {
|
|
27
|
-
friendlyName?: string;
|
|
28
|
-
voiceRegion?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
20
|
/**
|
|
32
21
|
* Options to pass to update
|
|
33
22
|
*
|
|
@@ -83,19 +72,6 @@ declare class SipDomainContext {
|
|
|
83
72
|
*/
|
|
84
73
|
constructor(version: V2, sipDomain: string);
|
|
85
74
|
|
|
86
|
-
/**
|
|
87
|
-
* create a SipDomainInstance
|
|
88
|
-
*
|
|
89
|
-
* @param callback - Callback to handle processed record
|
|
90
|
-
*/
|
|
91
|
-
create(callback?: (error: Error | null, item: SipDomainInstance) => any): Promise<SipDomainInstance>;
|
|
92
|
-
/**
|
|
93
|
-
* create a SipDomainInstance
|
|
94
|
-
*
|
|
95
|
-
* @param opts - Options for request
|
|
96
|
-
* @param callback - Callback to handle processed record
|
|
97
|
-
*/
|
|
98
|
-
create(opts?: SipDomainInstanceCreateOptions, callback?: (error: Error | null, item: SipDomainInstance) => any): Promise<SipDomainInstance>;
|
|
99
75
|
/**
|
|
100
76
|
* fetch a SipDomainInstance
|
|
101
77
|
*
|
|
@@ -134,19 +110,6 @@ declare class SipDomainInstance extends SerializableClass {
|
|
|
134
110
|
|
|
135
111
|
private _proxy: SipDomainContext;
|
|
136
112
|
accountSid: string;
|
|
137
|
-
/**
|
|
138
|
-
* create a SipDomainInstance
|
|
139
|
-
*
|
|
140
|
-
* @param callback - Callback to handle processed record
|
|
141
|
-
*/
|
|
142
|
-
create(callback?: (error: Error | null, items: SipDomainInstance) => any): Promise<SipDomainInstance>;
|
|
143
|
-
/**
|
|
144
|
-
* create a SipDomainInstance
|
|
145
|
-
*
|
|
146
|
-
* @param opts - Options for request
|
|
147
|
-
* @param callback - Callback to handle processed record
|
|
148
|
-
*/
|
|
149
|
-
create(opts?: SipDomainInstanceCreateOptions, callback?: (error: Error | null, items: SipDomainInstance) => any): Promise<SipDomainInstance>;
|
|
150
113
|
dateCreated: Date;
|
|
151
114
|
dateUpdated: Date;
|
|
152
115
|
/**
|
|
@@ -202,4 +165,4 @@ declare class SipDomainPage extends Page<V2, SipDomainPayload, SipDomainResource
|
|
|
202
165
|
toJSON(): any;
|
|
203
166
|
}
|
|
204
167
|
|
|
205
|
-
export { SipDomainContext, SipDomainInstance,
|
|
168
|
+
export { SipDomainContext, SipDomainInstance, SipDomainInstanceUpdateOptions, SipDomainList, SipDomainListInstance, SipDomainPage, SipDomainPayload, SipDomainResource, SipDomainSolution }
|
|
@@ -201,25 +201,6 @@ Object.defineProperty(SipDomainInstance.prototype,
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
/* jshint ignore:start */
|
|
205
|
-
/**
|
|
206
|
-
* create a SipDomainInstance
|
|
207
|
-
*
|
|
208
|
-
* @function create
|
|
209
|
-
* @memberof Twilio.Routes.V2.SipDomainInstance#
|
|
210
|
-
*
|
|
211
|
-
* @param {object} [opts] - Options for request
|
|
212
|
-
* @param {string} [opts.voiceRegion] - The voice_region
|
|
213
|
-
* @param {string} [opts.friendlyName] - The friendly_name
|
|
214
|
-
* @param {function} [callback] - Callback to handle processed record
|
|
215
|
-
*
|
|
216
|
-
* @returns {Promise} Resolves to processed SipDomainInstance
|
|
217
|
-
*/
|
|
218
|
-
/* jshint ignore:end */
|
|
219
|
-
SipDomainInstance.prototype.create = function create(opts, callback) {
|
|
220
|
-
return this._proxy.create(opts, callback);
|
|
221
|
-
};
|
|
222
|
-
|
|
223
204
|
/* jshint ignore:start */
|
|
224
205
|
/**
|
|
225
206
|
* update a SipDomainInstance
|
|
@@ -299,51 +280,6 @@ SipDomainContext = function SipDomainContext(version, sipDomain) {
|
|
|
299
280
|
this._uri = `/SipDomains/${sipDomain}`;
|
|
300
281
|
};
|
|
301
282
|
|
|
302
|
-
/* jshint ignore:start */
|
|
303
|
-
/**
|
|
304
|
-
* create a SipDomainInstance
|
|
305
|
-
*
|
|
306
|
-
* @function create
|
|
307
|
-
* @memberof Twilio.Routes.V2.SipDomainContext#
|
|
308
|
-
*
|
|
309
|
-
* @param {object} [opts] - Options for request
|
|
310
|
-
* @param {string} [opts.voiceRegion] - The voice_region
|
|
311
|
-
* @param {string} [opts.friendlyName] - The friendly_name
|
|
312
|
-
* @param {function} [callback] - Callback to handle processed record
|
|
313
|
-
*
|
|
314
|
-
* @returns {Promise} Resolves to processed SipDomainInstance
|
|
315
|
-
*/
|
|
316
|
-
/* jshint ignore:end */
|
|
317
|
-
SipDomainContext.prototype.create = function create(opts, callback) {
|
|
318
|
-
if (_.isFunction(opts)) {
|
|
319
|
-
callback = opts;
|
|
320
|
-
opts = {};
|
|
321
|
-
}
|
|
322
|
-
opts = opts || {};
|
|
323
|
-
|
|
324
|
-
var deferred = Q.defer();
|
|
325
|
-
var data = values.of({
|
|
326
|
-
'VoiceRegion': _.get(opts, 'voiceRegion'),
|
|
327
|
-
'FriendlyName': _.get(opts, 'friendlyName')
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
331
|
-
|
|
332
|
-
promise = promise.then(function(payload) {
|
|
333
|
-
deferred.resolve(new SipDomainInstance(this._version, payload, this._solution.sipDomain));
|
|
334
|
-
}.bind(this));
|
|
335
|
-
|
|
336
|
-
promise.catch(function(error) {
|
|
337
|
-
deferred.reject(error);
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
if (_.isFunction(callback)) {
|
|
341
|
-
deferred.promise.nodeify(callback);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return deferred.promise;
|
|
345
|
-
};
|
|
346
|
-
|
|
347
283
|
/* jshint ignore:start */
|
|
348
284
|
/**
|
|
349
285
|
* update a SipDomainInstance
|
|
@@ -17,17 +17,6 @@ import { SerializableClass } from '../../../interfaces';
|
|
|
17
17
|
*/
|
|
18
18
|
declare function TrunkList(version: V2): TrunkListInstance;
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Options to pass to create
|
|
22
|
-
*
|
|
23
|
-
* @property friendlyName - A human readable description of this resource.
|
|
24
|
-
* @property voiceRegion - The Inbound Processing Region used for this SIP Trunk for voice
|
|
25
|
-
*/
|
|
26
|
-
interface TrunkInstanceCreateOptions {
|
|
27
|
-
friendlyName?: string;
|
|
28
|
-
voiceRegion?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
20
|
/**
|
|
32
21
|
* Options to pass to update
|
|
33
22
|
*
|
|
@@ -83,19 +72,6 @@ declare class TrunkContext {
|
|
|
83
72
|
*/
|
|
84
73
|
constructor(version: V2, sipTrunkDomain: string);
|
|
85
74
|
|
|
86
|
-
/**
|
|
87
|
-
* create a TrunkInstance
|
|
88
|
-
*
|
|
89
|
-
* @param callback - Callback to handle processed record
|
|
90
|
-
*/
|
|
91
|
-
create(callback?: (error: Error | null, item: TrunkInstance) => any): Promise<TrunkInstance>;
|
|
92
|
-
/**
|
|
93
|
-
* create a TrunkInstance
|
|
94
|
-
*
|
|
95
|
-
* @param opts - Options for request
|
|
96
|
-
* @param callback - Callback to handle processed record
|
|
97
|
-
*/
|
|
98
|
-
create(opts?: TrunkInstanceCreateOptions, callback?: (error: Error | null, item: TrunkInstance) => any): Promise<TrunkInstance>;
|
|
99
75
|
/**
|
|
100
76
|
* fetch a TrunkInstance
|
|
101
77
|
*
|
|
@@ -134,19 +110,6 @@ declare class TrunkInstance extends SerializableClass {
|
|
|
134
110
|
|
|
135
111
|
private _proxy: TrunkContext;
|
|
136
112
|
accountSid: string;
|
|
137
|
-
/**
|
|
138
|
-
* create a TrunkInstance
|
|
139
|
-
*
|
|
140
|
-
* @param callback - Callback to handle processed record
|
|
141
|
-
*/
|
|
142
|
-
create(callback?: (error: Error | null, items: TrunkInstance) => any): Promise<TrunkInstance>;
|
|
143
|
-
/**
|
|
144
|
-
* create a TrunkInstance
|
|
145
|
-
*
|
|
146
|
-
* @param opts - Options for request
|
|
147
|
-
* @param callback - Callback to handle processed record
|
|
148
|
-
*/
|
|
149
|
-
create(opts?: TrunkInstanceCreateOptions, callback?: (error: Error | null, items: TrunkInstance) => any): Promise<TrunkInstance>;
|
|
150
113
|
dateCreated: Date;
|
|
151
114
|
dateUpdated: Date;
|
|
152
115
|
/**
|
|
@@ -202,4 +165,4 @@ declare class TrunkPage extends Page<V2, TrunkPayload, TrunkResource, TrunkInsta
|
|
|
202
165
|
toJSON(): any;
|
|
203
166
|
}
|
|
204
167
|
|
|
205
|
-
export { TrunkContext, TrunkInstance,
|
|
168
|
+
export { TrunkContext, TrunkInstance, TrunkInstanceUpdateOptions, TrunkList, TrunkListInstance, TrunkPage, TrunkPayload, TrunkResource, TrunkSolution }
|
|
@@ -205,27 +205,6 @@ Object.defineProperty(TrunkInstance.prototype,
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
-
/* jshint ignore:start */
|
|
209
|
-
/**
|
|
210
|
-
* create a TrunkInstance
|
|
211
|
-
*
|
|
212
|
-
* @function create
|
|
213
|
-
* @memberof Twilio.Routes.V2.TrunkInstance#
|
|
214
|
-
*
|
|
215
|
-
* @param {object} [opts] - Options for request
|
|
216
|
-
* @param {string} [opts.voiceRegion] -
|
|
217
|
-
* The Inbound Processing Region used for this SIP Trunk for voice
|
|
218
|
-
* @param {string} [opts.friendlyName] -
|
|
219
|
-
* A human readable description of this resource.
|
|
220
|
-
* @param {function} [callback] - Callback to handle processed record
|
|
221
|
-
*
|
|
222
|
-
* @returns {Promise} Resolves to processed TrunkInstance
|
|
223
|
-
*/
|
|
224
|
-
/* jshint ignore:end */
|
|
225
|
-
TrunkInstance.prototype.create = function create(opts, callback) {
|
|
226
|
-
return this._proxy.create(opts, callback);
|
|
227
|
-
};
|
|
228
|
-
|
|
229
208
|
/* jshint ignore:start */
|
|
230
209
|
/**
|
|
231
210
|
* update a TrunkInstance
|
|
@@ -307,53 +286,6 @@ TrunkContext = function TrunkContext(version, sipTrunkDomain) {
|
|
|
307
286
|
this._uri = `/Trunks/${sipTrunkDomain}`;
|
|
308
287
|
};
|
|
309
288
|
|
|
310
|
-
/* jshint ignore:start */
|
|
311
|
-
/**
|
|
312
|
-
* create a TrunkInstance
|
|
313
|
-
*
|
|
314
|
-
* @function create
|
|
315
|
-
* @memberof Twilio.Routes.V2.TrunkContext#
|
|
316
|
-
*
|
|
317
|
-
* @param {object} [opts] - Options for request
|
|
318
|
-
* @param {string} [opts.voiceRegion] -
|
|
319
|
-
* The Inbound Processing Region used for this SIP Trunk for voice
|
|
320
|
-
* @param {string} [opts.friendlyName] -
|
|
321
|
-
* A human readable description of this resource.
|
|
322
|
-
* @param {function} [callback] - Callback to handle processed record
|
|
323
|
-
*
|
|
324
|
-
* @returns {Promise} Resolves to processed TrunkInstance
|
|
325
|
-
*/
|
|
326
|
-
/* jshint ignore:end */
|
|
327
|
-
TrunkContext.prototype.create = function create(opts, callback) {
|
|
328
|
-
if (_.isFunction(opts)) {
|
|
329
|
-
callback = opts;
|
|
330
|
-
opts = {};
|
|
331
|
-
}
|
|
332
|
-
opts = opts || {};
|
|
333
|
-
|
|
334
|
-
var deferred = Q.defer();
|
|
335
|
-
var data = values.of({
|
|
336
|
-
'VoiceRegion': _.get(opts, 'voiceRegion'),
|
|
337
|
-
'FriendlyName': _.get(opts, 'friendlyName')
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
341
|
-
|
|
342
|
-
promise = promise.then(function(payload) {
|
|
343
|
-
deferred.resolve(new TrunkInstance(this._version, payload, this._solution.sipTrunkDomain));
|
|
344
|
-
}.bind(this));
|
|
345
|
-
|
|
346
|
-
promise.catch(function(error) {
|
|
347
|
-
deferred.reject(error);
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
if (_.isFunction(callback)) {
|
|
351
|
-
deferred.promise.nodeify(callback);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return deferred.promise;
|
|
355
|
-
};
|
|
356
|
-
|
|
357
289
|
/* jshint ignore:start */
|
|
358
290
|
/**
|
|
359
291
|
* update a TrunkInstance
|
|
@@ -65,7 +65,7 @@ interface VerificationListInstance {
|
|
|
65
65
|
* @property customCode - A pre-generated code
|
|
66
66
|
* @property customFriendlyName - A custom user defined friendly name
|
|
67
67
|
* @property customMessage - The text of a custom message to use for the verification
|
|
68
|
-
* @property locale - The locale to use for the verification SMS, WhatsApp or call
|
|
68
|
+
* @property locale - The override locale to use for the verification SMS, WhatsApp or call
|
|
69
69
|
* @property payee - The payee of the associated PSD2 compliant transaction
|
|
70
70
|
* @property rateLimits - The custom key-value pairs of Programmable Rate Limits.
|
|
71
71
|
* @property sendDigits - The digits to send after a phone call is answered
|
|
@@ -69,7 +69,7 @@ VerificationList = function VerificationList(version, serviceSid) {
|
|
|
69
69
|
* @param {string} [opts.sendDigits] -
|
|
70
70
|
* The digits to send after a phone call is answered
|
|
71
71
|
* @param {string} [opts.locale] -
|
|
72
|
-
* The locale to use for the verification SMS, WhatsApp or call
|
|
72
|
+
* The override locale to use for the verification SMS, WhatsApp or call
|
|
73
73
|
* @param {string} [opts.customCode] - A pre-generated code
|
|
74
74
|
* @param {string} [opts.amount] -
|
|
75
75
|
* The amount of the associated PSD2 compliant transaction.
|
|
@@ -259,7 +259,7 @@ declare namespace VoiceResponse {
|
|
|
259
259
|
|
|
260
260
|
type SayLanguage = 'arb'|'ca-ES'|'cy-GB'|'da-DK'|'de-DE'|'de-AT'|'en-AU'|'en-CA'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-NZ'|'en-ZA'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fi-FI'|'fr-CA'|'fr-FR'|'hi-IN'|'is-IS'|'it-IT'|'ja-JP'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'|'zh-CN'|'zh-HK'|'zh-TW';
|
|
261
261
|
|
|
262
|
-
type SayVoice = 'man'|'woman'|'alice'|'Polly.Aditi'|'Polly.Amy'|'Polly.Astrid'|'Polly.Bianca'|'Polly.Brian'|'Polly.Camila'|'Polly.Carla'|'Polly.Carmen'|'Polly.Celine'|'Polly.Chantal'|'Polly.Conchita'|'Polly.Cristiano'|'Polly.Dora'|'Polly.Emma'|'Polly.Enrique'|'Polly.Ewa'|'Polly.Filiz'|'Polly.Geraint'|'Polly.Giorgio'|'Polly.Gwyneth'|'Polly.Hans'|'Polly.Ines'|'Polly.Ivy'|'Polly.Jacek'|'Polly.Jan'|'Polly.Joanna'|'Polly.Joey'|'Polly.Justin'|'Polly.Karl'|'Polly.Kendra'|'Polly.Kimberly'|'Polly.Lea'|'Polly.Liv'|'Polly.Lotte'|'Polly.Lucia'|'Polly.Lupe'|'Polly.Mads'|'Polly.Maja'|'Polly.Marlene'|'Polly.Mathieu'|'Polly.Matthew'|'Polly.Maxim'|'Polly.Mia'|'Polly.Miguel'|'Polly.Mizuki'|'Polly.Naja'|'Polly.Nicole'|'Polly.Penelope'|'Polly.Raveena'|'Polly.Ricardo'|'Polly.Ruben'|'Polly.Russell'|'Polly.Salli'|'Polly.Seoyeon'|'Polly.Takumi'|'Polly.Tatyana'|'Polly.Vicki'|'Polly.Vitoria'|'Polly.Zeina'|'Polly.Zhiyu'|'Polly.Amy-Neural'|'Polly.
|
|
262
|
+
type SayVoice = 'man'|'woman'|'alice'|'Polly.Aditi'|'Polly.Amy'|'Polly.Astrid'|'Polly.Bianca'|'Polly.Brian'|'Polly.Camila'|'Polly.Carla'|'Polly.Carmen'|'Polly.Celine'|'Polly.Chantal'|'Polly.Conchita'|'Polly.Cristiano'|'Polly.Dora'|'Polly.Emma'|'Polly.Enrique'|'Polly.Ewa'|'Polly.Filiz'|'Polly.Geraint'|'Polly.Giorgio'|'Polly.Gwyneth'|'Polly.Hans'|'Polly.Ines'|'Polly.Ivy'|'Polly.Jacek'|'Polly.Jan'|'Polly.Joanna'|'Polly.Joey'|'Polly.Justin'|'Polly.Karl'|'Polly.Kendra'|'Polly.Kimberly'|'Polly.Lea'|'Polly.Liv'|'Polly.Lotte'|'Polly.Lucia'|'Polly.Lupe'|'Polly.Mads'|'Polly.Maja'|'Polly.Marlene'|'Polly.Mathieu'|'Polly.Matthew'|'Polly.Maxim'|'Polly.Mia'|'Polly.Miguel'|'Polly.Mizuki'|'Polly.Naja'|'Polly.Nicole'|'Polly.Penelope'|'Polly.Raveena'|'Polly.Ricardo'|'Polly.Ruben'|'Polly.Russell'|'Polly.Salli'|'Polly.Seoyeon'|'Polly.Takumi'|'Polly.Tatyana'|'Polly.Vicki'|'Polly.Vitoria'|'Polly.Zeina'|'Polly.Zhiyu'|'Polly.Amy-Neural'|'Polly.Aria-Neural'|'Polly.Arlet-Neural'|'Polly.Arthur-Neural'|'Polly.Ayanda-Neural'|'Polly.Bianca-Neural'|'Polly.Brian-Neural'|'Polly.Camila-Neural'|'Polly.Daniel-Neural'|'Polly.Emma-Neural'|'Polly.Gabrielle-Neural'|'Polly.Hannah-Neural'|'Polly.Ines-Neural'|'Polly.Ivy-Neural'|'Polly.Joanna-Neural'|'Polly.Joey-Neural'|'Polly.Justin-Neural'|'Polly.Kajal-Neural'|'Polly.Kendra-Neural'|'Polly.Kevin-Neural'|'Polly.Kimberly-Neural'|'Polly.Lea-Neural'|'Polly.Liam-Neural'|'Polly.Lucia-Neural'|'Polly.Lupe-Neural'|'Polly.Matthew-Neural'|'Polly.Mia-Neural'|'Polly.Olivia-Neural'|'Polly.Pedro-Neural'|'Polly.Salli-Neural'|'Polly.Seoyeon-Neural'|'Polly.Takumi-Neural'|'Polly.Vicki-Neural'|'Polly.Vitoria-Neural';
|
|
263
263
|
|
|
264
264
|
type SipEvent = 'initiated'|'ringing'|'answered'|'completed';
|
|
265
265
|
|
|
@@ -269,7 +269,7 @@ declare namespace VoiceResponse {
|
|
|
269
269
|
|
|
270
270
|
type SsmlEmphasisLevel = 'strong'|'moderate'|'reduced';
|
|
271
271
|
|
|
272
|
-
type SsmlLangXmlLang = 'da-DK'|'
|
|
272
|
+
type SsmlLangXmlLang = 'arb'|'ca-ES'|'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'de-AT'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-NZ'|'en-US'|'en-ZA'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'hi-IN'|'is-IS'|'it-IT'|'ja-JP'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR';
|
|
273
273
|
|
|
274
274
|
type SsmlPhonemeAlphabet = 'ipa'|'x-sampa';
|
|
275
275
|
|