UNPKG

@commercelayer/sdk

Version:
51 lines (48 loc) 2.41 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/shipping_weight_tiers.ts var ShippingWeightTiers = class _ShippingWeightTiers extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "shipping_weight_tiers"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _ShippingWeightTiers.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _ShippingWeightTiers.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _ShippingWeightTiers.TYPE } : id, options); } async shipping_method(shippingWeightTierId, params, options) { const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId; return this.resources.fetch({ type: "shipping_methods" }, `shipping_weight_tiers/${_shippingWeightTierId}/shipping_method`, params, options); } async attachments(shippingWeightTierId, params, options) { const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId; return this.resources.fetch({ type: "attachments" }, `shipping_weight_tiers/${_shippingWeightTierId}/attachments`, params, options); } async versions(shippingWeightTierId, params, options) { const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId; return this.resources.fetch({ type: "versions" }, `shipping_weight_tiers/${_shippingWeightTierId}/versions`, params, options); } async event_stores(shippingWeightTierId, params, options) { const _shippingWeightTierId = shippingWeightTierId.id || shippingWeightTierId; return this.resources.fetch({ type: "event_stores" }, `shipping_weight_tiers/${_shippingWeightTierId}/event_stores`, params, options); } isShippingWeightTier(resource) { return resource.type && resource.type === _ShippingWeightTiers.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _ShippingWeightTiers.TYPE; } }; var instance = new ShippingWeightTiers(); var shipping_weight_tiers_default = instance; exports.shipping_weight_tiers_default = shipping_weight_tiers_default; //# sourceMappingURL=chunk-2M54XID3.cjs.map //# sourceMappingURL=chunk-2M54XID3.cjs.map