UNPKG

@commercelayer/sdk

Version:
51 lines (49 loc) 2.28 kB
import { ApiResource } from './chunk-XDRKC6JM.js'; // src/resources/axerve_gateways.ts var AxerveGateways = class _AxerveGateways extends ApiResource { static TYPE = "axerve_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _AxerveGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _AxerveGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _AxerveGateways.TYPE } : id, options); } async payment_methods(axerveGatewayId, params, options) { const _axerveGatewayId = axerveGatewayId.id || axerveGatewayId; return this.resources.fetch({ type: "payment_methods" }, `axerve_gateways/${_axerveGatewayId}/payment_methods`, params, options); } async event_stores(axerveGatewayId, params, options) { const _axerveGatewayId = axerveGatewayId.id || axerveGatewayId; return this.resources.fetch({ type: "event_stores" }, `axerve_gateways/${_axerveGatewayId}/event_stores`, params, options); } async axerve_payments(axerveGatewayId, params, options) { const _axerveGatewayId = axerveGatewayId.id || axerveGatewayId; return this.resources.fetch({ type: "axerve_payments" }, `axerve_gateways/${_axerveGatewayId}/axerve_payments`, params, options); } async _disable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AxerveGateways.TYPE, _disable: true }, params, options); } async _enable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AxerveGateways.TYPE, _enable: true }, params, options); } isAxerveGateway(resource) { return resource.type && resource.type === _AxerveGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _AxerveGateways.TYPE; } }; var instance = new AxerveGateways(); var axerve_gateways_default = instance; export { axerve_gateways_default }; //# sourceMappingURL=chunk-QSSLQRDU.js.map //# sourceMappingURL=chunk-QSSLQRDU.js.map