UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

78 lines (62 loc) 2.15 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'); /** * The OrderReward model module. * Note: This model is in beta. * @module model/OrderReward */ /** * Constructs a new <code>OrderReward</code>. * Represents a reward that may be applied to an order if the necessary reward tier criteria are met. Rewards are created through the Loyalty API. * @alias module:model/OrderReward * @class * @param id {String} The identifier of the reward. * @param rewardTierId {String} The identifier of the reward tier corresponding to this reward. */ var exports = function(id, rewardTierId) { var _this = this; _this['id'] = id; _this['reward_tier_id'] = rewardTierId; }; /** * Constructs a <code>OrderReward</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/OrderReward} obj Optional instance to populate. * @return {module:model/OrderReward} The populated <code>OrderReward</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('reward_tier_id')) { obj['reward_tier_id'] = ApiClient.convertToType(data['reward_tier_id'], 'String'); } } return obj; } /** * The identifier of the reward. * @member {String} id */ exports.prototype['id'] = undefined; /** * The identifier of the reward tier corresponding to this reward. * @member {String} reward_tier_id */ exports.prototype['reward_tier_id'] = undefined; module.exports = exports;