UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

87 lines (69 loc) 3 kB
/** * 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'); var Money = require('./Money'); /** * The OrderLineItemAppliedTax model module. * Note: This model is in beta. * @module model/OrderLineItemAppliedTax */ /** * Constructs a new <code>OrderLineItemAppliedTax</code>. * Represents an applied portion of a tax to a line item in an order. Order-scoped taxes automatically include the applied taxes in each line item. Line item taxes must be referenced from any applicable line items. The corresponding applied money is automatically computed, based on the set of participating line items. * @alias module:model/OrderLineItemAppliedTax * @class * @param taxUid {String} The `uid` of the tax for which this applied tax represents. Must reference a tax present in the `order.taxes` field. This field is immutable. To change which taxes apply to a line item, delete and add new `OrderLineItemAppliedTax`s. */ var exports = function(taxUid) { var _this = this; _this['tax_uid'] = taxUid; }; /** * Constructs a <code>OrderLineItemAppliedTax</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/OrderLineItemAppliedTax} obj Optional instance to populate. * @return {module:model/OrderLineItemAppliedTax} The populated <code>OrderLineItemAppliedTax</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('uid')) { obj['uid'] = ApiClient.convertToType(data['uid'], 'String'); } if (data.hasOwnProperty('tax_uid')) { obj['tax_uid'] = ApiClient.convertToType(data['tax_uid'], 'String'); } if (data.hasOwnProperty('applied_money')) { obj['applied_money'] = Money.constructFromObject(data['applied_money']); } } return obj; } /** * Unique ID that identifies the applied tax only within this order. * @member {String} uid */ exports.prototype['uid'] = undefined; /** * The `uid` of the tax for which this applied tax represents. Must reference a tax present in the `order.taxes` field. This field is immutable. To change which taxes apply to a line item, delete and add new `OrderLineItemAppliedTax`s. * @member {String} tax_uid */ exports.prototype['tax_uid'] = undefined; /** * The amount of money applied by the tax to the line item. * @member {module:model/Money} applied_money */ exports.prototype['applied_money'] = undefined; module.exports = exports;