twilio 3.71.3 → 3.72.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.
@@ -0,0 +1,136 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Page = require('../../../base/Page');
9
+ import Response = require('../../../http/response');
10
+ import V1 = require('../V1');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ /**
14
+ * Initialize the ArchivedCallList
15
+ *
16
+ * PLEASE NOTE that this class contains beta products that are subject to change.
17
+ * Use them with caution.
18
+ *
19
+ * @param version - Version of the resource
20
+ */
21
+ declare function ArchivedCallList(version: V1): ArchivedCallListInstance;
22
+
23
+ interface ArchivedCallListInstance {
24
+ /**
25
+ * @param sid - sid of instance
26
+ */
27
+ (sid: string): ArchivedCallContext;
28
+ /**
29
+ * Constructs a archived_call
30
+ *
31
+ * @param date - The date of the Call in UTC.
32
+ * @param sid - The unique string that identifies this resource
33
+ */
34
+ get(date: string, sid: string): ArchivedCallContext;
35
+ /**
36
+ * Provide a user-friendly representation
37
+ */
38
+ toJSON(): any;
39
+ }
40
+
41
+ interface ArchivedCallPayload extends ArchivedCallResource, Page.TwilioResponsePayload {
42
+ }
43
+
44
+ interface ArchivedCallResource {
45
+ date: Date;
46
+ sid: string;
47
+ url: string;
48
+ }
49
+
50
+ interface ArchivedCallSolution {
51
+ }
52
+
53
+
54
+ declare class ArchivedCallContext {
55
+ /**
56
+ * Initialize the ArchivedCallContext
57
+ *
58
+ * PLEASE NOTE that this class contains beta products that are subject to change.
59
+ * Use them with caution.
60
+ *
61
+ * @param version - Version of the resource
62
+ * @param date - The date of the Call in UTC.
63
+ * @param sid - The unique string that identifies this resource
64
+ */
65
+ constructor(version: V1, date: Date, sid: string);
66
+
67
+ /**
68
+ * remove a ArchivedCallInstance
69
+ *
70
+ * @param callback - Callback to handle processed record
71
+ */
72
+ remove(callback?: (error: Error | null, items: ArchivedCallInstance) => any): Promise<boolean>;
73
+ /**
74
+ * Provide a user-friendly representation
75
+ */
76
+ toJSON(): any;
77
+ }
78
+
79
+
80
+ declare class ArchivedCallInstance extends SerializableClass {
81
+ /**
82
+ * Initialize the ArchivedCallContext
83
+ *
84
+ * PLEASE NOTE that this class contains beta products that are subject to change.
85
+ * Use them with caution.
86
+ *
87
+ * @param version - Version of the resource
88
+ * @param payload - The instance payload
89
+ * @param date - The date of the Call in UTC.
90
+ * @param sid - The unique string that identifies this resource
91
+ */
92
+ constructor(version: V1, payload: ArchivedCallPayload, date: Date, sid: string);
93
+
94
+ private _proxy: ArchivedCallContext;
95
+ date: Date;
96
+ /**
97
+ * remove a ArchivedCallInstance
98
+ *
99
+ * @param callback - Callback to handle processed record
100
+ */
101
+ remove(callback?: (error: Error | null, items: ArchivedCallInstance) => any): Promise<boolean>;
102
+ sid: string;
103
+ /**
104
+ * Provide a user-friendly representation
105
+ */
106
+ toJSON(): any;
107
+ url: string;
108
+ }
109
+
110
+
111
+ declare class ArchivedCallPage extends Page<V1, ArchivedCallPayload, ArchivedCallResource, ArchivedCallInstance> {
112
+ /**
113
+ * Initialize the ArchivedCallPage
114
+ *
115
+ * PLEASE NOTE that this class contains beta products that are subject to change.
116
+ * Use them with caution.
117
+ *
118
+ * @param version - Version of the resource
119
+ * @param response - Response from the API
120
+ * @param solution - Path solution
121
+ */
122
+ constructor(version: V1, response: Response<string>, solution: ArchivedCallSolution);
123
+
124
+ /**
125
+ * Build an instance of ArchivedCallInstance
126
+ *
127
+ * @param payload - Payload response from the API
128
+ */
129
+ getInstance(payload: ArchivedCallPayload): ArchivedCallInstance;
130
+ /**
131
+ * Provide a user-friendly representation
132
+ */
133
+ toJSON(): any;
134
+ }
135
+
136
+ export { ArchivedCallContext, ArchivedCallInstance, ArchivedCallList, ArchivedCallListInstance, ArchivedCallPage, ArchivedCallPayload, ArchivedCallResource, ArchivedCallSolution }
@@ -0,0 +1,325 @@
1
+ 'use strict';
2
+
3
+ /* jshint ignore:start */
4
+ /**
5
+ * This code was generated by
6
+ * \ / _ _ _| _ _
7
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
8
+ * / /
9
+ */
10
+ /* jshint ignore:end */
11
+
12
+ var Q = require('q'); /* jshint ignore:line */
13
+ var _ = require('lodash'); /* jshint ignore:line */
14
+ var util = require('util'); /* jshint ignore:line */
15
+ var Page = require('../../../base/Page'); /* jshint ignore:line */
16
+ var deserialize = require(
17
+ '../../../base/deserialize'); /* jshint ignore:line */
18
+
19
+ var ArchivedCallList;
20
+ var ArchivedCallPage;
21
+ var ArchivedCallInstance;
22
+ var ArchivedCallContext;
23
+
24
+ /* jshint ignore:start */
25
+ /**
26
+ * Initialize the ArchivedCallList
27
+ *
28
+ * PLEASE NOTE that this class contains beta products that are subject to change.
29
+ * Use them with caution.
30
+ *
31
+ * @constructor Twilio.Voice.V1.ArchivedCallList
32
+ *
33
+ * @param {Twilio.Voice.V1} version - Version of the resource
34
+ */
35
+ /* jshint ignore:end */
36
+ ArchivedCallList = function ArchivedCallList(version) {
37
+ /* jshint ignore:start */
38
+ /**
39
+ * @function archivedCalls
40
+ * @memberof Twilio.Voice.V1#
41
+ *
42
+ * @param {string} sid - sid of instance
43
+ *
44
+ * @returns {Twilio.Voice.V1.ArchivedCallContext}
45
+ */
46
+ /* jshint ignore:end */
47
+ function ArchivedCallListInstance(sid) {
48
+ return ArchivedCallListInstance.get(sid);
49
+ }
50
+
51
+ ArchivedCallListInstance._version = version;
52
+ // Path Solution
53
+ ArchivedCallListInstance._solution = {};
54
+ /* jshint ignore:start */
55
+ /**
56
+ * Constructs a archived_call
57
+ *
58
+ * @function get
59
+ * @memberof Twilio.Voice.V1.ArchivedCallList#
60
+ *
61
+ * @param {string} date - The date of the Call in UTC.
62
+ * @param {string} sid - The unique string that identifies this resource
63
+ *
64
+ * @returns {Twilio.Voice.V1.ArchivedCallContext}
65
+ */
66
+ /* jshint ignore:end */
67
+ ArchivedCallListInstance.get = function get(date, sid) {
68
+ return new ArchivedCallContext(this._version, date, sid);
69
+ };
70
+
71
+ /* jshint ignore:start */
72
+ /**
73
+ * Provide a user-friendly representation
74
+ *
75
+ * @function toJSON
76
+ * @memberof Twilio.Voice.V1.ArchivedCallList#
77
+ *
78
+ * @returns Object
79
+ */
80
+ /* jshint ignore:end */
81
+ ArchivedCallListInstance.toJSON = function toJSON() {
82
+ return this._solution;
83
+ };
84
+
85
+ ArchivedCallListInstance[util.inspect.custom] = function inspect(depth, options)
86
+ {
87
+ return util.inspect(this.toJSON(), options);
88
+ };
89
+
90
+ return ArchivedCallListInstance;
91
+ };
92
+
93
+
94
+ /* jshint ignore:start */
95
+ /**
96
+ * Initialize the ArchivedCallPage
97
+ *
98
+ * PLEASE NOTE that this class contains beta products that are subject to change.
99
+ * Use them with caution.
100
+ *
101
+ * @constructor Twilio.Voice.V1.ArchivedCallPage
102
+ *
103
+ * @param {V1} version - Version of the resource
104
+ * @param {Response<string>} response - Response from the API
105
+ * @param {ArchivedCallSolution} solution - Path solution
106
+ *
107
+ * @returns ArchivedCallPage
108
+ */
109
+ /* jshint ignore:end */
110
+ ArchivedCallPage = function ArchivedCallPage(version, response, solution) {
111
+ // Path Solution
112
+ this._solution = solution;
113
+
114
+ Page.prototype.constructor.call(this, version, response, this._solution);
115
+ };
116
+
117
+ _.extend(ArchivedCallPage.prototype, Page.prototype);
118
+ ArchivedCallPage.prototype.constructor = ArchivedCallPage;
119
+
120
+ /* jshint ignore:start */
121
+ /**
122
+ * Build an instance of ArchivedCallInstance
123
+ *
124
+ * @function getInstance
125
+ * @memberof Twilio.Voice.V1.ArchivedCallPage#
126
+ *
127
+ * @param {ArchivedCallPayload} payload - Payload response from the API
128
+ *
129
+ * @returns ArchivedCallInstance
130
+ */
131
+ /* jshint ignore:end */
132
+ ArchivedCallPage.prototype.getInstance = function getInstance(payload) {
133
+ return new ArchivedCallInstance(this._version, payload);
134
+ };
135
+
136
+ /* jshint ignore:start */
137
+ /**
138
+ * Provide a user-friendly representation
139
+ *
140
+ * @function toJSON
141
+ * @memberof Twilio.Voice.V1.ArchivedCallPage#
142
+ *
143
+ * @returns Object
144
+ */
145
+ /* jshint ignore:end */
146
+ ArchivedCallPage.prototype.toJSON = function toJSON() {
147
+ let clone = {};
148
+ _.forOwn(this, function(value, key) {
149
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
150
+ clone[key] = value;
151
+ }
152
+ });
153
+ return clone;
154
+ };
155
+
156
+ ArchivedCallPage.prototype[util.inspect.custom] = function inspect(depth,
157
+ options) {
158
+ return util.inspect(this.toJSON(), options);
159
+ };
160
+
161
+
162
+ /* jshint ignore:start */
163
+ /**
164
+ * Initialize the ArchivedCallContext
165
+ *
166
+ * PLEASE NOTE that this class contains beta products that are subject to change.
167
+ * Use them with caution.
168
+ *
169
+ * @constructor Twilio.Voice.V1.ArchivedCallInstance
170
+ *
171
+ * @property {Date} date - date
172
+ * @property {string} sid - sid
173
+ * @property {string} url - The absolute URL of the resource
174
+ *
175
+ * @param {V1} version - Version of the resource
176
+ * @param {ArchivedCallPayload} payload - The instance payload
177
+ * @param {date} date - The date of the Call in UTC.
178
+ * @param {sid} sid - The unique string that identifies this resource
179
+ */
180
+ /* jshint ignore:end */
181
+ ArchivedCallInstance = function ArchivedCallInstance(version, payload, date,
182
+ sid) {
183
+ this._version = version;
184
+
185
+ // Marshaled Properties
186
+ this.date = deserialize.iso8601Date(payload.date); // jshint ignore:line
187
+ this.sid = payload.sid; // jshint ignore:line
188
+ this.url = payload.url; // jshint ignore:line
189
+
190
+ // Context
191
+ this._context = undefined;
192
+ this._solution = {date: date || this.date, sid: sid || this.sid, };
193
+ };
194
+
195
+ Object.defineProperty(ArchivedCallInstance.prototype,
196
+ '_proxy', {
197
+ get: function() {
198
+ if (!this._context) {
199
+ this._context = new ArchivedCallContext(this._version, this._solution.date, this._solution.sid);
200
+ }
201
+
202
+ return this._context;
203
+ }
204
+ });
205
+
206
+ /* jshint ignore:start */
207
+ /**
208
+ * remove a ArchivedCallInstance
209
+ *
210
+ * @function remove
211
+ * @memberof Twilio.Voice.V1.ArchivedCallInstance#
212
+ *
213
+ * @param {function} [callback] - Callback to handle processed record
214
+ *
215
+ * @returns {Promise} Resolves to processed ArchivedCallInstance
216
+ */
217
+ /* jshint ignore:end */
218
+ ArchivedCallInstance.prototype.remove = function remove(callback) {
219
+ return this._proxy.remove(callback);
220
+ };
221
+
222
+ /* jshint ignore:start */
223
+ /**
224
+ * Provide a user-friendly representation
225
+ *
226
+ * @function toJSON
227
+ * @memberof Twilio.Voice.V1.ArchivedCallInstance#
228
+ *
229
+ * @returns Object
230
+ */
231
+ /* jshint ignore:end */
232
+ ArchivedCallInstance.prototype.toJSON = function toJSON() {
233
+ let clone = {};
234
+ _.forOwn(this, function(value, key) {
235
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
236
+ clone[key] = value;
237
+ }
238
+ });
239
+ return clone;
240
+ };
241
+
242
+ ArchivedCallInstance.prototype[util.inspect.custom] = function inspect(depth,
243
+ options) {
244
+ return util.inspect(this.toJSON(), options);
245
+ };
246
+
247
+
248
+ /* jshint ignore:start */
249
+ /**
250
+ * Initialize the ArchivedCallContext
251
+ *
252
+ * PLEASE NOTE that this class contains beta products that are subject to change.
253
+ * Use them with caution.
254
+ *
255
+ * @constructor Twilio.Voice.V1.ArchivedCallContext
256
+ *
257
+ * @param {V1} version - Version of the resource
258
+ * @param {date} date - The date of the Call in UTC.
259
+ * @param {sid} sid - The unique string that identifies this resource
260
+ */
261
+ /* jshint ignore:end */
262
+ ArchivedCallContext = function ArchivedCallContext(version, date, sid) {
263
+ this._version = version;
264
+
265
+ // Path Solution
266
+ this._solution = {date: date, sid: sid, };
267
+ this._uri = `/Archives/${date}/Calls/${sid}`;
268
+ };
269
+
270
+ /* jshint ignore:start */
271
+ /**
272
+ * remove a ArchivedCallInstance
273
+ *
274
+ * @function remove
275
+ * @memberof Twilio.Voice.V1.ArchivedCallContext#
276
+ *
277
+ * @param {function} [callback] - Callback to handle processed record
278
+ *
279
+ * @returns {Promise} Resolves to processed ArchivedCallInstance
280
+ */
281
+ /* jshint ignore:end */
282
+ ArchivedCallContext.prototype.remove = function remove(callback) {
283
+ var deferred = Q.defer();
284
+ var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
285
+
286
+ promise = promise.then(function(payload) {
287
+ deferred.resolve(payload);
288
+ }.bind(this));
289
+
290
+ promise.catch(function(error) {
291
+ deferred.reject(error);
292
+ });
293
+
294
+ if (_.isFunction(callback)) {
295
+ deferred.promise.nodeify(callback);
296
+ }
297
+
298
+ return deferred.promise;
299
+ };
300
+
301
+ /* jshint ignore:start */
302
+ /**
303
+ * Provide a user-friendly representation
304
+ *
305
+ * @function toJSON
306
+ * @memberof Twilio.Voice.V1.ArchivedCallContext#
307
+ *
308
+ * @returns Object
309
+ */
310
+ /* jshint ignore:end */
311
+ ArchivedCallContext.prototype.toJSON = function toJSON() {
312
+ return this._solution;
313
+ };
314
+
315
+ ArchivedCallContext.prototype[util.inspect.custom] = function inspect(depth,
316
+ options) {
317
+ return util.inspect(this.toJSON(), options);
318
+ };
319
+
320
+ module.exports = {
321
+ ArchivedCallList: ArchivedCallList,
322
+ ArchivedCallPage: ArchivedCallPage,
323
+ ArchivedCallInstance: ArchivedCallInstance,
324
+ ArchivedCallContext: ArchivedCallContext
325
+ };
@@ -446,14 +446,10 @@ SimPage.prototype[util.inspect.custom] = function inspect(depth, options) {
446
446
  * The URL we call when the SIM originates a machine-to-machine Command
447
447
  * @property {string} commandsCallbackMethod -
448
448
  * The HTTP method we use to call commands_callback_url
449
- * @property {string} smsFallbackMethod -
450
- * Deprecated. The HTTP method we use to call sms_fallback_url
451
- * @property {string} smsFallbackUrl -
452
- * Deprecated. The URL we call when an error occurs while retrieving or executing the TwiML requested from the sms_url
453
- * @property {string} smsMethod -
454
- * Deprecated. The HTTP method we use to call sms_url
455
- * @property {string} smsUrl -
456
- * Deprecated. The URL we call when the SIM-connected device sends an SMS message that is not a Command
449
+ * @property {string} smsFallbackMethod - Deprecated
450
+ * @property {string} smsFallbackUrl - Deprecated
451
+ * @property {string} smsMethod - Deprecated
452
+ * @property {string} smsUrl - Deprecated
457
453
  * @property {string} voiceFallbackMethod -
458
454
  * Deprecated. The HTTP method we use to call voice_fallback_url
459
455
  * @property {string} voiceFallbackUrl -
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "3.71.3",
4
+ "version": "3.72.0",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {