@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
55 lines (52 loc) • 2.61 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/delivery_lead_times.ts
var DeliveryLeadTimes = class _DeliveryLeadTimes extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "delivery_lead_times";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _DeliveryLeadTimes.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _DeliveryLeadTimes.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _DeliveryLeadTimes.TYPE } : id, options);
}
async stock_location(deliveryLeadTimeId, params, options) {
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
return this.resources.fetch({ type: "stock_locations" }, `delivery_lead_times/${_deliveryLeadTimeId}/stock_location`, params, options);
}
async shipping_method(deliveryLeadTimeId, params, options) {
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
return this.resources.fetch({ type: "shipping_methods" }, `delivery_lead_times/${_deliveryLeadTimeId}/shipping_method`, params, options);
}
async attachments(deliveryLeadTimeId, params, options) {
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
return this.resources.fetch({ type: "attachments" }, `delivery_lead_times/${_deliveryLeadTimeId}/attachments`, params, options);
}
async versions(deliveryLeadTimeId, params, options) {
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
return this.resources.fetch({ type: "versions" }, `delivery_lead_times/${_deliveryLeadTimeId}/versions`, params, options);
}
async event_stores(deliveryLeadTimeId, params, options) {
const _deliveryLeadTimeId = deliveryLeadTimeId.id || deliveryLeadTimeId;
return this.resources.fetch({ type: "event_stores" }, `delivery_lead_times/${_deliveryLeadTimeId}/event_stores`, params, options);
}
isDeliveryLeadTime(resource) {
return resource.type && resource.type === _DeliveryLeadTimes.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _DeliveryLeadTimes.TYPE;
}
};
var instance = new DeliveryLeadTimes();
var delivery_lead_times_default = instance;
exports.delivery_lead_times_default = delivery_lead_times_default;
//# sourceMappingURL=chunk-GLL264QG.cjs.map
//# sourceMappingURL=chunk-GLL264QG.cjs.map
;