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