UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

84 lines (65 loc) 2.4 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 OrderEntry model module. * @module model/OrderEntry */ /** * Constructs a new <code>OrderEntry</code>. * A lightweight description of an [Order](#type-order) that is returned when &#x60;returned_entries&#x60; is true on a [SearchOrderRequest](#type-searchorderrequest) * @alias module:model/OrderEntry * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>OrderEntry</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/OrderEntry} obj Optional instance to populate. * @return {module:model/OrderEntry} The populated <code>OrderEntry</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('order_id')) { obj['order_id'] = ApiClient.convertToType(data['order_id'], 'String'); } if (data.hasOwnProperty('version')) { obj['version'] = ApiClient.convertToType(data['version'], 'Number'); } if (data.hasOwnProperty('location_id')) { obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String'); } } return obj; } /** * The id of the Order * @member {String} order_id */ exports.prototype['order_id'] = undefined; /** * Version number which is incremented each time an update is committed to the order. Orders that were not created through the API will not include a version and thus cannot be updated. [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders#update-orders). * @member {Number} version */ exports.prototype['version'] = undefined; /** * The location id the Order belongs to. * @member {String} location_id */ exports.prototype['location_id'] = undefined; module.exports = exports;