square-connect
Version:
JavaScript client library for the Square Connect v2 API
76 lines (58 loc) • 2.29 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 MeasurementUnit = require('./MeasurementUnit');
/**
* The OrderQuantityUnit model module.
* @module model/OrderQuantityUnit
*/
/**
* Constructs a new <code>OrderQuantityUnit</code>.
* Contains the measurement unit for a quantity and a precision which specifies the number of digits after the decimal point for decimal quantities.
* @alias module:model/OrderQuantityUnit
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>OrderQuantityUnit</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/OrderQuantityUnit} obj Optional instance to populate.
* @return {module:model/OrderQuantityUnit} The populated <code>OrderQuantityUnit</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;
}
/**
* A `MeasurementUnit` that represents the unit of measure for the quantity.
* @member {module:model/MeasurementUnit} measurement_unit
*/
exports.prototype['measurement_unit'] = undefined;
/**
* For non-integer quantities, represents the number of digits after the decimal point that are recorded for this quantity. For example, a precision of 1 allows quantities like `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`. Min: 0. Max: 5.
* @member {Number} precision
*/
exports.prototype['precision'] = undefined;
module.exports = exports;