UNPKG

@commercelayer/sdk

Version:
59 lines (57 loc) 2.95 kB
import { ApiResource } from './chunk-XKERR6OR.js'; // src/resources/price_list_schedulers.ts var PriceListSchedulers = class _PriceListSchedulers extends ApiResource { static TYPE = "price_list_schedulers"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _PriceListSchedulers.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _PriceListSchedulers.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _PriceListSchedulers.TYPE } : id, options); } async market(priceListSchedulerId, params, options) { const _priceListSchedulerId = priceListSchedulerId.id || priceListSchedulerId; return this.resources.fetch({ type: "markets" }, `price_list_schedulers/${_priceListSchedulerId}/market`, params, options); } async price_list(priceListSchedulerId, params, options) { const _priceListSchedulerId = priceListSchedulerId.id || priceListSchedulerId; return this.resources.fetch({ type: "price_lists" }, `price_list_schedulers/${_priceListSchedulerId}/price_list`, params, options); } async events(priceListSchedulerId, params, options) { const _priceListSchedulerId = priceListSchedulerId.id || priceListSchedulerId; return this.resources.fetch({ type: "events" }, `price_list_schedulers/${_priceListSchedulerId}/events`, params, options); } async versions(priceListSchedulerId, params, options) { const _priceListSchedulerId = priceListSchedulerId.id || priceListSchedulerId; return this.resources.fetch({ type: "versions" }, `price_list_schedulers/${_priceListSchedulerId}/versions`, params, options); } async event_stores(priceListSchedulerId, params, options) { const _priceListSchedulerId = priceListSchedulerId.id || priceListSchedulerId; return this.resources.fetch({ type: "event_stores" }, `price_list_schedulers/${_priceListSchedulerId}/event_stores`, params, options); } async _disable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _PriceListSchedulers.TYPE, _disable: true }, params, options); } async _enable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _PriceListSchedulers.TYPE, _enable: true }, params, options); } isPriceListScheduler(resource) { return resource.type && resource.type === _PriceListSchedulers.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _PriceListSchedulers.TYPE; } }; var instance = new PriceListSchedulers(); var price_list_schedulers_default = instance; export { price_list_schedulers_default }; //# sourceMappingURL=chunk-4XQNILDJ.js.map //# sourceMappingURL=chunk-4XQNILDJ.js.map