@cobo/cobo-waas2 1.26.0 → 1.27.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 (127) hide show
  1. package/README.md +64 -4
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/DevelopersWebhooksApi.js +2 -2
  4. package/dist/api/PaymentApi.js +1298 -200
  5. package/dist/api/TransactionsApi.js +2 -2
  6. package/dist/index.js +266 -7
  7. package/dist/model/BankAccountStatus.js +66 -0
  8. package/dist/model/ContractCallDestination.js +38 -10
  9. package/dist/model/ContractCallDestinationType.js +5 -0
  10. package/dist/model/Counterparty.js +195 -0
  11. package/dist/model/CounterpartyDetail.js +228 -0
  12. package/dist/model/CounterpartyType.js +61 -0
  13. package/dist/model/CounterpartyWalletAddressDetail.js +192 -0
  14. package/dist/model/CreateCounterpartyRequest.js +193 -0
  15. package/dist/model/CreateCounterpartyWalletAddressRequest.js +140 -0
  16. package/dist/model/CreateDestinationBankAccount.js +257 -0
  17. package/dist/model/CreateDestinationBankAccountRequest.js +272 -0
  18. package/dist/model/CreateDestinationRequest.js +235 -0
  19. package/dist/model/CreateDestinationWalletAddressRequest.js +140 -0
  20. package/dist/model/CreateKeyShareHolder.js +1 -1
  21. package/dist/model/CreatePaymentOrderRequest.js +2 -2
  22. package/dist/model/CreateSettlement.js +13 -0
  23. package/dist/model/{ReceivedAmountPerAddress.js → CreateWalletAddress.js} +31 -32
  24. package/dist/model/DeleteCounterparty200Response.js +110 -0
  25. package/dist/model/DeleteCounterpartyWalletAddress200Response.js +110 -0
  26. package/dist/model/DeleteDestination200Response.js +110 -0
  27. package/dist/model/DeleteDestinationBankAccount200Response.js +110 -0
  28. package/dist/model/DeleteDestinationWalletAddress200Response.js +110 -0
  29. package/dist/model/Destination.js +208 -0
  30. package/dist/model/DestinationBankAccount.js +301 -0
  31. package/dist/model/DestinationBankAccountDetail.js +394 -0
  32. package/dist/model/DestinationDetail.js +272 -0
  33. package/dist/model/DestinationType.js +61 -0
  34. package/dist/model/DestinationWalletAddressDetail.js +205 -0
  35. package/dist/model/EnableDestinationWhitelistRequest.js +106 -0
  36. package/dist/model/EvmContractCallDestination.js +2 -2
  37. package/dist/model/ExchangeRate.js +140 -0
  38. package/dist/model/IntermediaryBankInfo.js +140 -0
  39. package/dist/model/Link.js +4 -4
  40. package/dist/model/LinkDisplayInfo.js +2 -2
  41. package/dist/model/ListCounterparties200Response.js +123 -0
  42. package/dist/model/ListCounterpartyWalletAddress200Response.js +123 -0
  43. package/dist/model/ListDestinationBankAccounts200Response.js +123 -0
  44. package/dist/model/ListDestinationWalletAddresses200Response.js +123 -0
  45. package/dist/model/ListDestinations200Response.js +123 -0
  46. package/dist/model/PaymentTransaction.js +32 -0
  47. package/dist/model/PaymentTransactionEventData.js +2 -2
  48. package/dist/model/QueryDestinationWhitelistEnabled200Response.js +106 -0
  49. package/dist/model/RefundLinkBusinessInfo.js +6 -6
  50. package/dist/model/SettlementDetail.js +13 -0
  51. package/dist/model/SwapActivityTimeline.js +1 -1
  52. package/dist/model/Transaction.js +1 -1
  53. package/dist/model/TransactionDestination.js +38 -10
  54. package/dist/model/TransactionDestinationType.js +5 -0
  55. package/dist/model/TransactionDetail.js +2 -2
  56. package/dist/model/TransactionDetails.js +2 -2
  57. package/dist/model/TransactionTronContractDestination.js +150 -0
  58. package/dist/model/TransactionWebhookEventData.js +2 -2
  59. package/dist/model/TronContractCallDestination.js +150 -0
  60. package/dist/model/UpdateCounterpartyByIdRequest.js +160 -0
  61. package/dist/model/UpdateDestinationBankAccount.js +257 -0
  62. package/dist/model/UpdateDestinationByIdRequest.js +173 -0
  63. package/dist/model/WalletAddress.js +151 -0
  64. package/dist/model/WebhookEventData.js +1 -1
  65. package/docs/BankAccountStatus.md +14 -0
  66. package/docs/ContractCallDestination.md +2 -2
  67. package/docs/ContractCallDestinationType.md +2 -0
  68. package/docs/Counterparty.md +16 -0
  69. package/docs/CounterpartyDetail.md +17 -0
  70. package/docs/CounterpartyType.md +12 -0
  71. package/docs/CounterpartyWalletAddressDetail.md +15 -0
  72. package/docs/CreateCounterpartyRequest.md +14 -0
  73. package/docs/CreateCounterpartyWalletAddressRequest.md +11 -0
  74. package/docs/CreateDestinationBankAccount.md +19 -0
  75. package/docs/CreateDestinationBankAccountRequest.md +20 -0
  76. package/docs/CreateDestinationRequest.md +16 -0
  77. package/docs/CreateDestinationWalletAddressRequest.md +11 -0
  78. package/docs/CreateKeyShareHolder.md +1 -1
  79. package/docs/CreatePaymentOrderRequest.md +1 -1
  80. package/docs/CreateSettlement.md +1 -0
  81. package/docs/CreateWalletAddress.md +10 -0
  82. package/docs/DeleteCounterparty200Response.md +9 -0
  83. package/docs/DeleteCounterpartyWalletAddress200Response.md +9 -0
  84. package/docs/DeleteDestination200Response.md +9 -0
  85. package/docs/DeleteDestinationBankAccount200Response.md +9 -0
  86. package/docs/DeleteDestinationWalletAddress200Response.md +9 -0
  87. package/docs/Destination.md +17 -0
  88. package/docs/DestinationBankAccount.md +23 -0
  89. package/docs/DestinationBankAccountDetail.md +30 -0
  90. package/docs/DestinationDetail.md +19 -0
  91. package/docs/DestinationType.md +12 -0
  92. package/docs/DestinationWalletAddressDetail.md +16 -0
  93. package/docs/DevelopersWebhooksApi.md +1 -1
  94. package/docs/EnableDestinationWhitelistRequest.md +9 -0
  95. package/docs/EvmContractCallDestination.md +1 -1
  96. package/docs/ExchangeRate.md +11 -0
  97. package/docs/IntermediaryBankInfo.md +11 -0
  98. package/docs/Link.md +2 -2
  99. package/docs/LinkDisplayInfo.md +2 -2
  100. package/docs/ListCounterparties200Response.md +10 -0
  101. package/docs/ListCounterpartyWalletAddress200Response.md +10 -0
  102. package/docs/ListDestinationBankAccounts200Response.md +10 -0
  103. package/docs/ListDestinationWalletAddresses200Response.md +10 -0
  104. package/docs/ListDestinations200Response.md +10 -0
  105. package/docs/PaymentApi.md +1459 -208
  106. package/docs/PaymentTransaction.md +2 -0
  107. package/docs/PaymentTransactionEventData.md +1 -1
  108. package/docs/QueryDestinationWhitelistEnabled200Response.md +9 -0
  109. package/docs/RefundLinkBusinessInfo.md +4 -4
  110. package/docs/SettlementDetail.md +1 -0
  111. package/docs/SwapActivityTimeline.md +1 -1
  112. package/docs/Transaction.md +1 -1
  113. package/docs/TransactionDestination.md +2 -2
  114. package/docs/TransactionDestinationType.md +2 -0
  115. package/docs/TransactionDetail.md +1 -1
  116. package/docs/TransactionDetails.md +1 -1
  117. package/docs/TransactionTronContractDestination.md +12 -0
  118. package/docs/TransactionWebhookEventData.md +1 -1
  119. package/docs/TransactionsApi.md +1 -1
  120. package/docs/TronContractCallDestination.md +12 -0
  121. package/docs/UpdateCounterpartyByIdRequest.md +13 -0
  122. package/docs/UpdateDestinationBankAccount.md +19 -0
  123. package/docs/UpdateDestinationByIdRequest.md +14 -0
  124. package/docs/WalletAddress.md +12 -0
  125. package/docs/WebhookEventData.md +1 -1
  126. package/package.json +1 -1
  127. package/docs/ReceivedAmountPerAddress.md +0 -10
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _DestinationType = _interopRequireDefault(require("./DestinationType"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The Destination model module.
30
+ * @module model/Destination
31
+ */
32
+ var Destination = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>Destination</code>.
35
+ * @alias module:model/Destination
36
+ * @param destination_type {module:model/DestinationType}
37
+ * @param destination_name {String} The destination name.
38
+ * @param created_timestamp {Number} The created time of the destination, represented as a UNIX timestamp in seconds.
39
+ * @param updated_timestamp {Number} The updated time of the destination, represented as a UNIX timestamp in seconds.
40
+ */
41
+ function Destination(destination_type, destination_name, created_timestamp, updated_timestamp) {
42
+ _classCallCheck(this, Destination);
43
+ Destination.initialize(this, destination_type, destination_name, created_timestamp, updated_timestamp);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(Destination, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj, destination_type, destination_name, created_timestamp, updated_timestamp) {
54
+ obj['destination_type'] = destination_type;
55
+ obj['destination_name'] = destination_name;
56
+ obj['created_timestamp'] = created_timestamp;
57
+ obj['updated_timestamp'] = updated_timestamp;
58
+ }
59
+
60
+ /**
61
+ * Constructs a <code>Destination</code> from a plain JavaScript object, optionally creating a new instance.
62
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
63
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
64
+ * @param {module:model/Destination} obj Optional instance to populate.
65
+ * @return {module:model/Destination} The populated <code>Destination</code> instance.
66
+ */
67
+ }, {
68
+ key: "constructFromObject",
69
+ value: function constructFromObject(data, obj) {
70
+ if (data) {
71
+ obj = obj || new Destination();
72
+ if (data.hasOwnProperty('destination_id')) {
73
+ obj['destination_id'] = _ApiClient["default"].convertToType(data['destination_id'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('destination_type')) {
76
+ obj['destination_type'] = _DestinationType["default"].constructFromObject(data['destination_type']);
77
+ }
78
+ if (data.hasOwnProperty('destination_name')) {
79
+ obj['destination_name'] = _ApiClient["default"].convertToType(data['destination_name'], 'String');
80
+ }
81
+ if (data.hasOwnProperty('country')) {
82
+ obj['country'] = _ApiClient["default"].convertToType(data['country'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('email')) {
85
+ obj['email'] = _ApiClient["default"].convertToType(data['email'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('contact_address')) {
88
+ obj['contact_address'] = _ApiClient["default"].convertToType(data['contact_address'], 'String');
89
+ }
90
+ if (data.hasOwnProperty('merchant_id')) {
91
+ obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
92
+ }
93
+ if (data.hasOwnProperty('created_timestamp')) {
94
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
95
+ }
96
+ if (data.hasOwnProperty('updated_timestamp')) {
97
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
98
+ }
99
+ }
100
+ return obj;
101
+ }
102
+
103
+ /**
104
+ * Validates the JSON data with respect to <code>Destination</code>.
105
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
106
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Destination</code>.
107
+ */
108
+ }, {
109
+ key: "validateJSON",
110
+ value: function validateJSON(data) {
111
+ // check to make sure all required properties are present in the JSON string
112
+ var _iterator = _createForOfIteratorHelper(Destination.RequiredProperties),
113
+ _step;
114
+ try {
115
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
116
+ var property = _step.value;
117
+ if (!data.hasOwnProperty(property)) {
118
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
119
+ }
120
+ }
121
+ // ensure the json data is a string
122
+ } catch (err) {
123
+ _iterator.e(err);
124
+ } finally {
125
+ _iterator.f();
126
+ }
127
+ if (data['destination_id'] && !(typeof data['destination_id'] === 'string' || data['destination_id'] instanceof String)) {
128
+ throw new Error("Expected the field `destination_id` to be a primitive type in the JSON string but got " + data['destination_id']);
129
+ }
130
+ // ensure the json data is a string
131
+ if (data['destination_name'] && !(typeof data['destination_name'] === 'string' || data['destination_name'] instanceof String)) {
132
+ throw new Error("Expected the field `destination_name` to be a primitive type in the JSON string but got " + data['destination_name']);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data['country'] && !(typeof data['country'] === 'string' || data['country'] instanceof String)) {
136
+ throw new Error("Expected the field `country` to be a primitive type in the JSON string but got " + data['country']);
137
+ }
138
+ // ensure the json data is a string
139
+ if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
140
+ throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
141
+ }
142
+ // ensure the json data is a string
143
+ if (data['contact_address'] && !(typeof data['contact_address'] === 'string' || data['contact_address'] instanceof String)) {
144
+ throw new Error("Expected the field `contact_address` to be a primitive type in the JSON string but got " + data['contact_address']);
145
+ }
146
+ // ensure the json data is a string
147
+ if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
148
+ throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
149
+ }
150
+ return true;
151
+ }
152
+ }]);
153
+ }();
154
+ Destination.RequiredProperties = ["destination_type", "destination_name", "created_timestamp", "updated_timestamp"];
155
+
156
+ /**
157
+ * The destination ID.
158
+ * @member {String} destination_id
159
+ */
160
+ Destination.prototype['destination_id'] = undefined;
161
+
162
+ /**
163
+ * @member {module:model/DestinationType} destination_type
164
+ */
165
+ Destination.prototype['destination_type'] = undefined;
166
+
167
+ /**
168
+ * The destination name.
169
+ * @member {String} destination_name
170
+ */
171
+ Destination.prototype['destination_name'] = undefined;
172
+
173
+ /**
174
+ * The country of the destination, in ISO 3166-1 alpha-3 format.
175
+ * @member {String} country
176
+ */
177
+ Destination.prototype['country'] = undefined;
178
+
179
+ /**
180
+ * The email of the destination.
181
+ * @member {String} email
182
+ */
183
+ Destination.prototype['email'] = undefined;
184
+
185
+ /**
186
+ * The contact address of the destination.
187
+ * @member {String} contact_address
188
+ */
189
+ Destination.prototype['contact_address'] = undefined;
190
+
191
+ /**
192
+ * The ID of the merchant linked to the destination.
193
+ * @member {String} merchant_id
194
+ */
195
+ Destination.prototype['merchant_id'] = undefined;
196
+
197
+ /**
198
+ * The created time of the destination, represented as a UNIX timestamp in seconds.
199
+ * @member {Number} created_timestamp
200
+ */
201
+ Destination.prototype['created_timestamp'] = undefined;
202
+
203
+ /**
204
+ * The updated time of the destination, represented as a UNIX timestamp in seconds.
205
+ * @member {Number} updated_timestamp
206
+ */
207
+ Destination.prototype['updated_timestamp'] = undefined;
208
+ var _default = exports["default"] = Destination;
@@ -0,0 +1,301 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _BankAccountStatus = _interopRequireDefault(require("./BankAccountStatus"));
9
+ var _IntermediaryBankInfo = _interopRequireDefault(require("./IntermediaryBankInfo"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * Cobo Wallet as a Service 2.0
21
+ *
22
+ * Contact: help@cobo.com
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The DestinationBankAccount model module.
31
+ * @module model/DestinationBankAccount
32
+ */
33
+ var DestinationBankAccount = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>DestinationBankAccount</code>.
36
+ * @alias module:model/DestinationBankAccount
37
+ * @param bank_account_id {String} The destination bank account ID.
38
+ * @param account_alias {String} The alias of the bank account.
39
+ * @param account_number {String} The bank account number.
40
+ * @param swift_code {String} The SWIFT or BIC code of the bank.
41
+ * @param currency {String} The currency of the bank account.
42
+ * @param beneficiary_name {String} The name of the account holder.
43
+ * @param beneficiary_address {String} The address of the account holder.
44
+ * @param bank_name {String} The name of the bank.
45
+ * @param bank_address {String} The address of the bank.
46
+ * @param bank_account_status {module:model/BankAccountStatus}
47
+ */
48
+ function DestinationBankAccount(bank_account_id, account_alias, account_number, swift_code, currency, beneficiary_name, beneficiary_address, bank_name, bank_address, bank_account_status) {
49
+ _classCallCheck(this, DestinationBankAccount);
50
+ DestinationBankAccount.initialize(this, bank_account_id, account_alias, account_number, swift_code, currency, beneficiary_name, beneficiary_address, bank_name, bank_address, bank_account_status);
51
+ }
52
+
53
+ /**
54
+ * Initializes the fields of this object.
55
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
56
+ * Only for internal use.
57
+ */
58
+ return _createClass(DestinationBankAccount, null, [{
59
+ key: "initialize",
60
+ value: function initialize(obj, bank_account_id, account_alias, account_number, swift_code, currency, beneficiary_name, beneficiary_address, bank_name, bank_address, bank_account_status) {
61
+ obj['bank_account_id'] = bank_account_id;
62
+ obj['account_alias'] = account_alias;
63
+ obj['account_number'] = account_number;
64
+ obj['swift_code'] = swift_code;
65
+ obj['currency'] = currency;
66
+ obj['beneficiary_name'] = beneficiary_name;
67
+ obj['beneficiary_address'] = beneficiary_address;
68
+ obj['bank_name'] = bank_name;
69
+ obj['bank_address'] = bank_address;
70
+ obj['bank_account_status'] = bank_account_status;
71
+ }
72
+
73
+ /**
74
+ * Constructs a <code>DestinationBankAccount</code> from a plain JavaScript object, optionally creating a new instance.
75
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
76
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
77
+ * @param {module:model/DestinationBankAccount} obj Optional instance to populate.
78
+ * @return {module:model/DestinationBankAccount} The populated <code>DestinationBankAccount</code> instance.
79
+ */
80
+ }, {
81
+ key: "constructFromObject",
82
+ value: function constructFromObject(data, obj) {
83
+ if (data) {
84
+ obj = obj || new DestinationBankAccount();
85
+ if (data.hasOwnProperty('bank_account_id')) {
86
+ obj['bank_account_id'] = _ApiClient["default"].convertToType(data['bank_account_id'], 'String');
87
+ }
88
+ if (data.hasOwnProperty('account_alias')) {
89
+ obj['account_alias'] = _ApiClient["default"].convertToType(data['account_alias'], 'String');
90
+ }
91
+ if (data.hasOwnProperty('account_number')) {
92
+ obj['account_number'] = _ApiClient["default"].convertToType(data['account_number'], 'String');
93
+ }
94
+ if (data.hasOwnProperty('swift_code')) {
95
+ obj['swift_code'] = _ApiClient["default"].convertToType(data['swift_code'], 'String');
96
+ }
97
+ if (data.hasOwnProperty('currency')) {
98
+ obj['currency'] = _ApiClient["default"].convertToType(data['currency'], 'String');
99
+ }
100
+ if (data.hasOwnProperty('beneficiary_name')) {
101
+ obj['beneficiary_name'] = _ApiClient["default"].convertToType(data['beneficiary_name'], 'String');
102
+ }
103
+ if (data.hasOwnProperty('beneficiary_address')) {
104
+ obj['beneficiary_address'] = _ApiClient["default"].convertToType(data['beneficiary_address'], 'String');
105
+ }
106
+ if (data.hasOwnProperty('bank_name')) {
107
+ obj['bank_name'] = _ApiClient["default"].convertToType(data['bank_name'], 'String');
108
+ }
109
+ if (data.hasOwnProperty('bank_address')) {
110
+ obj['bank_address'] = _ApiClient["default"].convertToType(data['bank_address'], 'String');
111
+ }
112
+ if (data.hasOwnProperty('iban_code')) {
113
+ obj['iban_code'] = _ApiClient["default"].convertToType(data['iban_code'], 'String');
114
+ }
115
+ if (data.hasOwnProperty('further_credit')) {
116
+ obj['further_credit'] = _ApiClient["default"].convertToType(data['further_credit'], 'String');
117
+ }
118
+ if (data.hasOwnProperty('intermediary_bank_info')) {
119
+ obj['intermediary_bank_info'] = _IntermediaryBankInfo["default"].constructFromObject(data['intermediary_bank_info']);
120
+ }
121
+ if (data.hasOwnProperty('bank_account_status')) {
122
+ obj['bank_account_status'] = _BankAccountStatus["default"].constructFromObject(data['bank_account_status']);
123
+ }
124
+ if (data.hasOwnProperty('created_timestamp')) {
125
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
126
+ }
127
+ if (data.hasOwnProperty('updated_timestamp')) {
128
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
129
+ }
130
+ }
131
+ return obj;
132
+ }
133
+
134
+ /**
135
+ * Validates the JSON data with respect to <code>DestinationBankAccount</code>.
136
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
137
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>DestinationBankAccount</code>.
138
+ */
139
+ }, {
140
+ key: "validateJSON",
141
+ value: function validateJSON(data) {
142
+ // check to make sure all required properties are present in the JSON string
143
+ var _iterator = _createForOfIteratorHelper(DestinationBankAccount.RequiredProperties),
144
+ _step;
145
+ try {
146
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
147
+ var property = _step.value;
148
+ if (!data.hasOwnProperty(property)) {
149
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
150
+ }
151
+ }
152
+ // ensure the json data is a string
153
+ } catch (err) {
154
+ _iterator.e(err);
155
+ } finally {
156
+ _iterator.f();
157
+ }
158
+ if (data['bank_account_id'] && !(typeof data['bank_account_id'] === 'string' || data['bank_account_id'] instanceof String)) {
159
+ throw new Error("Expected the field `bank_account_id` to be a primitive type in the JSON string but got " + data['bank_account_id']);
160
+ }
161
+ // ensure the json data is a string
162
+ if (data['account_alias'] && !(typeof data['account_alias'] === 'string' || data['account_alias'] instanceof String)) {
163
+ throw new Error("Expected the field `account_alias` to be a primitive type in the JSON string but got " + data['account_alias']);
164
+ }
165
+ // ensure the json data is a string
166
+ if (data['account_number'] && !(typeof data['account_number'] === 'string' || data['account_number'] instanceof String)) {
167
+ throw new Error("Expected the field `account_number` to be a primitive type in the JSON string but got " + data['account_number']);
168
+ }
169
+ // ensure the json data is a string
170
+ if (data['swift_code'] && !(typeof data['swift_code'] === 'string' || data['swift_code'] instanceof String)) {
171
+ throw new Error("Expected the field `swift_code` to be a primitive type in the JSON string but got " + data['swift_code']);
172
+ }
173
+ // ensure the json data is a string
174
+ if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) {
175
+ throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']);
176
+ }
177
+ // ensure the json data is a string
178
+ if (data['beneficiary_name'] && !(typeof data['beneficiary_name'] === 'string' || data['beneficiary_name'] instanceof String)) {
179
+ throw new Error("Expected the field `beneficiary_name` to be a primitive type in the JSON string but got " + data['beneficiary_name']);
180
+ }
181
+ // ensure the json data is a string
182
+ if (data['beneficiary_address'] && !(typeof data['beneficiary_address'] === 'string' || data['beneficiary_address'] instanceof String)) {
183
+ throw new Error("Expected the field `beneficiary_address` to be a primitive type in the JSON string but got " + data['beneficiary_address']);
184
+ }
185
+ // ensure the json data is a string
186
+ if (data['bank_name'] && !(typeof data['bank_name'] === 'string' || data['bank_name'] instanceof String)) {
187
+ throw new Error("Expected the field `bank_name` to be a primitive type in the JSON string but got " + data['bank_name']);
188
+ }
189
+ // ensure the json data is a string
190
+ if (data['bank_address'] && !(typeof data['bank_address'] === 'string' || data['bank_address'] instanceof String)) {
191
+ throw new Error("Expected the field `bank_address` to be a primitive type in the JSON string but got " + data['bank_address']);
192
+ }
193
+ // ensure the json data is a string
194
+ if (data['iban_code'] && !(typeof data['iban_code'] === 'string' || data['iban_code'] instanceof String)) {
195
+ throw new Error("Expected the field `iban_code` to be a primitive type in the JSON string but got " + data['iban_code']);
196
+ }
197
+ // ensure the json data is a string
198
+ if (data['further_credit'] && !(typeof data['further_credit'] === 'string' || data['further_credit'] instanceof String)) {
199
+ throw new Error("Expected the field `further_credit` to be a primitive type in the JSON string but got " + data['further_credit']);
200
+ }
201
+ // validate the optional field `intermediary_bank_info`
202
+ if (data['intermediary_bank_info']) {
203
+ // data not null
204
+ if (!!_IntermediaryBankInfo["default"].validateJSON) {
205
+ _IntermediaryBankInfo["default"].validateJSON(data['intermediary_bank_info']);
206
+ }
207
+ }
208
+ return true;
209
+ }
210
+ }]);
211
+ }();
212
+ DestinationBankAccount.RequiredProperties = ["bank_account_id", "account_alias", "account_number", "swift_code", "currency", "beneficiary_name", "beneficiary_address", "bank_name", "bank_address", "bank_account_status"];
213
+
214
+ /**
215
+ * The destination bank account ID.
216
+ * @member {String} bank_account_id
217
+ */
218
+ DestinationBankAccount.prototype['bank_account_id'] = undefined;
219
+
220
+ /**
221
+ * The alias of the bank account.
222
+ * @member {String} account_alias
223
+ */
224
+ DestinationBankAccount.prototype['account_alias'] = undefined;
225
+
226
+ /**
227
+ * The bank account number.
228
+ * @member {String} account_number
229
+ */
230
+ DestinationBankAccount.prototype['account_number'] = undefined;
231
+
232
+ /**
233
+ * The SWIFT or BIC code of the bank.
234
+ * @member {String} swift_code
235
+ */
236
+ DestinationBankAccount.prototype['swift_code'] = undefined;
237
+
238
+ /**
239
+ * The currency of the bank account.
240
+ * @member {String} currency
241
+ */
242
+ DestinationBankAccount.prototype['currency'] = undefined;
243
+
244
+ /**
245
+ * The name of the account holder.
246
+ * @member {String} beneficiary_name
247
+ */
248
+ DestinationBankAccount.prototype['beneficiary_name'] = undefined;
249
+
250
+ /**
251
+ * The address of the account holder.
252
+ * @member {String} beneficiary_address
253
+ */
254
+ DestinationBankAccount.prototype['beneficiary_address'] = undefined;
255
+
256
+ /**
257
+ * The name of the bank.
258
+ * @member {String} bank_name
259
+ */
260
+ DestinationBankAccount.prototype['bank_name'] = undefined;
261
+
262
+ /**
263
+ * The address of the bank.
264
+ * @member {String} bank_address
265
+ */
266
+ DestinationBankAccount.prototype['bank_address'] = undefined;
267
+
268
+ /**
269
+ * The IBAN code of the bank account.
270
+ * @member {String} iban_code
271
+ */
272
+ DestinationBankAccount.prototype['iban_code'] = undefined;
273
+
274
+ /**
275
+ * The further credit of the bank account.
276
+ * @member {String} further_credit
277
+ */
278
+ DestinationBankAccount.prototype['further_credit'] = undefined;
279
+
280
+ /**
281
+ * @member {module:model/IntermediaryBankInfo} intermediary_bank_info
282
+ */
283
+ DestinationBankAccount.prototype['intermediary_bank_info'] = undefined;
284
+
285
+ /**
286
+ * @member {module:model/BankAccountStatus} bank_account_status
287
+ */
288
+ DestinationBankAccount.prototype['bank_account_status'] = undefined;
289
+
290
+ /**
291
+ * The created time of the bank account, represented as a UNIX timestamp in seconds.
292
+ * @member {Number} created_timestamp
293
+ */
294
+ DestinationBankAccount.prototype['created_timestamp'] = undefined;
295
+
296
+ /**
297
+ * The updated time of the bank account, represented as a UNIX timestamp in seconds.
298
+ * @member {Number} updated_timestamp
299
+ */
300
+ DestinationBankAccount.prototype['updated_timestamp'] = undefined;
301
+ var _default = exports["default"] = DestinationBankAccount;