square-connect
Version:
JavaScript client library for the Square Connect v2 API
75 lines (57 loc) • 2.32 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 OrderPricingOptions model module.
* @module model/OrderPricingOptions
*/
/**
* Constructs a new <code>OrderPricingOptions</code>.
* Pricing options for an order. The options affect how the order's price is calculated. They can be used, for example, to apply automatic price adjustments that are based on pre-configured [pricing rules](/reference/square/objects/CatalogPricingRule).
* @alias module:model/OrderPricingOptions
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>OrderPricingOptions</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/OrderPricingOptions} obj Optional instance to populate.
* @return {module:model/OrderPricingOptions} The populated <code>OrderPricingOptions</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('auto_apply_discounts')) {
obj['auto_apply_discounts'] = ApiClient.convertToType(data['auto_apply_discounts'], 'Boolean');
}
if (data.hasOwnProperty('auto_apply_taxes')) {
obj['auto_apply_taxes'] = ApiClient.convertToType(data['auto_apply_taxes'], 'Boolean');
}
}
return obj;
}
/**
* The option to determine whether pricing rule-based discounts are automatically applied to an order.
* @member {Boolean} auto_apply_discounts
*/
exports.prototype['auto_apply_discounts'] = undefined;
/**
* The option to determine whether rule-based taxes are automatically applied to an order when the criteria of the corresponding rules are met.
* @member {Boolean} auto_apply_taxes
*/
exports.prototype['auto_apply_taxes'] = undefined;
module.exports = exports;