UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

77 lines (59 loc) 2.45 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 CatalogMeasurementUnit model module. * Note: This model is in beta. * @module model/CatalogMeasurementUnit */ /** * Constructs a new <code>CatalogMeasurementUnit</code>. * Represents the unit used to measure a &#x60;CatalogItemVariation&#x60; and specifies the precision for decimal quantities. * @alias module:model/CatalogMeasurementUnit * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>CatalogMeasurementUnit</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/CatalogMeasurementUnit} obj Optional instance to populate. * @return {module:model/CatalogMeasurementUnit} The populated <code>CatalogMeasurementUnit</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('measurement_unit')) { obj['measurement_unit'] = MeasurementUnit.constructFromObject(data['measurement_unit']); } if (data.hasOwnProperty('precision')) { obj['precision'] = ApiClient.convertToType(data['precision'], 'Number'); } } return obj; } /** * Indicates the unit used to measure the quantity of a catalog item variation. * @member {module:model/MeasurementUnit} measurement_unit */ exports.prototype['measurement_unit'] = undefined; /** * An integer between 0 and 5 that represents the maximum number of positions allowed after the decimal in quantities measured with this unit. For example: - if the precision is 0, the quantity can be 1, 2, 3, etc. - if the precision is 1, the quantity can be 0.1, 0.2, etc. - if the precision is 2, the quantity can be 0.01, 0.12, etc. Default: 3 * @member {Number} precision */ exports.prototype['precision'] = undefined; module.exports = exports;