UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

122 lines (99 loc) 3.72 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 OrderFulfillmentUpdatedUpdate = require('./OrderFulfillmentUpdatedUpdate'); /** * The OrderFulfillmentUpdated model module. * Note: This model is in beta. * @module model/OrderFulfillmentUpdated */ /** * Constructs a new <code>OrderFulfillmentUpdated</code>. * * @alias module:model/OrderFulfillmentUpdated * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>OrderFulfillmentUpdated</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/OrderFulfillmentUpdated} obj Optional instance to populate. * @return {module:model/OrderFulfillmentUpdated} The populated <code>OrderFulfillmentUpdated</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'); } if (data.hasOwnProperty('state')) { obj['state'] = ApiClient.convertToType(data['state'], 'String'); } if (data.hasOwnProperty('created_at')) { obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String'); } if (data.hasOwnProperty('updated_at')) { obj['updated_at'] = ApiClient.convertToType(data['updated_at'], 'String'); } if (data.hasOwnProperty('fulfillment_update')) { obj['fulfillment_update'] = ApiClient.convertToType(data['fulfillment_update'], [OrderFulfillmentUpdatedUpdate]); } } return obj; } /** * The order's unique ID. * @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/docs/orders-api/manage-orders#update-orders) * @member {Number} version */ exports.prototype['version'] = undefined; /** * The ID of the merchant location this order is associated with. * @member {String} location_id */ exports.prototype['location_id'] = undefined; /** * The state of the order. See [OrderState](#type-orderstate) for possible values * @member {String} state */ exports.prototype['state'] = undefined; /** * Timestamp for when the order was created in RFC 3339 format. * @member {String} created_at */ exports.prototype['created_at'] = undefined; /** * Timestamp for when the order was last updated in RFC 3339 format. * @member {String} updated_at */ exports.prototype['updated_at'] = undefined; /** * The fulfillments that were updated with this version change. * @member {Array.<module:model/OrderFulfillmentUpdatedUpdate>} fulfillment_update */ exports.prototype['fulfillment_update'] = undefined; module.exports = exports;