UNPKG

@commercelayer/sdk

Version:
54 lines (52 loc) 2.42 kB
import { ApiResource } from './chunk-XDRKC6JM.js'; // src/resources/adyen_gateways.ts var AdyenGateways = class _AdyenGateways extends ApiResource { static TYPE = "adyen_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _AdyenGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _AdyenGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _AdyenGateways.TYPE } : id, options); } async payment_methods(adyenGatewayId, params, options) { const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId; return this.resources.fetch({ type: "payment_methods" }, `adyen_gateways/${_adyenGatewayId}/payment_methods`, params, options); } async event_stores(adyenGatewayId, params, options) { const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId; return this.resources.fetch({ type: "event_stores" }, `adyen_gateways/${_adyenGatewayId}/event_stores`, params, options); } async adyen_payments(adyenGatewayId, params, options) { const _adyenGatewayId = adyenGatewayId.id || adyenGatewayId; return this.resources.fetch({ type: "adyen_payments" }, `adyen_gateways/${_adyenGatewayId}/adyen_payments`, params, options); } async _disable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenGateways.TYPE, _disable: true }, params, options); } async _enable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenGateways.TYPE, _enable: true }, params, options); } async _check(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _AdyenGateways.TYPE, _check: true }, params, options); } isAdyenGateway(resource) { return resource.type && resource.type === _AdyenGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _AdyenGateways.TYPE; } }; var instance = new AdyenGateways(); var adyen_gateways_default = instance; export { adyen_gateways_default }; //# sourceMappingURL=chunk-KX2TRARQ.js.map //# sourceMappingURL=chunk-KX2TRARQ.js.map