square-connect
Version:
JavaScript client library for the Square Connect v2 API
77 lines (59 loc) • 2.39 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');
var Money = require('./Money');
/**
* The CalculateLoyaltyPointsRequest model module.
* Note: This model is in beta.
* @module model/CalculateLoyaltyPointsRequest
*/
/**
* Constructs a new <code>CalculateLoyaltyPointsRequest</code>.
* A request to calculate the points that a buyer can earn from a specified purchase.
* @alias module:model/CalculateLoyaltyPointsRequest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>CalculateLoyaltyPointsRequest</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/CalculateLoyaltyPointsRequest} obj Optional instance to populate.
* @return {module:model/CalculateLoyaltyPointsRequest} The populated <code>CalculateLoyaltyPointsRequest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('order_id')) {
obj['order_id'] = ApiClient.convertToType(data['order_id'], 'String');
}
if (data.hasOwnProperty('transaction_amount_money')) {
obj['transaction_amount_money'] = Money.constructFromObject(data['transaction_amount_money']);
}
}
return obj;
}
/**
* The `order` ID for which to calculate the points. Specify this field if your application uses the Orders API to process orders. Otherwise, specify the `transaction_amount`.
* @member {String} order_id
*/
exports.prototype['order_id'] = undefined;
/**
* The purchase amount for which to calculate the points. Specify this field if your application does not use the Orders API to process orders. Otherwise, specify the `order_id`.
* @member {module:model/Money} transaction_amount_money
*/
exports.prototype['transaction_amount_money'] = undefined;
module.exports = exports;