twilio 3.23.0 → 3.25.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.
Files changed (86) hide show
  1. package/CHANGES.md +55 -0
  2. package/lib/rest/Api.d.ts +2 -0
  3. package/lib/rest/Api.js +9 -0
  4. package/lib/rest/Authy.js +5 -5
  5. package/lib/rest/Preview.d.ts +0 -2
  6. package/lib/rest/Preview.js +12 -23
  7. package/lib/rest/Twilio.d.ts +1 -0
  8. package/lib/rest/Twilio.js +9 -0
  9. package/lib/rest/Video.js +8 -8
  10. package/lib/rest/api/V2010.d.ts +3 -0
  11. package/lib/rest/api/V2010.js +9 -0
  12. package/lib/rest/api/v2010/account/balance.d.ts +87 -0
  13. package/lib/rest/api/v2010/account/balance.js +162 -0
  14. package/lib/rest/api/v2010/account/message.d.ts +2 -0
  15. package/lib/rest/api/v2010/account/message.js +4 -1
  16. package/lib/rest/api/v2010/account/sip/ipAccessControlList.d.ts +3 -3
  17. package/lib/rest/api/v2010/account/sip/ipAccessControlList.js +3 -3
  18. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +1 -1
  19. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +1 -1
  21. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +1 -1
  22. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +1 -1
  23. package/lib/rest/api/v2010/account/usage/record/today.d.ts +1 -1
  24. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +1 -1
  25. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +1 -1
  26. package/lib/rest/api/v2010/account/usage/record.d.ts +1 -1
  27. package/lib/rest/api/v2010/account/usage/trigger.d.ts +1 -1
  28. package/lib/rest/api/v2010/account.d.ts +8 -0
  29. package/lib/rest/api/v2010/account.js +25 -0
  30. package/lib/rest/authy/V1.d.ts +1 -1
  31. package/lib/rest/authy/V1.js +8 -8
  32. package/lib/rest/authy/v1/form.d.ts +13 -13
  33. package/lib/rest/authy/v1/form.js +17 -17
  34. package/lib/rest/authy/v1/service/entity/factor/challenge.d.ts +12 -13
  35. package/lib/rest/authy/v1/service/entity/factor/challenge.js +4 -6
  36. package/lib/rest/authy/v1/service/entity/factor.d.ts +9 -9
  37. package/lib/rest/authy/v1/service/entity/factor.js +7 -9
  38. package/lib/rest/autopilot/v1/assistant/fieldType/fieldValue.d.ts +5 -5
  39. package/lib/rest/autopilot/v1/assistant/fieldType/fieldValue.js +9 -5
  40. package/lib/rest/autopilot/v1/assistant/fieldType.d.ts +5 -5
  41. package/lib/rest/autopilot/v1/assistant/fieldType.js +8 -5
  42. package/lib/rest/autopilot/v1/assistant/modelBuild.d.ts +5 -5
  43. package/lib/rest/autopilot/v1/assistant/modelBuild.js +8 -5
  44. package/lib/rest/autopilot/v1/assistant/query.d.ts +17 -17
  45. package/lib/rest/autopilot/v1/assistant/query.js +24 -18
  46. package/lib/rest/autopilot/v1/assistant/task/field.d.ts +11 -11
  47. package/lib/rest/autopilot/v1/assistant/task/field.js +15 -11
  48. package/lib/rest/autopilot/v1/assistant/task/sample.d.ts +18 -18
  49. package/lib/rest/autopilot/v1/assistant/task/sample.js +23 -21
  50. package/lib/rest/autopilot/v1/assistant/task/taskActions.d.ts +2 -2
  51. package/lib/rest/autopilot/v1/assistant/task/taskActions.js +4 -3
  52. package/lib/rest/autopilot/v1/assistant/task/taskStatistics.d.ts +6 -6
  53. package/lib/rest/autopilot/v1/assistant/task/taskStatistics.js +7 -6
  54. package/lib/rest/autopilot/v1/assistant/task.d.ts +10 -10
  55. package/lib/rest/autopilot/v1/assistant/task.js +21 -12
  56. package/lib/rest/autopilot/v1/assistant.d.ts +15 -15
  57. package/lib/rest/autopilot/v1/assistant.js +25 -20
  58. package/lib/rest/chat/v2/service/channel/member.d.ts +7 -0
  59. package/lib/rest/chat/v2/service/channel/member.js +13 -2
  60. package/lib/rest/ipMessaging/v2/service/channel/member.d.ts +7 -0
  61. package/lib/rest/ipMessaging/v2/service/channel/member.js +13 -2
  62. package/lib/rest/preview/Marketplace.d.ts +1 -1
  63. package/lib/rest/preview/Marketplace.js +9 -9
  64. package/lib/rest/proxy/v1/service.d.ts +7 -0
  65. package/lib/rest/proxy/v1/service.js +13 -2
  66. package/lib/rest/sync/v1/service/syncList/syncListItem.d.ts +10 -2
  67. package/lib/rest/sync/v1/service/syncList/syncListItem.js +24 -5
  68. package/lib/rest/sync/v1/service/syncList.d.ts +6 -2
  69. package/lib/rest/sync/v1/service/syncList.js +12 -5
  70. package/lib/rest/sync/v1/service/syncMap/syncMapItem.d.ts +10 -2
  71. package/lib/rest/sync/v1/service/syncMap/syncMapItem.js +24 -6
  72. package/lib/rest/sync/v1/service/syncMap.d.ts +6 -2
  73. package/lib/rest/sync/v1/service/syncMap.js +12 -5
  74. package/lib/rest/verify/v1/service/verification.d.ts +4 -0
  75. package/lib/rest/verify/v1/service/verification.js +5 -1
  76. package/lib/rest/video/V1.d.ts +1 -1
  77. package/lib/rest/video/V1.js +10 -10
  78. package/lib/twiml/VoiceResponse.d.ts +124 -0
  79. package/lib/twiml/VoiceResponse.js +960 -0
  80. package/package.json +1 -1
  81. package/lib/rest/preview/Authy.d.ts +0 -27
  82. package/lib/rest/preview/Authy.js +0 -44
  83. package/lib/rest/preview/authy/service/entity.d.ts +0 -250
  84. package/lib/rest/preview/authy/service/entity.js +0 -514
  85. package/lib/rest/preview/authy/service.d.ts +0 -275
  86. package/lib/rest/preview/authy/service.js +0 -578
package/CHANGES.md CHANGED
@@ -1,6 +1,61 @@
1
1
  twilio-node changelog
2
2
  =====================
3
3
 
4
+ [2018-11-30] Version 3.25.0
5
+ ----------------------------
6
+ **Api**
7
+ - Add `interactive_data` optional param to Messages create request
8
+
9
+ **Authy**
10
+ - Required authentication for `/v1/Forms/{type}` endpoint **(breaking change)**
11
+ - Removed `Challenge.reason` to `Challenge.responded_reason`
12
+ - Removed `verification_sid` from Challenge responses
13
+ - Removed `config` param from the Factor creation
14
+ - Replaced all occurrences of `FactorType` and `FormType` in favor of a unified `Type` **(breaking change)**
15
+
16
+ **Chat**
17
+ - Add Member attributes
18
+
19
+ **Preview**
20
+ - Removed `Authy` version from `preview` subdomain in favor to `authy` subdomain. **(breaking change)**
21
+
22
+ **Verify**
23
+ - Add `CustomCode` optional parameter on Verication creation.
24
+
25
+
26
+ [2018-11-16] Version 3.24.0
27
+ ----------------------------
28
+ **Messaging**
29
+ - Session API
30
+
31
+ **Twiml**
32
+ - Change `master-card` to `mastercard` as `cardType` for `Pay` and `Prompt`, remove attribute `credential_sid` from `Pay` **(breaking change)**
33
+
34
+
35
+ [2018-10-28] Version 3.23.2
36
+ ----------------------------
37
+ **Api**
38
+ - Add new Balance resource:
39
+ - url: '/v1/Accounts/{account sid}/Balance'
40
+ - supported methods: GET
41
+ - returns the balance of the account
42
+
43
+ **Proxy**
44
+ - Add chat_instance_sid to Service
45
+
46
+ **Verify**
47
+ - Add `Locale` optional parameter on Verification creation.
48
+
49
+
50
+ [2018-10-15] Version 3.23.1
51
+ ----------------------------
52
+ **Api**
53
+ - Add <Pay> Verb Transactions category to usage records
54
+
55
+ **Twiml**
56
+ - Add support for `Pay` verb
57
+
58
+
4
59
  [2018-10-15] Version 3.23.0
5
60
  ----------------------------
6
61
  **Library**
package/lib/rest/Api.d.ts CHANGED
@@ -14,6 +14,7 @@ import { AddressListInstance } from './api/v2010/account/address';
14
14
  import { ApplicationListInstance } from './api/v2010/account/application';
15
15
  import { AuthorizedConnectAppListInstance } from './api/v2010/account/authorizedConnectApp';
16
16
  import { AvailablePhoneNumberCountryListInstance } from './api/v2010/account/availablePhoneNumber';
17
+ import { BalanceListInstance } from './api/v2010/account/balance';
17
18
  import { CallListInstance } from './api/v2010/account/call';
18
19
  import { ConferenceListInstance } from './api/v2010/account/conference';
19
20
  import { ConnectAppListInstance } from './api/v2010/account/connectApp';
@@ -49,6 +50,7 @@ declare class Api extends Domain {
49
50
  readonly applications: ApplicationListInstance;
50
51
  readonly authorizedConnectApps: AuthorizedConnectAppListInstance;
51
52
  readonly availablePhoneNumbers: AvailablePhoneNumberCountryListInstance;
53
+ readonly balance: BalanceListInstance;
52
54
  readonly calls: CallListInstance;
53
55
  readonly conferences: ConferenceListInstance;
54
56
  readonly connectApps: ConnectAppListInstance;
package/lib/rest/Api.js CHANGED
@@ -31,6 +31,8 @@ var V2010 = require('./api/V2010'); /* jshint ignore:line */
31
31
  * authorizedConnectApps resource
32
32
  * @property {Twilio.Api.V2010.AccountContext.AvailablePhoneNumberCountryList} availablePhoneNumbers -
33
33
  * availablePhoneNumbers resource
34
+ * @property {Twilio.Api.V2010.AccountContext.BalanceList} balance -
35
+ * balance resource
34
36
  * @property {Twilio.Api.V2010.AccountContext.CallList} calls - calls resource
35
37
  * @property {Twilio.Api.V2010.AccountContext.ConferenceList} conferences -
36
38
  * conferences resource
@@ -127,6 +129,13 @@ Object.defineProperty(Api.prototype,
127
129
  }
128
130
  });
129
131
 
132
+ Object.defineProperty(Api.prototype,
133
+ 'balance', {
134
+ get: function() {
135
+ return this.account.balance;
136
+ }
137
+ });
138
+
130
139
  Object.defineProperty(Api.prototype,
131
140
  'calls', {
132
141
  get: function() {
package/lib/rest/Authy.js CHANGED
@@ -21,8 +21,8 @@ var V1 = require('./authy/V1'); /* jshint ignore:line */
21
21
  * @constructor
22
22
  *
23
23
  * @property {Twilio.Authy.V1} v1 - v1 version
24
- * @property {Twilio.Authy.V1.ServiceList} services - services resource
25
24
  * @property {Twilio.Authy.V1.FormList} forms - forms resource
25
+ * @property {Twilio.Authy.V1.ServiceList} services - services resource
26
26
  *
27
27
  * @param {Twilio} twilio - The twilio client
28
28
  */
@@ -46,16 +46,16 @@ Object.defineProperty(Authy.prototype,
46
46
  });
47
47
 
48
48
  Object.defineProperty(Authy.prototype,
49
- 'services', {
49
+ 'forms', {
50
50
  get: function() {
51
- return this.v1.services;
51
+ return this.v1.forms;
52
52
  }
53
53
  });
54
54
 
55
55
  Object.defineProperty(Authy.prototype,
56
- 'forms', {
56
+ 'services', {
57
57
  get: function() {
58
- return this.v1.forms;
58
+ return this.v1.services;
59
59
  }
60
60
  });
61
61
 
@@ -6,7 +6,6 @@
6
6
  */
7
7
 
8
8
  import AccSecurity = require('./preview/AccSecurity');
9
- import Authy = require('./preview/Authy');
10
9
  import BulkExports = require('./preview/BulkExports');
11
10
  import DeployedDevices = require('./preview/DeployedDevices');
12
11
  import Domain = require('../base/Domain');
@@ -41,7 +40,6 @@ declare class Preview extends Domain {
41
40
  readonly acc_security: AccSecurity;
42
41
  readonly assistants: AssistantListInstance;
43
42
  readonly authorizationDocuments: AuthorizationDocumentListInstance;
44
- readonly authy: Authy;
45
43
  readonly availableAddOns: AvailableAddOnListInstance;
46
44
  readonly bulk_exports: BulkExports;
47
45
  readonly commands: CommandListInstance;
@@ -11,7 +11,6 @@
11
11
 
12
12
  var _ = require('lodash'); /* jshint ignore:line */
13
13
  var AccSecurity = require('./preview/AccSecurity'); /* jshint ignore:line */
14
- var Authy = require('./preview/Authy'); /* jshint ignore:line */
15
14
  var BulkExports = require('./preview/BulkExports'); /* jshint ignore:line */
16
15
  var DeployedDevices = require(
17
16
  './preview/DeployedDevices'); /* jshint ignore:line */
@@ -30,7 +29,6 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
30
29
  *
31
30
  * @constructor
32
31
  *
33
- * @property {Twilio.Preview.Authy} authy - authy version
34
32
  * @property {Twilio.Preview.BulkExports} bulk_exports - bulk_exports version
35
33
  * @property {Twilio.Preview.DeployedDevices} deployed_devices -
36
34
  * deployed_devices version
@@ -40,7 +38,6 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
40
38
  * @property {Twilio.Preview.Sync} sync - sync version
41
39
  * @property {Twilio.Preview.Understand} understand - understand version
42
40
  * @property {Twilio.Preview.Wireless} wireless - wireless version
43
- * @property {Twilio.Preview.Sync.ServiceList} services - services resource
44
41
  * @property {Twilio.Preview.BulkExports.ExportList} exports - exports resource
45
42
  * @property {Twilio.Preview.BulkExports.ExportConfigurationList} exportConfiguration -
46
43
  * exportConfiguration resource
@@ -49,10 +46,11 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */
49
46
  * authorizationDocuments resource
50
47
  * @property {Twilio.Preview.HostedNumbers.HostedNumberOrderList} hostedNumberOrders -
51
48
  * hostedNumberOrders resource
52
- * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns -
53
- * installedAddOns resource
54
49
  * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns -
55
50
  * availableAddOns resource
51
+ * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns -
52
+ * installedAddOns resource
53
+ * @property {Twilio.Preview.Sync.ServiceList} services - services resource
56
54
  * @property {Twilio.Preview.Understand.AssistantList} assistants -
57
55
  * assistants resource
58
56
  * @property {Twilio.Preview.Wireless.CommandList} commands - commands resource
@@ -66,7 +64,6 @@ function Preview(twilio) {
66
64
  Domain.prototype.constructor.call(this, twilio, 'https://preview.twilio.com');
67
65
 
68
66
  // Versions
69
- this._authy = undefined;
70
67
  this._bulk_exports = undefined;
71
68
  this._deployed_devices = undefined;
72
69
  this._hosted_numbers = undefined;
@@ -80,14 +77,6 @@ function Preview(twilio) {
80
77
  _.extend(Preview.prototype, Domain.prototype);
81
78
  Preview.prototype.constructor = Preview;
82
79
 
83
- Object.defineProperty(Preview.prototype,
84
- 'authy', {
85
- get: function() {
86
- this._authy = this._authy || new Authy(this);
87
- return this._authy;
88
- }
89
- });
90
-
91
80
  Object.defineProperty(Preview.prototype,
92
81
  'bulk_exports', {
93
82
  get: function() {
@@ -152,13 +141,6 @@ Object.defineProperty(Preview.prototype,
152
141
  }
153
142
  });
154
143
 
155
- Object.defineProperty(Preview.prototype,
156
- 'services', {
157
- get: function() {
158
- return this.sync.services;
159
- }
160
- });
161
-
162
144
  Object.defineProperty(Preview.prototype,
163
145
  'exports', {
164
146
  get: function() {
@@ -194,6 +176,13 @@ Object.defineProperty(Preview.prototype,
194
176
  }
195
177
  });
196
178
 
179
+ Object.defineProperty(Preview.prototype,
180
+ 'availableAddOns', {
181
+ get: function() {
182
+ return this.marketplace.availableAddOns;
183
+ }
184
+ });
185
+
197
186
  Object.defineProperty(Preview.prototype,
198
187
  'installedAddOns', {
199
188
  get: function() {
@@ -202,9 +191,9 @@ Object.defineProperty(Preview.prototype,
202
191
  });
203
192
 
204
193
  Object.defineProperty(Preview.prototype,
205
- 'availableAddOns', {
194
+ 'services', {
206
195
  get: function() {
207
- return this.marketplace.availableAddOns;
196
+ return this.sync.services;
208
197
  }
209
198
  });
210
199
 
@@ -47,6 +47,7 @@ declare class Twilio {
47
47
  authy: Authy;
48
48
  autopilot: Autopilot;
49
49
  availablePhoneNumbers: (typeof Api.prototype.account.availablePhoneNumbers);
50
+ balance: (typeof Api.prototype.account.balance);
50
51
  calls: (typeof Api.prototype.account.calls);
51
52
  chat: Chat;
52
53
  conferences: (typeof Api.prototype.account.conferences);
@@ -73,6 +73,8 @@ var Wireless = require('./Wireless'); /* jshint ignore:line */
73
73
  * authorizedConnectApps resource
74
74
  * @property {Twilio.Api.V2010.AccountContext.AvailablePhoneNumberCountryList} availablePhoneNumbers -
75
75
  * availablePhoneNumbers resource
76
+ * @property {Twilio.Api.V2010.AccountContext.BalanceList} balance -
77
+ * balance resource
76
78
  * @property {Twilio.Api.V2010.AccountContext.CallList} calls - calls resource
77
79
  * @property {Twilio.Api.V2010.AccountContext.ConferenceList} conferences -
78
80
  * conferences resource
@@ -460,6 +462,13 @@ Object.defineProperty(Twilio.prototype,
460
462
  }
461
463
  });
462
464
 
465
+ Object.defineProperty(Twilio.prototype,
466
+ 'balance', {
467
+ get: function() {
468
+ return this.api.account.balance;
469
+ }
470
+ });
471
+
463
472
  Object.defineProperty(Twilio.prototype,
464
473
  'calls', {
465
474
  get: function() {
package/lib/rest/Video.js CHANGED
@@ -21,6 +21,7 @@ var V1 = require('./video/V1'); /* jshint ignore:line */
21
21
  * @constructor
22
22
  *
23
23
  * @property {Twilio.Video.V1} v1 - v1 version
24
+ * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource
24
25
  * @property {Twilio.Video.V1.CompositionHookList} compositionHooks -
25
26
  * compositionHooks resource
26
27
  * @property {Twilio.Video.V1.CompositionSettingsList} compositionSettings -
@@ -28,7 +29,6 @@ var V1 = require('./video/V1'); /* jshint ignore:line */
28
29
  * @property {Twilio.Video.V1.RecordingList} recordings - recordings resource
29
30
  * @property {Twilio.Video.V1.RecordingSettingsList} recordingSettings -
30
31
  * recordingSettings resource
31
- * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource
32
32
  * @property {Twilio.Video.V1.RoomList} rooms - rooms resource
33
33
  *
34
34
  * @param {Twilio} twilio - The twilio client
@@ -52,6 +52,13 @@ Object.defineProperty(Video.prototype,
52
52
  }
53
53
  });
54
54
 
55
+ Object.defineProperty(Video.prototype,
56
+ 'compositions', {
57
+ get: function() {
58
+ return this.v1.compositions;
59
+ }
60
+ });
61
+
55
62
  Object.defineProperty(Video.prototype,
56
63
  'compositionHooks', {
57
64
  get: function() {
@@ -80,13 +87,6 @@ Object.defineProperty(Video.prototype,
80
87
  }
81
88
  });
82
89
 
83
- Object.defineProperty(Video.prototype,
84
- 'compositions', {
85
- get: function() {
86
- return this.v1.compositions;
87
- }
88
- });
89
-
90
90
  Object.defineProperty(Video.prototype,
91
91
  'rooms', {
92
92
  get: function() {
@@ -14,6 +14,7 @@ import { AddressListInstance } from './v2010/account/address';
14
14
  import { ApplicationListInstance } from './v2010/account/application';
15
15
  import { AuthorizedConnectAppListInstance } from './v2010/account/authorizedConnectApp';
16
16
  import { AvailablePhoneNumberCountryListInstance } from './v2010/account/availablePhoneNumber';
17
+ import { BalanceListInstance } from './v2010/account/balance';
17
18
  import { CallListInstance } from './v2010/account/call';
18
19
  import { ConferenceListInstance } from './v2010/account/conference';
19
20
  import { ConnectAppListInstance } from './v2010/account/connectApp';
@@ -45,6 +46,7 @@ declare class V2010 extends Version {
45
46
  * @property applications - applications resource
46
47
  * @property authorizedConnectApps - authorizedConnectApps resource
47
48
  * @property availablePhoneNumbers - availablePhoneNumbers resource
49
+ * @property balance - balance resource
48
50
  * @property calls - calls resource
49
51
  * @property conferences - conferences resource
50
52
  * @property connectApps - connectApps resource
@@ -75,6 +77,7 @@ declare class V2010 extends Version {
75
77
  readonly applications: ApplicationListInstance;
76
78
  readonly authorizedConnectApps: AuthorizedConnectAppListInstance;
77
79
  readonly availablePhoneNumbers: AvailablePhoneNumberCountryListInstance;
80
+ readonly balance: BalanceListInstance;
78
81
  readonly calls: CallListInstance;
79
82
  readonly conferences: ConferenceListInstance;
80
83
  readonly connectApps: ConnectAppListInstance;
@@ -29,6 +29,8 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
29
29
  * authorizedConnectApps resource
30
30
  * @property {Twilio.Api.V2010.AccountContext.AvailablePhoneNumberCountryList} availablePhoneNumbers -
31
31
  * availablePhoneNumbers resource
32
+ * @property {Twilio.Api.V2010.AccountContext.BalanceList} balance -
33
+ * balance resource
32
34
  * @property {Twilio.Api.V2010.AccountContext.CallList} calls - calls resource
33
35
  * @property {Twilio.Api.V2010.AccountContext.ConferenceList} conferences -
34
36
  * conferences resource
@@ -127,6 +129,13 @@ Object.defineProperty(V2010.prototype,
127
129
  }
128
130
  });
129
131
 
132
+ Object.defineProperty(V2010.prototype,
133
+ 'balance', {
134
+ get: function() {
135
+ return this.account.balance;
136
+ }
137
+ });
138
+
130
139
  Object.defineProperty(V2010.prototype,
131
140
  'calls', {
132
141
  get: function() {
@@ -0,0 +1,87 @@
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 V2010 = require('../../V2010');
11
+ import { SerializableClass } from '../../../../interfaces';
12
+
13
+ /**
14
+ * @description Initialize the BalanceList
15
+ *
16
+ * @param version - Version of the resource
17
+ * @param accountSid - Account Sid.
18
+ */
19
+ declare function BalanceList(version: V2010, accountSid: string): BalanceListInstance;
20
+
21
+ interface BalanceListInstance {
22
+ /**
23
+ * fetch a BalanceInstance
24
+ *
25
+ * @param callback - Callback to handle processed record
26
+ */
27
+ fetch(callback?: (error: Error | null, items: BalanceListInstance) => any): Promise<BalanceInstance>;
28
+ }
29
+
30
+ interface BalancePayload extends BalanceResource, Page.TwilioResponsePayload {
31
+ }
32
+
33
+ interface BalanceResource {
34
+ account_sid: string;
35
+ balance: string;
36
+ currency: string;
37
+ }
38
+
39
+ interface BalanceSolution {
40
+ accountSid?: string;
41
+ }
42
+
43
+
44
+ declare class BalanceInstance extends SerializableClass {
45
+ /**
46
+ * Initialize the BalanceContext
47
+ *
48
+ * @property accountSid - Account Sid.
49
+ * @property balance - Account balance
50
+ * @property currency - Currency units
51
+ *
52
+ * @param version - Version of the resource
53
+ * @param payload - The instance payload
54
+ * @param accountSid - Account Sid.
55
+ */
56
+ constructor(version: V2010, payload: BalancePayload, accountSid: string);
57
+
58
+ accountSid: string;
59
+ balance: string;
60
+ currency: string;
61
+ /**
62
+ * Produce a plain JSON object version of the BalanceInstance for serialization.
63
+ * Removes any circular references in the object.
64
+ */
65
+ toJSON(): any;
66
+ }
67
+
68
+
69
+ declare class BalancePage extends Page<V2010, BalancePayload, BalanceResource, BalanceInstance> {
70
+ /**
71
+ * Initialize the BalancePage
72
+ *
73
+ * @param version - Version of the resource
74
+ * @param response - Response from the API
75
+ * @param solution - Path solution
76
+ */
77
+ constructor(version: V2010, response: Response<string>, solution: BalanceSolution);
78
+
79
+ /**
80
+ * Build an instance of BalanceInstance
81
+ *
82
+ * @param payload - Payload response from the API
83
+ */
84
+ getInstance(payload: BalancePayload): BalanceInstance;
85
+ }
86
+
87
+ export { BalanceInstance, BalanceList, BalanceListInstance, BalancePage, BalancePayload, BalanceResource, BalanceSolution }
@@ -0,0 +1,162 @@
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 Page = require('../../../../base/Page'); /* jshint ignore:line */
15
+ var values = require('../../../../base/values'); /* jshint ignore:line */
16
+
17
+ var BalanceList;
18
+ var BalancePage;
19
+ var BalanceInstance;
20
+
21
+ /* jshint ignore:start */
22
+ /**
23
+ * @description Initialize the BalanceList
24
+ *
25
+ * @param {Twilio.Api.V2010} version - Version of the resource
26
+ * @param {string} accountSid - Account Sid.
27
+ */
28
+ /* jshint ignore:end */
29
+ BalanceList = function BalanceList(version, accountSid) {
30
+ /* jshint ignore:start */
31
+ /**
32
+ * @param {string} sid - sid of instance
33
+ *
34
+ * @returns {Twilio.Api.V2010.AccountContext.BalanceContext}
35
+ */
36
+ /* jshint ignore:end */
37
+ function BalanceListInstance(sid) {
38
+ return BalanceListInstance.get(sid);
39
+ }
40
+
41
+ BalanceListInstance._version = version;
42
+ // Path Solution
43
+ BalanceListInstance._solution = {accountSid: accountSid};
44
+ BalanceListInstance._uri = _.template(
45
+ '/Accounts/<%= accountSid %>/Balance.json' // jshint ignore:line
46
+ )(BalanceListInstance._solution);
47
+ /* jshint ignore:start */
48
+ /**
49
+ * fetch a BalanceInstance
50
+ *
51
+ * @param {function} [callback] - Callback to handle processed record
52
+ *
53
+ * @returns {Promise} Resolves to processed BalanceInstance
54
+ */
55
+ /* jshint ignore:end */
56
+ BalanceListInstance.fetch = function fetch(callback) {
57
+ var deferred = Q.defer();
58
+ var promise = this._version.fetch({uri: this._uri, method: 'GET'});
59
+
60
+ promise = promise.then(function(payload) {
61
+ deferred.resolve(new BalanceInstance(this._version, payload, this._solution.accountSid));
62
+ }.bind(this));
63
+
64
+ promise.catch(function(error) {
65
+ deferred.reject(error);
66
+ });
67
+
68
+ if (_.isFunction(callback)) {
69
+ deferred.promise.nodeify(callback);
70
+ }
71
+
72
+ return deferred.promise;
73
+ };
74
+
75
+ return BalanceListInstance;
76
+ };
77
+
78
+
79
+ /* jshint ignore:start */
80
+ /**
81
+ * Initialize the BalancePage
82
+ *
83
+ * @param {V2010} version - Version of the resource
84
+ * @param {Response<string>} response - Response from the API
85
+ * @param {BalanceSolution} solution - Path solution
86
+ *
87
+ * @returns BalancePage
88
+ */
89
+ /* jshint ignore:end */
90
+ BalancePage = function BalancePage(version, response, solution) {
91
+ // Path Solution
92
+ this._solution = solution;
93
+
94
+ Page.prototype.constructor.call(this, version, response, this._solution);
95
+ };
96
+
97
+ _.extend(BalancePage.prototype, Page.prototype);
98
+ BalancePage.prototype.constructor = BalancePage;
99
+
100
+ /* jshint ignore:start */
101
+ /**
102
+ * Build an instance of BalanceInstance
103
+ *
104
+ * @param {BalancePayload} payload - Payload response from the API
105
+ *
106
+ * @returns BalanceInstance
107
+ */
108
+ /* jshint ignore:end */
109
+ BalancePage.prototype.getInstance = function getInstance(payload) {
110
+ return new BalanceInstance(this._version, payload, this._solution.accountSid);
111
+ };
112
+
113
+
114
+ /* jshint ignore:start */
115
+ /**
116
+ * Initialize the BalanceContext
117
+ *
118
+ * @property {string} accountSid - Account Sid.
119
+ * @property {string} balance - Account balance
120
+ * @property {string} currency - Currency units
121
+ *
122
+ * @param {V2010} version - Version of the resource
123
+ * @param {BalancePayload} payload - The instance payload
124
+ * @param {sid} accountSid - Account Sid.
125
+ */
126
+ /* jshint ignore:end */
127
+ BalanceInstance = function BalanceInstance(version, payload, accountSid) {
128
+ this._version = version;
129
+
130
+ // Marshaled Properties
131
+ this.accountSid = payload.account_sid; // jshint ignore:line
132
+ this.balance = payload.balance; // jshint ignore:line
133
+ this.currency = payload.currency; // jshint ignore:line
134
+
135
+ // Context
136
+ this._context = undefined;
137
+ this._solution = {accountSid: accountSid, };
138
+ };
139
+
140
+ /* jshint ignore:start */
141
+ /**
142
+ * Produce a plain JSON object version of the BalanceInstance for serialization.
143
+ * Removes any circular references in the object.
144
+ *
145
+ * @returns Object
146
+ */
147
+ /* jshint ignore:end */
148
+ BalanceInstance.prototype.toJSON = function toJSON() {
149
+ let clone = {};
150
+ _.forOwn(this, function(value, key) {
151
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
152
+ clone[key] = value;
153
+ }
154
+ });
155
+ return clone;
156
+ };
157
+
158
+ module.exports = {
159
+ BalanceList: BalanceList,
160
+ BalancePage: BalancePage,
161
+ BalanceInstance: BalanceInstance
162
+ };
@@ -112,6 +112,7 @@ interface MessageListInstance {
112
112
  * @property contentRetention - The content_retention
113
113
  * @property forceDelivery - The force_delivery
114
114
  * @property from - The phone number that initiated the message
115
+ * @property interactiveData - JSON string representing interactive data message.
115
116
  * @property maxPrice - The total maximum price up to the fourth decimal in US dollars acceptable for the message to be delivered.
116
117
  * @property maxRate - The max_rate
117
118
  * @property mediaUrl - The URL of the media you wish to send out with the message.
@@ -130,6 +131,7 @@ interface MessageListInstanceCreateOptions {
130
131
  contentRetention?: MessageContentRetention;
131
132
  forceDelivery?: boolean;
132
133
  from?: string;
134
+ interactiveData?: string;
133
135
  maxPrice?: number;
134
136
  maxRate?: string;
135
137
  mediaUrl?: string[];
@@ -73,6 +73,8 @@ MessageList = function MessageList(version, accountSid) {
73
73
  * @param {message.address_retention} [opts.addressRetention] -
74
74
  * The address_retention
75
75
  * @param {boolean} [opts.smartEncoded] - The smart_encoded
76
+ * @param {string} [opts.interactiveData] -
77
+ * JSON string representing interactive data message.
76
78
  * @param {string} [opts.from] - The phone number that initiated the message
77
79
  * @param {string} [opts.messagingServiceSid] -
78
80
  * The 34 character unique id of the Messaging Service you want to associate with this Message.
@@ -110,7 +112,8 @@ MessageList = function MessageList(version, accountSid) {
110
112
  'ProviderSid': _.get(opts, 'providerSid'),
111
113
  'ContentRetention': _.get(opts, 'contentRetention'),
112
114
  'AddressRetention': _.get(opts, 'addressRetention'),
113
- 'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded'))
115
+ 'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded')),
116
+ 'InteractiveData': _.get(opts, 'interactiveData')
114
117
  });
115
118
 
116
119
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -58,7 +58,7 @@ interface IpAccessControlListListInstance {
58
58
  /**
59
59
  * Constructs a ip_access_control_list
60
60
  *
61
- * @param sid - Fetch by unique ip-access-control-list Sid
61
+ * @param sid - Fetch by unique IpAccessControlList Sid
62
62
  */
63
63
  get(sid: string): IpAccessControlListContext;
64
64
  /**
@@ -184,7 +184,7 @@ declare class IpAccessControlListContext {
184
184
  *
185
185
  * @param version - Version of the resource
186
186
  * @param accountSid - The account_sid
187
- * @param sid - Fetch by unique ip-access-control-list Sid
187
+ * @param sid - Fetch by unique IpAccessControlList Sid
188
188
  */
189
189
  constructor(version: V2010, accountSid: string, sid: string);
190
190
 
@@ -226,7 +226,7 @@ declare class IpAccessControlListInstance extends SerializableClass {
226
226
  * @param version - Version of the resource
227
227
  * @param payload - The instance payload
228
228
  * @param accountSid - A 34 character string that uniquely identifies this resource.
229
- * @param sid - Fetch by unique ip-access-control-list Sid
229
+ * @param sid - Fetch by unique IpAccessControlList Sid
230
230
  */
231
231
  constructor(version: V2010, payload: IpAccessControlListPayload, accountSid: string, sid: string);
232
232