twilio 3.78.0 → 3.79.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.
@@ -505,7 +505,8 @@ ParticipantPage.prototype[util.inspect.custom] = function inspect(depth,
505
505
  * @param {ParticipantPayload} payload - The instance payload
506
506
  * @param {sid} conversationSid -
507
507
  * The unique ID of the Conversation for this participant.
508
- * @param {sid} sid - A 34 character string that uniquely identifies this resource.
508
+ * @param {sid_like} sid -
509
+ * A 34 character string that uniquely identifies this resource.
509
510
  */
510
511
  /* jshint ignore:end */
511
512
  ParticipantInstance = function ParticipantInstance(version, payload,
@@ -651,7 +652,8 @@ ParticipantInstance.prototype[util.inspect.custom] = function inspect(depth,
651
652
  * @param {V1} version - Version of the resource
652
653
  * @param {sid_like} conversationSid -
653
654
  * The unique ID of the Conversation for this participant.
654
- * @param {sid} sid - A 34 character string that uniquely identifies this resource.
655
+ * @param {sid_like} sid -
656
+ * A 34 character string that uniquely identifies this resource.
655
657
  */
656
658
  /* jshint ignore:end */
657
659
  ParticipantContext = function ParticipantContext(version, conversationSid, sid)
@@ -527,7 +527,8 @@ ParticipantPage.prototype[util.inspect.custom] = function inspect(depth,
527
527
  * The SID of the Conversation Service that the resource is associated with.
528
528
  * @param {sid} conversationSid -
529
529
  * The unique ID of the Conversation for this participant.
530
- * @param {sid} sid - A 34 character string that uniquely identifies this resource.
530
+ * @param {sid_like} sid -
531
+ * A 34 character string that uniquely identifies this resource.
531
532
  */
532
533
  /* jshint ignore:end */
533
534
  ParticipantInstance = function ParticipantInstance(version, payload,
@@ -682,7 +683,8 @@ ParticipantInstance.prototype[util.inspect.custom] = function inspect(depth,
682
683
  * The SID of the Conversation Service that the resource is associated with.
683
684
  * @param {sid_like} conversationSid -
684
685
  * The unique ID of the Conversation for this participant.
685
- * @param {sid} sid - A 34 character string that uniquely identifies this resource.
686
+ * @param {sid_like} sid -
687
+ * A 34 character string that uniquely identifies this resource.
686
688
  */
687
689
  /* jshint ignore:end */
688
690
  ParticipantContext = function ParticipantContext(version, chatServiceSid,
@@ -60,7 +60,6 @@ interface PhoneNumberResource {
60
60
  caller_name: object;
61
61
  calling_country_code: string;
62
62
  country_code: string;
63
- enhanced_line_type: object;
64
63
  line_type_intelligence: object;
65
64
  live_activity: object;
66
65
  national_format: string;
@@ -125,7 +124,6 @@ declare class PhoneNumberInstance extends SerializableClass {
125
124
  callerName: any;
126
125
  callingCountryCode: string;
127
126
  countryCode: string;
128
- enhancedLineType: any;
129
127
  /**
130
128
  * fetch a PhoneNumberInstance
131
129
  *
@@ -179,8 +179,6 @@ PhoneNumberPage.prototype[util.inspect.custom] = function inspect(depth,
179
179
  * An object that contains call forwarding status information
180
180
  * @property {object} liveActivity -
181
181
  * An object that contains live activity information
182
- * @property {object} enhancedLineType -
183
- * An object that contains line type information
184
182
  * @property {object} lineTypeIntelligence -
185
183
  * An object that contains line type information
186
184
  * @property {string} url - The absolute URL of the resource
@@ -205,7 +203,6 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload,
205
203
  this.simSwap = payload.sim_swap; // jshint ignore:line
206
204
  this.callForwarding = payload.call_forwarding; // jshint ignore:line
207
205
  this.liveActivity = payload.live_activity; // jshint ignore:line
208
- this.enhancedLineType = payload.enhanced_line_type; // jshint ignore:line
209
206
  this.lineTypeIntelligence = payload.line_type_intelligence; // jshint ignore:line
210
207
  this.url = payload.url; // jshint ignore:line
211
208
 
@@ -0,0 +1,246 @@
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
+ type SimIpAddressIpAddressVersion = 'IPv4'|'IPv6';
14
+
15
+ /**
16
+ * Initialize the SimIpAddressList
17
+ *
18
+ * PLEASE NOTE that this class contains beta products that are subject to change.
19
+ * Use them with caution.
20
+ *
21
+ * @param version - Version of the resource
22
+ * @param simSid - The unique string that identifies the resource
23
+ */
24
+ declare function SimIpAddressList(version: V1, simSid: string): SimIpAddressListInstance;
25
+
26
+ interface SimIpAddressListInstance {
27
+ /**
28
+ * Streams SimIpAddressInstance records from the API.
29
+ *
30
+ * This operation lazily loads records as efficiently as possible until the limit
31
+ * is reached.
32
+ *
33
+ * The results are passed into the callback function, so this operation is memory
34
+ * efficient.
35
+ *
36
+ * If a function is passed as the first argument, it will be used as the callback
37
+ * function.
38
+ *
39
+ * @param callback - Function to process each record
40
+ */
41
+ each(callback?: (item: SimIpAddressInstance, done: (err?: Error) => void) => void): void;
42
+ /**
43
+ * Streams SimIpAddressInstance records from the API.
44
+ *
45
+ * This operation lazily loads records as efficiently as possible until the limit
46
+ * is reached.
47
+ *
48
+ * The results are passed into the callback function, so this operation is memory
49
+ * efficient.
50
+ *
51
+ * If a function is passed as the first argument, it will be used as the callback
52
+ * function.
53
+ *
54
+ * @param opts - Options for request
55
+ * @param callback - Function to process each record
56
+ */
57
+ each(opts?: SimIpAddressListInstanceEachOptions, callback?: (item: SimIpAddressInstance, done: (err?: Error) => void) => void): void;
58
+ /**
59
+ * Retrieve a single target page of SimIpAddressInstance records from the API.
60
+ *
61
+ * The request is executed immediately.
62
+ *
63
+ * If a function is passed as the first argument, it will be used as the callback
64
+ * function.
65
+ *
66
+ * @param callback - Callback to handle list of records
67
+ */
68
+ getPage(callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise<SimIpAddressPage>;
69
+ /**
70
+ * Retrieve a single target page of SimIpAddressInstance records from the API.
71
+ *
72
+ * The request is executed immediately.
73
+ *
74
+ * If a function is passed as the first argument, it will be used as the callback
75
+ * function.
76
+ *
77
+ * @param targetUrl - API-generated URL for the requested results page
78
+ * @param callback - Callback to handle list of records
79
+ */
80
+ getPage(targetUrl?: string, callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise<SimIpAddressPage>;
81
+ /**
82
+ * Lists SimIpAddressInstance records from the API as a list.
83
+ *
84
+ * If a function is passed as the first argument, it will be used as the callback
85
+ * function.
86
+ *
87
+ * @param callback - Callback to handle list of records
88
+ */
89
+ list(callback?: (error: Error | null, items: SimIpAddressInstance[]) => any): Promise<SimIpAddressInstance[]>;
90
+ /**
91
+ * Lists SimIpAddressInstance records from the API as a list.
92
+ *
93
+ * If a function is passed as the first argument, it will be used as the callback
94
+ * function.
95
+ *
96
+ * @param opts - Options for request
97
+ * @param callback - Callback to handle list of records
98
+ */
99
+ list(opts?: SimIpAddressListInstanceOptions, callback?: (error: Error | null, items: SimIpAddressInstance[]) => any): Promise<SimIpAddressInstance[]>;
100
+ /**
101
+ * Retrieve a single page of SimIpAddressInstance records from the API.
102
+ *
103
+ * The request is executed immediately.
104
+ *
105
+ * If a function is passed as the first argument, it will be used as the callback
106
+ * function.
107
+ *
108
+ * @param callback - Callback to handle list of records
109
+ */
110
+ page(callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise<SimIpAddressPage>;
111
+ /**
112
+ * Retrieve a single page of SimIpAddressInstance records from the API.
113
+ *
114
+ * The request is executed immediately.
115
+ *
116
+ * If a function is passed as the first argument, it will be used as the callback
117
+ * function.
118
+ *
119
+ * @param opts - Options for request
120
+ * @param callback - Callback to handle list of records
121
+ */
122
+ page(opts?: SimIpAddressListInstancePageOptions, callback?: (error: Error | null, items: SimIpAddressPage) => any): Promise<SimIpAddressPage>;
123
+ /**
124
+ * Provide a user-friendly representation
125
+ */
126
+ toJSON(): any;
127
+ }
128
+
129
+ /**
130
+ * Options to pass to each
131
+ *
132
+ * @property callback -
133
+ * Function to process each record. If this and a positional
134
+ * callback are passed, this one will be used
135
+ * @property done - Function to be called upon completion of streaming
136
+ * @property limit -
137
+ * Upper limit for the number of records to return.
138
+ * each() guarantees never to return more than limit.
139
+ * Default is no limit
140
+ * @property pageSize -
141
+ * Number of records to fetch per request,
142
+ * when not set will use the default value of 50 records.
143
+ * If no pageSize is defined but a limit is defined,
144
+ * each() will attempt to read the limit with the most efficient
145
+ * page size, i.e. min(limit, 1000)
146
+ */
147
+ interface SimIpAddressListInstanceEachOptions {
148
+ callback?: (item: SimIpAddressInstance, done: (err?: Error) => void) => void;
149
+ done?: Function;
150
+ limit?: number;
151
+ pageSize?: number;
152
+ }
153
+
154
+ /**
155
+ * Options to pass to list
156
+ *
157
+ * @property limit -
158
+ * Upper limit for the number of records to return.
159
+ * list() guarantees never to return more than limit.
160
+ * Default is no limit
161
+ * @property pageSize -
162
+ * Number of records to fetch per request,
163
+ * when not set will use the default value of 50 records.
164
+ * If no page_size is defined but a limit is defined,
165
+ * list() will attempt to read the limit with the most
166
+ * efficient page size, i.e. min(limit, 1000)
167
+ */
168
+ interface SimIpAddressListInstanceOptions {
169
+ limit?: number;
170
+ pageSize?: number;
171
+ }
172
+
173
+ /**
174
+ * Options to pass to page
175
+ *
176
+ * @property pageNumber - Page Number, this value is simply for client state
177
+ * @property pageSize - Number of records to return, defaults to 50
178
+ * @property pageToken - PageToken provided by the API
179
+ */
180
+ interface SimIpAddressListInstancePageOptions {
181
+ pageNumber?: number;
182
+ pageSize?: number;
183
+ pageToken?: string;
184
+ }
185
+
186
+ interface SimIpAddressPayload extends SimIpAddressResource, Page.TwilioResponsePayload {
187
+ }
188
+
189
+ interface SimIpAddressResource {
190
+ ip_address: string;
191
+ ip_address_version: SimIpAddressIpAddressVersion;
192
+ }
193
+
194
+ interface SimIpAddressSolution {
195
+ simSid?: string;
196
+ }
197
+
198
+
199
+ declare class SimIpAddressInstance extends SerializableClass {
200
+ /**
201
+ * Initialize the SimIpAddressContext
202
+ *
203
+ * PLEASE NOTE that this class contains beta products that are subject to change.
204
+ * Use them with caution.
205
+ *
206
+ * @param version - Version of the resource
207
+ * @param payload - The instance payload
208
+ * @param simSid - The unique string that identifies the resource
209
+ */
210
+ constructor(version: V1, payload: SimIpAddressPayload, simSid: string);
211
+
212
+ ipAddress: string;
213
+ ipAddressVersion: SimIpAddressIpAddressVersion;
214
+ /**
215
+ * Provide a user-friendly representation
216
+ */
217
+ toJSON(): any;
218
+ }
219
+
220
+
221
+ declare class SimIpAddressPage extends Page<V1, SimIpAddressPayload, SimIpAddressResource, SimIpAddressInstance> {
222
+ /**
223
+ * Initialize the SimIpAddressPage
224
+ *
225
+ * PLEASE NOTE that this class contains beta products that are subject to change.
226
+ * Use them with caution.
227
+ *
228
+ * @param version - Version of the resource
229
+ * @param response - Response from the API
230
+ * @param solution - Path solution
231
+ */
232
+ constructor(version: V1, response: Response<string>, solution: SimIpAddressSolution);
233
+
234
+ /**
235
+ * Build an instance of SimIpAddressInstance
236
+ *
237
+ * @param payload - Payload response from the API
238
+ */
239
+ getInstance(payload: SimIpAddressPayload): SimIpAddressInstance;
240
+ /**
241
+ * Provide a user-friendly representation
242
+ */
243
+ toJSON(): any;
244
+ }
245
+
246
+ export { SimIpAddressInstance, SimIpAddressIpAddressVersion, SimIpAddressList, SimIpAddressListInstance, SimIpAddressListInstanceEachOptions, SimIpAddressListInstanceOptions, SimIpAddressListInstancePageOptions, SimIpAddressPage, SimIpAddressPayload, SimIpAddressResource, SimIpAddressSolution }
@@ -0,0 +1,448 @@
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 SimIpAddressList;
19
+ var SimIpAddressPage;
20
+ var SimIpAddressInstance;
21
+
22
+ /* jshint ignore:start */
23
+ /**
24
+ * Initialize the SimIpAddressList
25
+ *
26
+ * PLEASE NOTE that this class contains beta products that are subject to change.
27
+ * Use them with caution.
28
+ *
29
+ * @constructor Twilio.Supersim.V1.SimContext.SimIpAddressList
30
+ *
31
+ * @param {Twilio.Supersim.V1} version - Version of the resource
32
+ * @param {string} simSid - The unique string that identifies the resource
33
+ */
34
+ /* jshint ignore:end */
35
+ SimIpAddressList = function SimIpAddressList(version, simSid) {
36
+ /* jshint ignore:start */
37
+ /**
38
+ * @function simIpAddresses
39
+ * @memberof Twilio.Supersim.V1.SimContext#
40
+ *
41
+ * @param {string} sid - sid of instance
42
+ *
43
+ * @returns {Twilio.Supersim.V1.SimContext.SimIpAddressContext}
44
+ */
45
+ /* jshint ignore:end */
46
+ function SimIpAddressListInstance(sid) {
47
+ return SimIpAddressListInstance.get(sid);
48
+ }
49
+
50
+ SimIpAddressListInstance._version = version;
51
+ // Path Solution
52
+ SimIpAddressListInstance._solution = {simSid: simSid};
53
+ SimIpAddressListInstance._uri = `/Sims/${simSid}/IpAddresses`;
54
+ /* jshint ignore:start */
55
+ /**
56
+ * Streams SimIpAddressInstance records from the API.
57
+ *
58
+ * This operation lazily loads records as efficiently as possible until the limit
59
+ * is reached.
60
+ *
61
+ * The results are passed into the callback function, so this operation is memory
62
+ * efficient.
63
+ *
64
+ * If a function is passed as the first argument, it will be used as the callback
65
+ * function.
66
+ *
67
+ * @function each
68
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressList#
69
+ *
70
+ * @param {object} [opts] - Options for request
71
+ * @param {number} [opts.limit] -
72
+ * Upper limit for the number of records to return.
73
+ * each() guarantees never to return more than limit.
74
+ * Default is no limit
75
+ * @param {number} [opts.pageSize] -
76
+ * Number of records to fetch per request,
77
+ * when not set will use the default value of 50 records.
78
+ * If no pageSize is defined but a limit is defined,
79
+ * each() will attempt to read the limit with the most efficient
80
+ * page size, i.e. min(limit, 1000)
81
+ * @param {Function} [opts.callback] -
82
+ * Function to process each record. If this and a positional
83
+ * callback are passed, this one will be used
84
+ * @param {Function} [opts.done] -
85
+ * Function to be called upon completion of streaming
86
+ * @param {Function} [callback] - Function to process each record
87
+ */
88
+ /* jshint ignore:end */
89
+ SimIpAddressListInstance.each = function each(opts, callback) {
90
+ if (_.isFunction(opts)) {
91
+ callback = opts;
92
+ opts = {};
93
+ }
94
+ opts = opts || {};
95
+ if (opts.callback) {
96
+ callback = opts.callback;
97
+ }
98
+ if (_.isUndefined(callback)) {
99
+ throw new Error('Callback function must be provided');
100
+ }
101
+
102
+ var done = false;
103
+ var currentPage = 1;
104
+ var currentResource = 0;
105
+ var limits = this._version.readLimits({
106
+ limit: opts.limit,
107
+ pageSize: opts.pageSize
108
+ });
109
+
110
+ function onComplete(error) {
111
+ done = true;
112
+ if (_.isFunction(opts.done)) {
113
+ opts.done(error);
114
+ }
115
+ }
116
+
117
+ function fetchNextPage(fn) {
118
+ var promise = fn();
119
+ if (_.isUndefined(promise)) {
120
+ onComplete();
121
+ return;
122
+ }
123
+
124
+ promise.then(function(page) {
125
+ _.each(page.instances, function(instance) {
126
+ if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) {
127
+ done = true;
128
+ return false;
129
+ }
130
+
131
+ currentResource++;
132
+ callback(instance, onComplete);
133
+ });
134
+
135
+ if (!done) {
136
+ currentPage++;
137
+ fetchNextPage(_.bind(page.nextPage, page));
138
+ } else {
139
+ onComplete();
140
+ }
141
+ });
142
+
143
+ promise.catch(onComplete);
144
+ }
145
+
146
+ fetchNextPage(_.bind(this.page, this, _.merge(opts, limits)));
147
+ };
148
+
149
+ /* jshint ignore:start */
150
+ /**
151
+ * Lists SimIpAddressInstance records from the API as a list.
152
+ *
153
+ * If a function is passed as the first argument, it will be used as the callback
154
+ * function.
155
+ *
156
+ * @function list
157
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressList#
158
+ *
159
+ * @param {object} [opts] - Options for request
160
+ * @param {number} [opts.limit] -
161
+ * Upper limit for the number of records to return.
162
+ * list() guarantees never to return more than limit.
163
+ * Default is no limit
164
+ * @param {number} [opts.pageSize] -
165
+ * Number of records to fetch per request,
166
+ * when not set will use the default value of 50 records.
167
+ * If no page_size is defined but a limit is defined,
168
+ * list() will attempt to read the limit with the most
169
+ * efficient page size, i.e. min(limit, 1000)
170
+ * @param {function} [callback] - Callback to handle list of records
171
+ *
172
+ * @returns {Promise} Resolves to a list of records
173
+ */
174
+ /* jshint ignore:end */
175
+ SimIpAddressListInstance.list = function list(opts, callback) {
176
+ if (_.isFunction(opts)) {
177
+ callback = opts;
178
+ opts = {};
179
+ }
180
+ opts = opts || {};
181
+ var deferred = Q.defer();
182
+ var allResources = [];
183
+ opts.callback = function(resource, done) {
184
+ allResources.push(resource);
185
+
186
+ if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) {
187
+ done();
188
+ }
189
+ };
190
+
191
+ opts.done = function(error) {
192
+ if (_.isUndefined(error)) {
193
+ deferred.resolve(allResources);
194
+ } else {
195
+ deferred.reject(error);
196
+ }
197
+ };
198
+
199
+ if (_.isFunction(callback)) {
200
+ deferred.promise.nodeify(callback);
201
+ }
202
+
203
+ this.each(opts);
204
+ return deferred.promise;
205
+ };
206
+
207
+ /* jshint ignore:start */
208
+ /**
209
+ * Retrieve a single page of SimIpAddressInstance records from the API.
210
+ *
211
+ * The request is executed immediately.
212
+ *
213
+ * If a function is passed as the first argument, it will be used as the callback
214
+ * function.
215
+ *
216
+ * @function page
217
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressList#
218
+ *
219
+ * @param {object} [opts] - Options for request
220
+ * @param {string} [opts.pageToken] - PageToken provided by the API
221
+ * @param {number} [opts.pageNumber] -
222
+ * Page Number, this value is simply for client state
223
+ * @param {number} [opts.pageSize] - Number of records to return, defaults to 50
224
+ * @param {function} [callback] - Callback to handle list of records
225
+ *
226
+ * @returns {Promise} Resolves to a list of records
227
+ */
228
+ /* jshint ignore:end */
229
+ SimIpAddressListInstance.page = function page(opts, callback) {
230
+ if (_.isFunction(opts)) {
231
+ callback = opts;
232
+ opts = {};
233
+ }
234
+ opts = opts || {};
235
+
236
+ var deferred = Q.defer();
237
+ var data = values.of({
238
+ 'PageToken': opts.pageToken,
239
+ 'Page': opts.pageNumber,
240
+ 'PageSize': opts.pageSize
241
+ });
242
+
243
+ var promise = this._version.page({uri: this._uri, method: 'GET', params: data});
244
+
245
+ promise = promise.then(function(payload) {
246
+ deferred.resolve(new SimIpAddressPage(this._version, payload, this._solution));
247
+ }.bind(this));
248
+
249
+ promise.catch(function(error) {
250
+ deferred.reject(error);
251
+ });
252
+
253
+ if (_.isFunction(callback)) {
254
+ deferred.promise.nodeify(callback);
255
+ }
256
+
257
+ return deferred.promise;
258
+ };
259
+
260
+ /* jshint ignore:start */
261
+ /**
262
+ * Retrieve a single target page of SimIpAddressInstance records from the API.
263
+ *
264
+ * The request is executed immediately.
265
+ *
266
+ * If a function is passed as the first argument, it will be used as the callback
267
+ * function.
268
+ *
269
+ * @function getPage
270
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressList#
271
+ *
272
+ * @param {string} [targetUrl] - API-generated URL for the requested results page
273
+ * @param {function} [callback] - Callback to handle list of records
274
+ *
275
+ * @returns {Promise} Resolves to a list of records
276
+ */
277
+ /* jshint ignore:end */
278
+ SimIpAddressListInstance.getPage = function getPage(targetUrl, callback) {
279
+ var deferred = Q.defer();
280
+
281
+ var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});
282
+
283
+ promise = promise.then(function(payload) {
284
+ deferred.resolve(new SimIpAddressPage(this._version, payload, this._solution));
285
+ }.bind(this));
286
+
287
+ promise.catch(function(error) {
288
+ deferred.reject(error);
289
+ });
290
+
291
+ if (_.isFunction(callback)) {
292
+ deferred.promise.nodeify(callback);
293
+ }
294
+
295
+ return deferred.promise;
296
+ };
297
+
298
+ /* jshint ignore:start */
299
+ /**
300
+ * Provide a user-friendly representation
301
+ *
302
+ * @function toJSON
303
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressList#
304
+ *
305
+ * @returns Object
306
+ */
307
+ /* jshint ignore:end */
308
+ SimIpAddressListInstance.toJSON = function toJSON() {
309
+ return this._solution;
310
+ };
311
+
312
+ SimIpAddressListInstance[util.inspect.custom] = function inspect(depth, options)
313
+ {
314
+ return util.inspect(this.toJSON(), options);
315
+ };
316
+
317
+ return SimIpAddressListInstance;
318
+ };
319
+
320
+
321
+ /* jshint ignore:start */
322
+ /**
323
+ * Initialize the SimIpAddressPage
324
+ *
325
+ * PLEASE NOTE that this class contains beta products that are subject to change.
326
+ * Use them with caution.
327
+ *
328
+ * @constructor Twilio.Supersim.V1.SimContext.SimIpAddressPage
329
+ *
330
+ * @param {V1} version - Version of the resource
331
+ * @param {Response<string>} response - Response from the API
332
+ * @param {SimIpAddressSolution} solution - Path solution
333
+ *
334
+ * @returns SimIpAddressPage
335
+ */
336
+ /* jshint ignore:end */
337
+ SimIpAddressPage = function SimIpAddressPage(version, response, solution) {
338
+ // Path Solution
339
+ this._solution = solution;
340
+
341
+ Page.prototype.constructor.call(this, version, response, this._solution);
342
+ };
343
+
344
+ _.extend(SimIpAddressPage.prototype, Page.prototype);
345
+ SimIpAddressPage.prototype.constructor = SimIpAddressPage;
346
+
347
+ /* jshint ignore:start */
348
+ /**
349
+ * Build an instance of SimIpAddressInstance
350
+ *
351
+ * @function getInstance
352
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressPage#
353
+ *
354
+ * @param {SimIpAddressPayload} payload - Payload response from the API
355
+ *
356
+ * @returns SimIpAddressInstance
357
+ */
358
+ /* jshint ignore:end */
359
+ SimIpAddressPage.prototype.getInstance = function getInstance(payload) {
360
+ return new SimIpAddressInstance(this._version, payload, this._solution.simSid);
361
+ };
362
+
363
+ /* jshint ignore:start */
364
+ /**
365
+ * Provide a user-friendly representation
366
+ *
367
+ * @function toJSON
368
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressPage#
369
+ *
370
+ * @returns Object
371
+ */
372
+ /* jshint ignore:end */
373
+ SimIpAddressPage.prototype.toJSON = function toJSON() {
374
+ let clone = {};
375
+ _.forOwn(this, function(value, key) {
376
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
377
+ clone[key] = value;
378
+ }
379
+ });
380
+ return clone;
381
+ };
382
+
383
+ SimIpAddressPage.prototype[util.inspect.custom] = function inspect(depth,
384
+ options) {
385
+ return util.inspect(this.toJSON(), options);
386
+ };
387
+
388
+
389
+ /* jshint ignore:start */
390
+ /**
391
+ * Initialize the SimIpAddressContext
392
+ *
393
+ * PLEASE NOTE that this class contains beta products that are subject to change.
394
+ * Use them with caution.
395
+ *
396
+ * @constructor Twilio.Supersim.V1.SimContext.SimIpAddressInstance
397
+ *
398
+ * @property {string} ipAddress - IP address assigned to the given Super SIM
399
+ * @property {sim_ip_address.ip_address_version} ipAddressVersion -
400
+ * IP address version
401
+ *
402
+ * @param {V1} version - Version of the resource
403
+ * @param {SimIpAddressPayload} payload - The instance payload
404
+ * @param {sid} simSid - The unique string that identifies the resource
405
+ */
406
+ /* jshint ignore:end */
407
+ SimIpAddressInstance = function SimIpAddressInstance(version, payload, simSid) {
408
+ this._version = version;
409
+
410
+ // Marshaled Properties
411
+ this.ipAddress = payload.ip_address; // jshint ignore:line
412
+ this.ipAddressVersion = payload.ip_address_version; // jshint ignore:line
413
+
414
+ // Context
415
+ this._context = undefined;
416
+ this._solution = {simSid: simSid, };
417
+ };
418
+
419
+ /* jshint ignore:start */
420
+ /**
421
+ * Provide a user-friendly representation
422
+ *
423
+ * @function toJSON
424
+ * @memberof Twilio.Supersim.V1.SimContext.SimIpAddressInstance#
425
+ *
426
+ * @returns Object
427
+ */
428
+ /* jshint ignore:end */
429
+ SimIpAddressInstance.prototype.toJSON = function toJSON() {
430
+ let clone = {};
431
+ _.forOwn(this, function(value, key) {
432
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
433
+ clone[key] = value;
434
+ }
435
+ });
436
+ return clone;
437
+ };
438
+
439
+ SimIpAddressInstance.prototype[util.inspect.custom] = function inspect(depth,
440
+ options) {
441
+ return util.inspect(this.toJSON(), options);
442
+ };
443
+
444
+ module.exports = {
445
+ SimIpAddressList: SimIpAddressList,
446
+ SimIpAddressPage: SimIpAddressPage,
447
+ SimIpAddressInstance: SimIpAddressInstance
448
+ };
@@ -11,6 +11,8 @@ import V1 = require('../V1');
11
11
  import { BillingPeriodList } from './sim/billingPeriod';
12
12
  import { BillingPeriodListInstance } from './sim/billingPeriod';
13
13
  import { SerializableClass } from '../../../interfaces';
14
+ import { SimIpAddressList } from './sim/simIpAddress';
15
+ import { SimIpAddressListInstance } from './sim/simIpAddress';
14
16
 
15
17
  type SimStatus = 'new'|'ready'|'active'|'inactive'|'scheduled';
16
18
 
@@ -290,6 +292,7 @@ declare class SimContext {
290
292
  * @param callback - Callback to handle processed record
291
293
  */
292
294
  fetch(callback?: (error: Error | null, items: SimInstance) => any): Promise<SimInstance>;
295
+ simIpAddresses: SimIpAddressListInstance;
293
296
  /**
294
297
  * Provide a user-friendly representation
295
298
  */
@@ -341,6 +344,10 @@ declare class SimInstance extends SerializableClass {
341
344
  iccid: string;
342
345
  links: string;
343
346
  sid: string;
347
+ /**
348
+ * Access the simIpAddresses
349
+ */
350
+ simIpAddresses(): SimIpAddressListInstance;
344
351
  status: SimStatus;
345
352
  /**
346
353
  * Provide a user-friendly representation
@@ -14,6 +14,7 @@ var _ = require('lodash'); /* jshint ignore:line */
14
14
  var util = require('util'); /* jshint ignore:line */
15
15
  var BillingPeriodList = require('./sim/billingPeriod').BillingPeriodList;
16
16
  var Page = require('../../../base/Page'); /* jshint ignore:line */
17
+ var SimIpAddressList = require('./sim/simIpAddress').SimIpAddressList;
17
18
  var deserialize = require(
18
19
  '../../../base/deserialize'); /* jshint ignore:line */
19
20
  var values = require('../../../base/values'); /* jshint ignore:line */
@@ -590,6 +591,20 @@ SimInstance.prototype.billingPeriods = function billingPeriods() {
590
591
  return this._proxy.billingPeriods;
591
592
  };
592
593
 
594
+ /* jshint ignore:start */
595
+ /**
596
+ * Access the simIpAddresses
597
+ *
598
+ * @function simIpAddresses
599
+ * @memberof Twilio.Supersim.V1.SimInstance#
600
+ *
601
+ * @returns {Twilio.Supersim.V1.SimContext.SimIpAddressList}
602
+ */
603
+ /* jshint ignore:end */
604
+ SimInstance.prototype.simIpAddresses = function simIpAddresses() {
605
+ return this._proxy.simIpAddresses;
606
+ };
607
+
593
608
  /* jshint ignore:start */
594
609
  /**
595
610
  * Provide a user-friendly representation
@@ -626,6 +641,8 @@ SimInstance.prototype[util.inspect.custom] = function inspect(depth, options) {
626
641
  *
627
642
  * @property {Twilio.Supersim.V1.SimContext.BillingPeriodList} billingPeriods -
628
643
  * billingPeriods resource
644
+ * @property {Twilio.Supersim.V1.SimContext.SimIpAddressList} simIpAddresses -
645
+ * simIpAddresses resource
629
646
  *
630
647
  * @param {V1} version - Version of the resource
631
648
  * @param {sid_like} sid - The SID that identifies the resource to fetch
@@ -640,6 +657,7 @@ SimContext = function SimContext(version, sid) {
640
657
 
641
658
  // Dependents
642
659
  this._billingPeriods = undefined;
660
+ this._simIpAddresses = undefined;
643
661
  };
644
662
 
645
663
  /* jshint ignore:start */
@@ -741,6 +759,16 @@ Object.defineProperty(SimContext.prototype,
741
759
  }
742
760
  });
743
761
 
762
+ Object.defineProperty(SimContext.prototype,
763
+ 'simIpAddresses', {
764
+ get: function() {
765
+ if (!this._simIpAddresses) {
766
+ this._simIpAddresses = new SimIpAddressList(this._version, this._solution.sid);
767
+ }
768
+ return this._simIpAddresses;
769
+ }
770
+ });
771
+
744
772
  /* jshint ignore:start */
745
773
  /**
746
774
  * Provide a user-friendly representation
@@ -21,13 +21,19 @@ type VerificationCheckChannel = 'sms'|'call'|'email'|'whatsapp'|'sna';
21
21
  declare function VerificationCheckList(version: V2, serviceSid: string): VerificationCheckListInstance;
22
22
 
23
23
  interface VerificationCheckListInstance {
24
+ /**
25
+ * create a VerificationCheckInstance
26
+ *
27
+ * @param callback - Callback to handle processed record
28
+ */
29
+ create(callback?: (error: Error | null, item: VerificationCheckInstance) => any): Promise<VerificationCheckInstance>;
24
30
  /**
25
31
  * create a VerificationCheckInstance
26
32
  *
27
33
  * @param opts - Options for request
28
34
  * @param callback - Callback to handle processed record
29
35
  */
30
- create(opts: VerificationCheckListInstanceCreateOptions, callback?: (error: Error | null, item: VerificationCheckInstance) => any): Promise<VerificationCheckInstance>;
36
+ create(opts?: VerificationCheckListInstanceCreateOptions, callback?: (error: Error | null, item: VerificationCheckInstance) => any): Promise<VerificationCheckInstance>;
31
37
  /**
32
38
  * Provide a user-friendly representation
33
39
  */
@@ -45,7 +51,7 @@ interface VerificationCheckListInstance {
45
51
  */
46
52
  interface VerificationCheckListInstanceCreateOptions {
47
53
  amount?: string;
48
- code: string;
54
+ code?: string;
49
55
  payee?: string;
50
56
  to?: string;
51
57
  verificationSid?: string;
@@ -58,8 +58,7 @@ VerificationCheckList = function VerificationCheckList(version, serviceSid) {
58
58
  * @function create
59
59
  * @memberof Twilio.Verify.V2.ServiceContext.VerificationCheckList#
60
60
  *
61
- * @param {object} opts - Options for request
62
- * @param {string} opts.code - The verification string
61
+ * @param {object} [opts] - Options for request
63
62
  * @param {string} [opts.to] - The phone number or email to verify
64
63
  * @param {string} [opts.verificationSid] -
65
64
  * A SID that uniquely identifies the Verification Check
@@ -67,26 +66,26 @@ VerificationCheckList = function VerificationCheckList(version, serviceSid) {
67
66
  * The amount of the associated PSD2 compliant transaction.
68
67
  * @param {string} [opts.payee] -
69
68
  * The payee of the associated PSD2 compliant transaction
69
+ * @param {string} [opts.code] - The verification string
70
70
  * @param {function} [callback] - Callback to handle processed record
71
71
  *
72
72
  * @returns {Promise} Resolves to processed VerificationCheckInstance
73
73
  */
74
74
  /* jshint ignore:end */
75
75
  VerificationCheckListInstance.create = function create(opts, callback) {
76
- if (_.isUndefined(opts)) {
77
- throw new Error('Required parameter "opts" missing.');
78
- }
79
- if (_.isUndefined(opts['code'])) {
80
- throw new Error('Required parameter "opts[\'code\']" missing.');
76
+ if (_.isFunction(opts)) {
77
+ callback = opts;
78
+ opts = {};
81
79
  }
80
+ opts = opts || {};
82
81
 
83
82
  var deferred = Q.defer();
84
83
  var data = values.of({
85
- 'Code': _.get(opts, 'code'),
86
84
  'To': _.get(opts, 'to'),
87
85
  'VerificationSid': _.get(opts, 'verificationSid'),
88
86
  'Amount': _.get(opts, 'amount'),
89
- 'Payee': _.get(opts, 'payee')
87
+ 'Payee': _.get(opts, 'payee'),
88
+ 'Code': _.get(opts, 'code')
90
89
  });
91
90
 
92
91
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -27,7 +27,7 @@ declare function VerificationAttemptsSummaryList(version: V2): VerificationAttem
27
27
  * @property dateCreatedAfter - Consider verification attempts create after this date on the summary.
28
28
  * @property dateCreatedBefore - Consider verification attempts created before this date on the summary.
29
29
  * @property destinationPrefix - Filters the attempts considered on the summary by destination prefix.
30
- * @property serviceSid - Filter the verification attempts considered on the summary by verify service.
30
+ * @property verifyServiceSid - Filter the verification attempts considered on the summary by verify service.
31
31
  */
32
32
  interface VerificationAttemptsSummaryInstanceFetchOptions {
33
33
  channel?: VerificationAttemptsSummaryChannels;
@@ -35,7 +35,7 @@ interface VerificationAttemptsSummaryInstanceFetchOptions {
35
35
  dateCreatedAfter?: Date;
36
36
  dateCreatedBefore?: Date;
37
37
  destinationPrefix?: string;
38
- serviceSid?: string;
38
+ verifyServiceSid?: string;
39
39
  }
40
40
 
41
41
  interface VerificationAttemptsSummaryListInstance {
@@ -209,7 +209,7 @@ Object.defineProperty(VerificationAttemptsSummaryInstance.prototype,
209
209
  * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryInstance#
210
210
  *
211
211
  * @param {object} [opts] - Options for request
212
- * @param {string} [opts.serviceSid] -
212
+ * @param {string} [opts.verifyServiceSid] -
213
213
  * Filter the verification attempts considered on the summary by verify service.
214
214
  * @param {Date} [opts.dateCreatedAfter] -
215
215
  * Consider verification attempts create after this date on the summary.
@@ -283,7 +283,7 @@ VerificationAttemptsSummaryContext = function
283
283
  * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryContext#
284
284
  *
285
285
  * @param {object} [opts] - Options for request
286
- * @param {string} [opts.serviceSid] -
286
+ * @param {string} [opts.verifyServiceSid] -
287
287
  * Filter the verification attempts considered on the summary by verify service.
288
288
  * @param {Date} [opts.dateCreatedAfter] -
289
289
  * Consider verification attempts create after this date on the summary.
@@ -310,7 +310,7 @@ VerificationAttemptsSummaryContext.prototype.fetch = function fetch(opts,
310
310
 
311
311
  var deferred = Q.defer();
312
312
  var data = values.of({
313
- 'ServiceSid': _.get(opts, 'serviceSid'),
313
+ 'VerifyServiceSid': _.get(opts, 'verifyServiceSid'),
314
314
  'DateCreatedAfter': serialize.iso8601DateTime(_.get(opts, 'dateCreatedAfter')),
315
315
  'DateCreatedBefore': serialize.iso8601DateTime(_.get(opts, 'dateCreatedBefore')),
316
316
  'Country': _.get(opts, 'country'),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "3.78.0",
4
+ "version": "3.79.0",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {