square-connect
Version:
JavaScript client library for the Square Connect v2 API
148 lines (122 loc) • 4.5 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');
/**
* @deprecated
* The V1Fee model module.
* @module model/V1Fee
*/
/**
* Constructs a new <code>V1Fee</code>.
* V1Fee
* @alias module:model/V1Fee
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>V1Fee</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/V1Fee} obj Optional instance to populate.
* @return {module:model/V1Fee} The populated <code>V1Fee</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('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('rate')) {
obj['rate'] = ApiClient.convertToType(data['rate'], 'String');
}
if (data.hasOwnProperty('calculation_phase')) {
obj['calculation_phase'] = ApiClient.convertToType(data['calculation_phase'], 'String');
}
if (data.hasOwnProperty('adjustment_type')) {
obj['adjustment_type'] = ApiClient.convertToType(data['adjustment_type'], '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');
}
if (data.hasOwnProperty('inclusion_type')) {
obj['inclusion_type'] = ApiClient.convertToType(data['inclusion_type'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('v2_id')) {
obj['v2_id'] = ApiClient.convertToType(data['v2_id'], 'String');
}
}
return obj;
}
/**
* The fee's unique ID.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* The fee's name.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* The rate of the fee, as a string representation of a decimal number. A value of 0.07 corresponds to a rate of 7%.
* @member {String} rate
*/
exports.prototype['rate'] = undefined;
/**
* Forthcoming See [V1FeeCalculationPhase](#type-v1feecalculationphase) for possible values
* @member {String} calculation_phase
*/
exports.prototype['calculation_phase'] = undefined;
/**
* The type of adjustment the fee applies to a payment. Currently, this value is TAX for all fees. See [V1FeeAdjustmentType](#type-v1feeadjustmenttype) for possible values
* @member {String} adjustment_type
*/
exports.prototype['adjustment_type'] = undefined;
/**
* If true, the fee applies to custom amounts entered into Square Point of Sale that are not associated with a particular item.
* @member {Boolean} applies_to_custom_amounts
*/
exports.prototype['applies_to_custom_amounts'] = undefined;
/**
* If true, the fee is applied to all appropriate items. If false, the fee is not applied at all.
* @member {Boolean} enabled
*/
exports.prototype['enabled'] = undefined;
/**
* Whether the fee is ADDITIVE or INCLUSIVE. See [V1FeeInclusionType](#type-v1feeinclusiontype) for possible values
* @member {String} inclusion_type
*/
exports.prototype['inclusion_type'] = undefined;
/**
* In countries with multiple classifications for sales taxes, indicates which classification the fee falls under. Currently relevant only to Canadian merchants. See [V1FeeType](#type-v1feetype) for possible values
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID.
* @member {String} v2_id
*/
exports.prototype['v2_id'] = undefined;
module.exports = exports;