UNPKG

wallee

Version:
353 lines (340 loc) 18.8 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Wallee AG TypeScript SDK * * This library allows to interact with the Wallee AG payment service. * * Copyright owner: Wallee AG * Website: https://en.wallee.com * Developer email: ecosystem-team@wallee.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PaymentConnectorConfigurationsService = void 0; const runtime = require("../runtime"); const index_1 = require("../models/index"); const ServiceApiUtils_1 = require("../utils/ServiceApiUtils"); /** * */ class PaymentConnectorConfigurationsService extends runtime.BaseAPI { constructor(configuration) { super(configuration); } /** * Permanently deletes a payment connector configuration. It cannot be undone. * Delete a payment connector configuration */ deletePaymentConnectorConfigurationsIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deletePaymentConnectorConfigurationsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling deletePaymentConnectorConfigurationsId().'); } const queryParameters = {}; const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'DELETE'; const path = `/payment/connector-configurations/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); if (this.configuration.httpBearerAuth) { yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters); } // Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value const requestTimeoutInSeconds = this.configuration.requestTimeout; const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds); const response = yield this.request({ path: `/payment/connector-configurations/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.VoidApiResponse(response); }); } /** * Permanently deletes a payment connector configuration. It cannot be undone. * Delete a payment connector configuration */ deletePaymentConnectorConfigurationsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deletePaymentConnectorConfigurationsIdRaw(requestParameters, initOverrides); }); } /** * List all payment connector configurations */ getPaymentConnectorConfigurationsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getPaymentConnectorConfigurations().'); } const queryParameters = {}; if (requestParameters['after'] != null) { queryParameters['after'] = requestParameters['after']; } if (requestParameters['before'] != null) { queryParameters['before'] = requestParameters['before']; } if (requestParameters['expand'] != null) { queryParameters['expand'] = requestParameters['expand']; } if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['order'] != null) { queryParameters['order'] = requestParameters['order']; } const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'GET'; const path = `/payment/connector-configurations`; if (this.configuration.httpBearerAuth) { yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters); } // Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value const requestTimeoutInSeconds = this.configuration.requestTimeout; const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds); const response = yield this.request({ path: `/payment/connector-configurations`, method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentConnectorConfigurationListResponseFromJSON)(jsonValue)); }); } /** * List all payment connector configurations */ getPaymentConnectorConfigurations(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getPaymentConnectorConfigurationsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieve a payment connector configuration */ getPaymentConnectorConfigurationsIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getPaymentConnectorConfigurationsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getPaymentConnectorConfigurationsId().'); } const queryParameters = {}; if (requestParameters['expand'] != null) { queryParameters['expand'] = requestParameters['expand']; } const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'GET'; const path = `/payment/connector-configurations/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); if (this.configuration.httpBearerAuth) { yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters); } // Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value const requestTimeoutInSeconds = this.configuration.requestTimeout; const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds); const response = yield this.request({ path: `/payment/connector-configurations/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentConnectorConfigurationFromJSON)(jsonValue)); }); } /** * Retrieve a payment connector configuration */ getPaymentConnectorConfigurationsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getPaymentConnectorConfigurationsIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Search payment connector configurations */ getPaymentConnectorConfigurationsSearchRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getPaymentConnectorConfigurationsSearch().'); } const queryParameters = {}; if (requestParameters['expand'] != null) { queryParameters['expand'] = requestParameters['expand']; } if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['order'] != null) { queryParameters['order'] = requestParameters['order']; } if (requestParameters['query'] != null) { queryParameters['query'] = requestParameters['query']; } const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'GET'; const path = `/payment/connector-configurations/search`; if (this.configuration.httpBearerAuth) { yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters); } // Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value const requestTimeoutInSeconds = this.configuration.requestTimeout; const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds); const response = yield this.request({ path: `/payment/connector-configurations/search`, method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentConnectorConfigurationSearchResponseFromJSON)(jsonValue)); }); } /** * Search payment connector configurations */ getPaymentConnectorConfigurationsSearch(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getPaymentConnectorConfigurationsSearchRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Update a payment connector configuration */ patchPaymentConnectorConfigurationsIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling patchPaymentConnectorConfigurationsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchPaymentConnectorConfigurationsId().'); } if (requestParameters['paymentConnectorConfigurationUpdate'] == null) { throw new runtime.RequiredError('paymentConnectorConfigurationUpdate', 'Required parameter "paymentConnectorConfigurationUpdate" was null or undefined when calling patchPaymentConnectorConfigurationsId().'); } const queryParameters = {}; if (requestParameters['expand'] != null) { queryParameters['expand'] = requestParameters['expand']; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'PATCH'; const path = `/payment/connector-configurations/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); if (this.configuration.httpBearerAuth) { yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters); } // Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value const requestTimeoutInSeconds = this.configuration.requestTimeout; const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds); const response = yield this.request({ path: `/payment/connector-configurations/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: (0, index_1.PaymentConnectorConfigurationUpdateToJSON)(requestParameters['paymentConnectorConfigurationUpdate']), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentConnectorConfigurationFromJSON)(jsonValue)); }); } /** * Update a payment connector configuration */ patchPaymentConnectorConfigurationsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.patchPaymentConnectorConfigurationsIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create a payment connector configuration */ postPaymentConnectorConfigurationsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postPaymentConnectorConfigurations().'); } if (requestParameters['paymentConnectorConfigurationCreate'] == null) { throw new runtime.RequiredError('paymentConnectorConfigurationCreate', 'Required parameter "paymentConnectorConfigurationCreate" was null or undefined when calling postPaymentConnectorConfigurations().'); } const queryParameters = {}; if (requestParameters['expand'] != null) { queryParameters['expand'] = requestParameters['expand']; } const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'POST'; const path = `/payment/connector-configurations`; if (this.configuration.httpBearerAuth) { yield this.configuration.httpBearerAuth.applyToRequest(path, method, queryParameters, headerParameters); } // Set per-request timeout in initOverrides: use the incoming parameter or fall back to the Configuration value const requestTimeoutInSeconds = this.configuration.requestTimeout; const updatedInitOverrides = yield ServiceApiUtils_1.ServiceApiUtils.adjustRequestSignalAsync(initOverrides, requestTimeoutInSeconds); const response = yield this.request({ path: `/payment/connector-configurations`, method: 'POST', headers: headerParameters, query: queryParameters, body: (0, index_1.PaymentConnectorConfigurationCreateToJSON)(requestParameters['paymentConnectorConfigurationCreate']), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaymentConnectorConfigurationFromJSON)(jsonValue)); }); } /** * Create a payment connector configuration */ postPaymentConnectorConfigurations(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postPaymentConnectorConfigurationsRaw(requestParameters, initOverrides); return yield response.value(); }); } } exports.PaymentConnectorConfigurationsService = PaymentConnectorConfigurationsService;