UNPKG

@commercelayer/sdk

Version:
42 lines (39 loc) 1.77 kB
'use strict'; var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs'); // src/resources/reserved_stocks.ts var ReservedStocks = class _ReservedStocks extends chunkVRRJS3ZM_cjs.ApiResource { static TYPE = "reserved_stocks"; async stock_item(reservedStockId, params, options) { const _reservedStockId = reservedStockId.id || reservedStockId; return this.resources.fetch({ type: "stock_items" }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options); } async sku(reservedStockId, params, options) { const _reservedStockId = reservedStockId.id || reservedStockId; return this.resources.fetch({ type: "skus" }, `reserved_stocks/${_reservedStockId}/sku`, params, options); } async stock_reservations(reservedStockId, params, options) { const _reservedStockId = reservedStockId.id || reservedStockId; return this.resources.fetch({ type: "stock_reservations" }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options); } async event_stores(reservedStockId, params, options) { const _reservedStockId = reservedStockId.id || reservedStockId; return this.resources.fetch({ type: "event_stores" }, `reserved_stocks/${_reservedStockId}/event_stores`, params, options); } isReservedStock(resource) { return resource.type && resource.type === _ReservedStocks.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _ReservedStocks.TYPE; } }; var instance = new ReservedStocks(); var reserved_stocks_default = instance; exports.reserved_stocks_default = reserved_stocks_default; //# sourceMappingURL=chunk-LL3M46A5.cjs.map //# sourceMappingURL=chunk-LL3M46A5.cjs.map