UNPKG

@commercelayer/sdk

Version:
49 lines (47 loc) 2.37 kB
import { ApiResource } from './chunk-XKERR6OR.js'; // src/resources/checkout_com_gateways.ts var CheckoutComGateways = class _CheckoutComGateways extends ApiResource { static TYPE = "checkout_com_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _CheckoutComGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _CheckoutComGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _CheckoutComGateways.TYPE } : id, options); } async payment_methods(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "payment_methods" }, `checkout_com_gateways/${_checkoutComGatewayId}/payment_methods`, params, options); } async versions(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "versions" }, `checkout_com_gateways/${_checkoutComGatewayId}/versions`, params, options); } async event_stores(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "event_stores" }, `checkout_com_gateways/${_checkoutComGatewayId}/event_stores`, params, options); } async checkout_com_payments(checkoutComGatewayId, params, options) { const _checkoutComGatewayId = checkoutComGatewayId.id || checkoutComGatewayId; return this.resources.fetch({ type: "checkout_com_payments" }, `checkout_com_gateways/${_checkoutComGatewayId}/checkout_com_payments`, params, options); } isCheckoutComGateway(resource) { return resource.type && resource.type === _CheckoutComGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _CheckoutComGateways.TYPE; } }; var instance = new CheckoutComGateways(); var checkout_com_gateways_default = instance; export { checkout_com_gateways_default }; //# sourceMappingURL=chunk-HH3NIT7B.js.map //# sourceMappingURL=chunk-HH3NIT7B.js.map