UNPKG

@commercelayer/sdk

Version:
47 lines (44 loc) 1.95 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/manual_gateways.ts var ManualGateways = class _ManualGateways extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "manual_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _ManualGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _ManualGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _ManualGateways.TYPE } : id, options); } async payment_methods(manualGatewayId, params, options) { const _manualGatewayId = manualGatewayId.id || manualGatewayId; return this.resources.fetch({ type: "payment_methods" }, `manual_gateways/${_manualGatewayId}/payment_methods`, params, options); } async versions(manualGatewayId, params, options) { const _manualGatewayId = manualGatewayId.id || manualGatewayId; return this.resources.fetch({ type: "versions" }, `manual_gateways/${_manualGatewayId}/versions`, params, options); } async event_stores(manualGatewayId, params, options) { const _manualGatewayId = manualGatewayId.id || manualGatewayId; return this.resources.fetch({ type: "event_stores" }, `manual_gateways/${_manualGatewayId}/event_stores`, params, options); } isManualGateway(resource) { return resource.type && resource.type === _ManualGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _ManualGateways.TYPE; } }; var instance = new ManualGateways(); var manual_gateways_default = instance; exports.manual_gateways_default = manual_gateways_default; //# sourceMappingURL=chunk-6ZUGJHNV.cjs.map //# sourceMappingURL=chunk-6ZUGJHNV.cjs.map