UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

96 lines (76 loc) 3.23 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 InventoryAdjustment = require('./InventoryAdjustment'); var InventoryPhysicalCount = require('./InventoryPhysicalCount'); var InventoryTransfer = require('./InventoryTransfer'); /** * The InventoryChange model module. * @module model/InventoryChange */ /** * Constructs a new <code>InventoryChange</code>. * Represents a single physical count, inventory, adjustment, or transfer that is part of the history of inventory changes for a particular &#x60;CatalogObject&#x60;. * @alias module:model/InventoryChange * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>InventoryChange</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/InventoryChange} obj Optional instance to populate. * @return {module:model/InventoryChange} The populated <code>InventoryChange</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('type')) { obj['type'] = ApiClient.convertToType(data['type'], 'String'); } if (data.hasOwnProperty('physical_count')) { obj['physical_count'] = InventoryPhysicalCount.constructFromObject(data['physical_count']); } if (data.hasOwnProperty('adjustment')) { obj['adjustment'] = InventoryAdjustment.constructFromObject(data['adjustment']); } if (data.hasOwnProperty('transfer')) { obj['transfer'] = InventoryTransfer.constructFromObject(data['transfer']); } } return obj; } /** * Indicates how the inventory change was applied. See `InventoryChangeType` for all possible values. See [InventoryChangeType](#type-inventorychangetype) for possible values * @member {String} type */ exports.prototype['type'] = undefined; /** * Contains details about the physical count when `type` is `PHYSICAL_COUNT` and unset for all other types. * @member {module:model/InventoryPhysicalCount} physical_count */ exports.prototype['physical_count'] = undefined; /** * Contains details about the inventory adjustment when `type` is `ADJUSTMENT` and unset for all other types. * @member {module:model/InventoryAdjustment} adjustment */ exports.prototype['adjustment'] = undefined; /** * Contains details about the inventory transfer when `type` is `TRANSFER` and unset for all other types. _Note:_ An `InventoryTransfer` object is read-only and can only be present in a `RetrieveInventoryChangesResponse` and `BatchRetrieveInventoryChangesResponse` object. * @member {module:model/InventoryTransfer} transfer */ exports.prototype['transfer'] = undefined; module.exports = exports;