UNPKG

@commercelayer/sdk

Version:
45 lines (43 loc) 1.9 kB
import { ApiResource } from './chunk-XDRKC6JM.js'; // src/resources/carrier_accounts.ts var CarrierAccounts = class _CarrierAccounts extends 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; export { carrier_accounts_default }; //# sourceMappingURL=chunk-P45FTR27.js.map //# sourceMappingURL=chunk-P45FTR27.js.map