square-connect
Version:
JavaScript client library for the Square Connect v2 API
220 lines (197 loc) • 9.3 kB
JavaScript
/**
* Square Connect API
* Client library for accessing the Square Connect APIs
*
* OpenAPI spec version: 2.0
* Contact: developers@squareup.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.3.0-SNAPSHOT
*
*/
var ApiClient = require('../ApiClient');
/**
* The BankAccount model module.
* @module model/BankAccount
*/
/**
* Constructs a new <code>BankAccount</code>.
* Represents a bank account. For more information about linking a bank account to a Square account, see [Bank Accounts API](/docs/bank-accounts-api).
* @alias module:model/BankAccount
* @class
* @param id {String} The unique, Square-issued identifier for the bank account.
* @param accountNumberSuffix {String} The last few digits of the account number.
* @param country {String} The ISO 3166 Alpha-2 country code where the bank account is based. See [Country](#type-country) for possible values
* @param currency {String} The 3-character ISO 4217 currency code indicating the operating currency of the bank account. For example, the currency code for US dollars is `USD`. See [Currency](#type-currency) for possible values
* @param accountType {String} The financial purpose of the associated bank account. See [BankAccountType](#type-bankaccounttype) for possible values
* @param holderName {String} Name of the account holder. This name must match the name on the targeted bank account record.
* @param primaryBankIdentificationNumber {String} Primary identifier for the bank. For more information, see [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api).
* @param status {String} Read-only. The current verification status of this BankAccount object. See [BankAccountStatus](#type-bankaccountstatus) for possible values
* @param creditable {Boolean} Indicates whether it is possible for Square to send money to this bank account.
* @param debitable {Boolean} Indicates whether it is possible for Square to take money from this bank account.
*/
var exports = function(id, accountNumberSuffix, country, currency, accountType, holderName, primaryBankIdentificationNumber, status, creditable, debitable) {
var _this = this;
_this['id'] = id;
_this['account_number_suffix'] = accountNumberSuffix;
_this['country'] = country;
_this['currency'] = currency;
_this['account_type'] = accountType;
_this['holder_name'] = holderName;
_this['primary_bank_identification_number'] = primaryBankIdentificationNumber;
_this['status'] = status;
_this['creditable'] = creditable;
_this['debitable'] = debitable;
};
/**
* Constructs a <code>BankAccount</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/BankAccount} obj Optional instance to populate.
* @return {module:model/BankAccount} The populated <code>BankAccount</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('account_number_suffix')) {
obj['account_number_suffix'] = ApiClient.convertToType(data['account_number_suffix'], 'String');
}
if (data.hasOwnProperty('country')) {
obj['country'] = ApiClient.convertToType(data['country'], 'String');
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
}
if (data.hasOwnProperty('account_type')) {
obj['account_type'] = ApiClient.convertToType(data['account_type'], 'String');
}
if (data.hasOwnProperty('holder_name')) {
obj['holder_name'] = ApiClient.convertToType(data['holder_name'], 'String');
}
if (data.hasOwnProperty('primary_bank_identification_number')) {
obj['primary_bank_identification_number'] = ApiClient.convertToType(data['primary_bank_identification_number'], 'String');
}
if (data.hasOwnProperty('secondary_bank_identification_number')) {
obj['secondary_bank_identification_number'] = ApiClient.convertToType(data['secondary_bank_identification_number'], 'String');
}
if (data.hasOwnProperty('debit_mandate_reference_id')) {
obj['debit_mandate_reference_id'] = ApiClient.convertToType(data['debit_mandate_reference_id'], 'String');
}
if (data.hasOwnProperty('reference_id')) {
obj['reference_id'] = ApiClient.convertToType(data['reference_id'], 'String');
}
if (data.hasOwnProperty('location_id')) {
obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('creditable')) {
obj['creditable'] = ApiClient.convertToType(data['creditable'], 'Boolean');
}
if (data.hasOwnProperty('debitable')) {
obj['debitable'] = ApiClient.convertToType(data['debitable'], 'Boolean');
}
if (data.hasOwnProperty('fingerprint')) {
obj['fingerprint'] = ApiClient.convertToType(data['fingerprint'], 'String');
}
if (data.hasOwnProperty('version')) {
obj['version'] = ApiClient.convertToType(data['version'], 'Number');
}
if (data.hasOwnProperty('bank_name')) {
obj['bank_name'] = ApiClient.convertToType(data['bank_name'], 'String');
}
}
return obj;
}
/**
* The unique, Square-issued identifier for the bank account.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* The last few digits of the account number.
* @member {String} account_number_suffix
*/
exports.prototype['account_number_suffix'] = undefined;
/**
* The ISO 3166 Alpha-2 country code where the bank account is based. See [Country](#type-country) for possible values
* @member {String} country
*/
exports.prototype['country'] = undefined;
/**
* The 3-character ISO 4217 currency code indicating the operating currency of the bank account. For example, the currency code for US dollars is `USD`. See [Currency](#type-currency) for possible values
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* The financial purpose of the associated bank account. See [BankAccountType](#type-bankaccounttype) for possible values
* @member {String} account_type
*/
exports.prototype['account_type'] = undefined;
/**
* Name of the account holder. This name must match the name on the targeted bank account record.
* @member {String} holder_name
*/
exports.prototype['holder_name'] = undefined;
/**
* Primary identifier for the bank. For more information, see [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api).
* @member {String} primary_bank_identification_number
*/
exports.prototype['primary_bank_identification_number'] = undefined;
/**
* Secondary identifier for the bank. For more information, see [Bank Accounts API](https://developer.squareup.com/docs/docs/bank-accounts-api).
* @member {String} secondary_bank_identification_number
*/
exports.prototype['secondary_bank_identification_number'] = undefined;
/**
* Reference identifier that will be displayed to UK bank account owners when collecting direct debit authorization. Only required for UK bank accounts.
* @member {String} debit_mandate_reference_id
*/
exports.prototype['debit_mandate_reference_id'] = undefined;
/**
* Client-provided identifier for linking the banking account to an entity in a third-party system (for example, a bank account number or a user identifier).
* @member {String} reference_id
*/
exports.prototype['reference_id'] = undefined;
/**
* The location to which the bank account belongs.
* @member {String} location_id
*/
exports.prototype['location_id'] = undefined;
/**
* Read-only. The current verification status of this BankAccount object. See [BankAccountStatus](#type-bankaccountstatus) for possible values
* @member {String} status
*/
exports.prototype['status'] = undefined;
/**
* Indicates whether it is possible for Square to send money to this bank account.
* @member {Boolean} creditable
*/
exports.prototype['creditable'] = undefined;
/**
* Indicates whether it is possible for Square to take money from this bank account.
* @member {Boolean} debitable
*/
exports.prototype['debitable'] = undefined;
/**
* A Square-assigned, unique identifier for the bank account based on the account information. The account fingerprint can be used to compare account entries and determine if the they represent the same real-world bank account.
* @member {String} fingerprint
*/
exports.prototype['fingerprint'] = undefined;
/**
* The current version of the `BankAccount`.
* @member {Number} version
*/
exports.prototype['version'] = undefined;
/**
* Read only. Name of actual financial institution. For example \"Bank of America\".
* @member {String} bank_name
*/
exports.prototype['bank_name'] = undefined;
module.exports = exports;