UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

85 lines (66 loc) 2.27 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 MeasurementUnit = require('./MeasurementUnit'); /** * The StandardUnitDescription model module. * @module model/StandardUnitDescription */ /** * Constructs a new <code>StandardUnitDescription</code>. * Contains the name and abbreviation for standard measurement unit. * @alias module:model/StandardUnitDescription * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>StandardUnitDescription</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/StandardUnitDescription} obj Optional instance to populate. * @return {module:model/StandardUnitDescription} The populated <code>StandardUnitDescription</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('unit')) { obj['unit'] = MeasurementUnit.constructFromObject(data['unit']); } if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'String'); } if (data.hasOwnProperty('abbreviation')) { obj['abbreviation'] = ApiClient.convertToType(data['abbreviation'], 'String'); } } return obj; } /** * Identifies the measurement unit being described. * @member {module:model/MeasurementUnit} unit */ exports.prototype['unit'] = undefined; /** * UI display name of the measurement unit. For example, 'Pound'. * @member {String} name */ exports.prototype['name'] = undefined; /** * UI display abbreviation for the measurement unit. For example, 'lb'. * @member {String} abbreviation */ exports.prototype['abbreviation'] = undefined; module.exports = exports;