UNPKG

@commercelayer/sdk

Version:
51 lines (48 loc) 2.22 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/klarna_gateways.ts var KlarnaGateways = class _KlarnaGateways extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "klarna_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _KlarnaGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _KlarnaGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _KlarnaGateways.TYPE } : id, options); } async payment_methods(klarnaGatewayId, params, options) { const _klarnaGatewayId = klarnaGatewayId.id || klarnaGatewayId; return this.resources.fetch({ type: "payment_methods" }, `klarna_gateways/${_klarnaGatewayId}/payment_methods`, params, options); } async versions(klarnaGatewayId, params, options) { const _klarnaGatewayId = klarnaGatewayId.id || klarnaGatewayId; return this.resources.fetch({ type: "versions" }, `klarna_gateways/${_klarnaGatewayId}/versions`, params, options); } async event_stores(klarnaGatewayId, params, options) { const _klarnaGatewayId = klarnaGatewayId.id || klarnaGatewayId; return this.resources.fetch({ type: "event_stores" }, `klarna_gateways/${_klarnaGatewayId}/event_stores`, params, options); } async klarna_payments(klarnaGatewayId, params, options) { const _klarnaGatewayId = klarnaGatewayId.id || klarnaGatewayId; return this.resources.fetch({ type: "klarna_payments" }, `klarna_gateways/${_klarnaGatewayId}/klarna_payments`, params, options); } isKlarnaGateway(resource) { return resource.type && resource.type === _KlarnaGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _KlarnaGateways.TYPE; } }; var instance = new KlarnaGateways(); var klarna_gateways_default = instance; exports.klarna_gateways_default = klarna_gateways_default; //# sourceMappingURL=chunk-A76SFMAB.cjs.map //# sourceMappingURL=chunk-A76SFMAB.cjs.map