square-connect
Version:
JavaScript client library for the Square Connect v2 API
111 lines (89 loc) • 3.48 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 CatalogTax model module.
* @module model/CatalogTax
*/
/**
* Constructs a new <code>CatalogTax</code>.
* A tax applicable to an item.
* @alias module:model/CatalogTax
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>CatalogTax</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/CatalogTax} obj Optional instance to populate.
* @return {module:model/CatalogTax} The populated <code>CatalogTax</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('calculation_phase')) {
obj['calculation_phase'] = ApiClient.convertToType(data['calculation_phase'], 'String');
}
if (data.hasOwnProperty('inclusion_type')) {
obj['inclusion_type'] = ApiClient.convertToType(data['inclusion_type'], 'String');
}
if (data.hasOwnProperty('percentage')) {
obj['percentage'] = ApiClient.convertToType(data['percentage'], 'String');
}
if (data.hasOwnProperty('applies_to_custom_amounts')) {
obj['applies_to_custom_amounts'] = ApiClient.convertToType(data['applies_to_custom_amounts'], 'Boolean');
}
if (data.hasOwnProperty('enabled')) {
obj['enabled'] = ApiClient.convertToType(data['enabled'], 'Boolean');
}
}
return obj;
}
/**
* The tax's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* Whether the tax is calculated based on a payment's subtotal or total. See [TaxCalculationPhase](#type-taxcalculationphase) for possible values
* @member {String} calculation_phase
*/
exports.prototype['calculation_phase'] = undefined;
/**
* Whether the tax is `ADDITIVE` or `INCLUSIVE`. See [TaxInclusionType](#type-taxinclusiontype) for possible values
* @member {String} inclusion_type
*/
exports.prototype['inclusion_type'] = undefined;
/**
* The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. A value of `7.5` corresponds to 7.5%.
* @member {String} percentage
*/
exports.prototype['percentage'] = undefined;
/**
* If `true`, the fee applies to custom amounts entered into the Square Point of Sale app that are not associated with a particular `CatalogItem`.
* @member {Boolean} applies_to_custom_amounts
*/
exports.prototype['applies_to_custom_amounts'] = undefined;
/**
* A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`).
* @member {Boolean} enabled
*/
exports.prototype['enabled'] = undefined;
module.exports = exports;