UNPKG

wallee

Version:
489 lines (470 loc) 24.4 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.WebhookURLsService = void 0; const runtime = require("../runtime"); const index_1 = require("../models/index"); const ServiceApiUtils_1 = require("../utils/ServiceApiUtils"); /** * */ class WebhookURLsService extends runtime.BaseAPI { constructor(configuration) { super(configuration); } /** * Delete multiple webhook URLs */ deleteWebhooksUrlsBulkRaw(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 deleteWebhooksUrlsBulk().'); } if (requestParameters['requestBody'] == null) { throw new runtime.RequiredError('requestBody', 'Required parameter "requestBody" was null or undefined when calling deleteWebhooksUrlsBulk().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'DELETE'; const path = `/webhooks/urls/bulk`; 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: `/webhooks/urls/bulk`, method: 'DELETE', headers: headerParameters, query: queryParameters, body: requestParameters['requestBody'], }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.RestApiBulkOperationResultFromJSON)); }); } /** * Delete multiple webhook URLs */ deleteWebhooksUrlsBulk(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.deleteWebhooksUrlsBulkRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Delete a webhook URL */ deleteWebhooksUrlsIdRaw(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 deleteWebhooksUrlsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling deleteWebhooksUrlsId().'); } const queryParameters = {}; const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'DELETE'; const path = `/webhooks/urls/{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: `/webhooks/urls/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.VoidApiResponse(response); }); } /** * Delete a webhook URL */ deleteWebhooksUrlsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteWebhooksUrlsIdRaw(requestParameters, initOverrides); }); } /** * List all webhook URLs */ getWebhooksUrlsRaw(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 getWebhooksUrls().'); } 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 = `/webhooks/urls`; 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: `/webhooks/urls`, method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookURLListResponseFromJSON)(jsonValue)); }); } /** * List all webhook URLs */ getWebhooksUrls(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getWebhooksUrlsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieve a webhook URL */ getWebhooksUrlsIdRaw(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 getWebhooksUrlsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getWebhooksUrlsId().'); } 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 = `/webhooks/urls/{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: `/webhooks/urls/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookUrlFromJSON)(jsonValue)); }); } /** * Retrieve a webhook URL */ getWebhooksUrlsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getWebhooksUrlsIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Search webhook URLs */ getWebhooksUrlsSearchRaw(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 getWebhooksUrlsSearch().'); } 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 = `/webhooks/urls/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: `/webhooks/urls/search`, method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookURLSearchResponseFromJSON)(jsonValue)); }); } /** * Search webhook URLs */ getWebhooksUrlsSearch(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getWebhooksUrlsSearchRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Update multiple webhook URLs */ patchWebhooksUrlsBulkRaw(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 patchWebhooksUrlsBulk().'); } if (requestParameters['webhookUrlUpdate'] == null) { throw new runtime.RequiredError('webhookUrlUpdate', 'Required parameter "webhookUrlUpdate" was null or undefined when calling patchWebhooksUrlsBulk().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'PATCH'; const path = `/webhooks/urls/bulk`; 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: `/webhooks/urls/bulk`, method: 'PATCH', headers: headerParameters, query: queryParameters, body: requestParameters['webhookUrlUpdate'].map(index_1.WebhookUrlUpdateToJSON), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.RestApiBulkOperationResultFromJSON)); }); } /** * Update multiple webhook URLs */ patchWebhooksUrlsBulk(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.patchWebhooksUrlsBulkRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Update a webhook URL */ patchWebhooksUrlsIdRaw(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 patchWebhooksUrlsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchWebhooksUrlsId().'); } if (requestParameters['webhookUrlUpdate'] == null) { throw new runtime.RequiredError('webhookUrlUpdate', 'Required parameter "webhookUrlUpdate" was null or undefined when calling patchWebhooksUrlsId().'); } 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 = `/webhooks/urls/{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: `/webhooks/urls/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: (0, index_1.WebhookUrlUpdateToJSON)(requestParameters['webhookUrlUpdate']), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookUrlFromJSON)(jsonValue)); }); } /** * Update a webhook URL */ patchWebhooksUrlsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.patchWebhooksUrlsIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create a webhook URL */ postWebhooksUrlsRaw(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 postWebhooksUrls().'); } if (requestParameters['webhookUrlCreate'] == null) { throw new runtime.RequiredError('webhookUrlCreate', 'Required parameter "webhookUrlCreate" was null or undefined when calling postWebhooksUrls().'); } 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 = `/webhooks/urls`; 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: `/webhooks/urls`, method: 'POST', headers: headerParameters, query: queryParameters, body: (0, index_1.WebhookUrlCreateToJSON)(requestParameters['webhookUrlCreate']), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookUrlFromJSON)(jsonValue)); }); } /** * Create a webhook URL */ postWebhooksUrls(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postWebhooksUrlsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create multiple webhook URLs */ postWebhooksUrlsBulkRaw(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 postWebhooksUrlsBulk().'); } if (requestParameters['webhookUrlCreate'] == null) { throw new runtime.RequiredError('webhookUrlCreate', 'Required parameter "webhookUrlCreate" was null or undefined when calling postWebhooksUrlsBulk().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'POST'; const path = `/webhooks/urls/bulk`; 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: `/webhooks/urls/bulk`, method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters['webhookUrlCreate'].map(index_1.WebhookUrlCreateToJSON), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.RestApiBulkOperationResultFromJSON)); }); } /** * Create multiple webhook URLs */ postWebhooksUrlsBulk(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postWebhooksUrlsBulkRaw(requestParameters, initOverrides); return yield response.value(); }); } } exports.WebhookURLsService = WebhookURLsService;