UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

96 lines (78 loc) 2.83 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 LoyaltyAccountMapping model module. * Note: This model is in beta. * @module model/LoyaltyAccountMapping */ /** * Constructs a new <code>LoyaltyAccountMapping</code>. * Associates a loyalty account with the buyer&#39;s phone number. For more information, see [Loyalty Overview](/docs/loyalty/overview). * @alias module:model/LoyaltyAccountMapping * @class * @param type {String} The type of mapping. See [LoyaltyAccountMappingType](#type-loyaltyaccountmappingtype) for possible values * @param value {String} The phone number, in E.164 format. For example, \"+14155551111\". */ var exports = function(type, value) { var _this = this; _this['type'] = type; _this['value'] = value; }; /** * Constructs a <code>LoyaltyAccountMapping</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/LoyaltyAccountMapping} obj Optional instance to populate. * @return {module:model/LoyaltyAccountMapping} The populated <code>LoyaltyAccountMapping</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('type')) { obj['type'] = ApiClient.convertToType(data['type'], 'String'); } if (data.hasOwnProperty('value')) { obj['value'] = ApiClient.convertToType(data['value'], 'String'); } if (data.hasOwnProperty('created_at')) { obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String'); } } return obj; } /** * The Square-assigned ID of the mapping. * @member {String} id */ exports.prototype['id'] = undefined; /** * The type of mapping. See [LoyaltyAccountMappingType](#type-loyaltyaccountmappingtype) for possible values * @member {String} type */ exports.prototype['type'] = undefined; /** * The phone number, in E.164 format. For example, \"+14155551111\". * @member {String} value */ exports.prototype['value'] = undefined; /** * The timestamp when the mapping was created, in RFC 3339 format. * @member {String} created_at */ exports.prototype['created_at'] = undefined; module.exports = exports;