@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
51 lines (48 loc) • 2.61 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/inventory_return_locations.ts
var InventoryReturnLocations = class _InventoryReturnLocations extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "inventory_return_locations";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _InventoryReturnLocations.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _InventoryReturnLocations.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _InventoryReturnLocations.TYPE } : id, options);
}
async stock_location(inventoryReturnLocationId, params, options) {
const _inventoryReturnLocationId = inventoryReturnLocationId.id || inventoryReturnLocationId;
return this.resources.fetch({ type: "stock_locations" }, `inventory_return_locations/${_inventoryReturnLocationId}/stock_location`, params, options);
}
async inventory_model(inventoryReturnLocationId, params, options) {
const _inventoryReturnLocationId = inventoryReturnLocationId.id || inventoryReturnLocationId;
return this.resources.fetch({ type: "inventory_models" }, `inventory_return_locations/${_inventoryReturnLocationId}/inventory_model`, params, options);
}
async versions(inventoryReturnLocationId, params, options) {
const _inventoryReturnLocationId = inventoryReturnLocationId.id || inventoryReturnLocationId;
return this.resources.fetch({ type: "versions" }, `inventory_return_locations/${_inventoryReturnLocationId}/versions`, params, options);
}
async event_stores(inventoryReturnLocationId, params, options) {
const _inventoryReturnLocationId = inventoryReturnLocationId.id || inventoryReturnLocationId;
return this.resources.fetch({ type: "event_stores" }, `inventory_return_locations/${_inventoryReturnLocationId}/event_stores`, params, options);
}
isInventoryReturnLocation(resource) {
return resource.type && resource.type === _InventoryReturnLocations.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _InventoryReturnLocations.TYPE;
}
};
var instance = new InventoryReturnLocations();
var inventory_return_locations_default = instance;
exports.inventory_return_locations_default = inventory_return_locations_default;
//# sourceMappingURL=chunk-RAF3LK5T.cjs.map
//# sourceMappingURL=chunk-RAF3LK5T.cjs.map
;