UNPKG

@commercelayer/sdk

Version:
47 lines (44 loc) 1.97 kB
'use strict'; var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs'); // src/resources/carrier_accounts.ts var CarrierAccounts = class _CarrierAccounts extends chunkVRRJS3ZM_cjs.ApiResource { static TYPE = "carrier_accounts"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _CarrierAccounts.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _CarrierAccounts.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _CarrierAccounts.TYPE } : id, options); } async market(carrierAccountId, params, options) { const _carrierAccountId = carrierAccountId.id || carrierAccountId; return this.resources.fetch({ type: "markets" }, `carrier_accounts/${_carrierAccountId}/market`, params, options); } async attachments(carrierAccountId, params, options) { const _carrierAccountId = carrierAccountId.id || carrierAccountId; return this.resources.fetch({ type: "attachments" }, `carrier_accounts/${_carrierAccountId}/attachments`, params, options); } async event_stores(carrierAccountId, params, options) { const _carrierAccountId = carrierAccountId.id || carrierAccountId; return this.resources.fetch({ type: "event_stores" }, `carrier_accounts/${_carrierAccountId}/event_stores`, params, options); } isCarrierAccount(resource) { return resource.type && resource.type === _CarrierAccounts.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _CarrierAccounts.TYPE; } }; var instance = new CarrierAccounts(); var carrier_accounts_default = instance; exports.carrier_accounts_default = carrier_accounts_default; //# sourceMappingURL=chunk-KA3ARL4M.cjs.map //# sourceMappingURL=chunk-KA3ARL4M.cjs.map