@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
61 lines (58 loc) • 3.02 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/price_list_schedulers.ts
var PriceListSchedulers = class _PriceListSchedulers extends chunkU22VLCMN_cjs.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;
exports.price_list_schedulers_default = price_list_schedulers_default;
//# sourceMappingURL=chunk-RK3E3UJ2.cjs.map
//# sourceMappingURL=chunk-RK3E3UJ2.cjs.map
;