UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

79 lines (63 loc) 2.55 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 LoyaltyAccount = require('./LoyaltyAccount'); /** * The CreateLoyaltyAccountRequest model module. * Note: This model is in beta. * @module model/CreateLoyaltyAccountRequest */ /** * Constructs a new <code>CreateLoyaltyAccountRequest</code>. * A request to create a new loyalty account. * @alias module:model/CreateLoyaltyAccountRequest * @class * @param loyaltyAccount {module:model/LoyaltyAccount} The loyalty account to create. * @param idempotencyKey {String} A unique string that identifies this `CreateLoyaltyAccount` request. Keys can be any valid string, but must be unique for every request. */ var exports = function(loyaltyAccount, idempotencyKey) { var _this = this; _this['loyalty_account'] = loyaltyAccount; _this['idempotency_key'] = idempotencyKey; }; /** * Constructs a <code>CreateLoyaltyAccountRequest</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/CreateLoyaltyAccountRequest} obj Optional instance to populate. * @return {module:model/CreateLoyaltyAccountRequest} The populated <code>CreateLoyaltyAccountRequest</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('loyalty_account')) { obj['loyalty_account'] = LoyaltyAccount.constructFromObject(data['loyalty_account']); } if (data.hasOwnProperty('idempotency_key')) { obj['idempotency_key'] = ApiClient.convertToType(data['idempotency_key'], 'String'); } } return obj; } /** * The loyalty account to create. * @member {module:model/LoyaltyAccount} loyalty_account */ exports.prototype['loyalty_account'] = undefined; /** * A unique string that identifies this `CreateLoyaltyAccount` request. Keys can be any valid string, but must be unique for every request. * @member {String} idempotency_key */ exports.prototype['idempotency_key'] = undefined; module.exports = exports;