square-connect
Version:
JavaScript client library for the Square Connect v2 API
85 lines (66 loc) • 2.81 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 OrderLineItemPricingBlocklistsBlockedDiscount model module.
* Note: This model is in beta.
* @module model/OrderLineItemPricingBlocklistsBlockedDiscount
*/
/**
* Constructs a new <code>OrderLineItemPricingBlocklistsBlockedDiscount</code>.
* A discount to block from applying to a line item. The discount must be identified by either `discount_uid` or `discount_catalog_object_id`, but not both.
* @alias module:model/OrderLineItemPricingBlocklistsBlockedDiscount
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>OrderLineItemPricingBlocklistsBlockedDiscount</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/OrderLineItemPricingBlocklistsBlockedDiscount} obj Optional instance to populate.
* @return {module:model/OrderLineItemPricingBlocklistsBlockedDiscount} The populated <code>OrderLineItemPricingBlocklistsBlockedDiscount</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('discount_uid')) {
obj['discount_uid'] = ApiClient.convertToType(data['discount_uid'], 'String');
}
if (data.hasOwnProperty('discount_catalog_object_id')) {
obj['discount_catalog_object_id'] = ApiClient.convertToType(data['discount_catalog_object_id'], 'String');
}
}
return obj;
}
/**
* Unique ID of the `BlockedDiscount` within the order.
* @member {String} uid
*/
exports.prototype['uid'] = undefined;
/**
* The `uid` of the discount that should be blocked. Use this field to block ad-hoc discounts. For catalog discounts use the `discount_catalog_object_id` field.
* @member {String} discount_uid
*/
exports.prototype['discount_uid'] = undefined;
/**
* The `catalog_object_id` of the discount that should be blocked. Use this field to block catalog discounts. For ad-hoc discounts use the `discount_uid` field.
* @member {String} discount_catalog_object_id
*/
exports.prototype['discount_catalog_object_id'] = undefined;
module.exports = exports;