UNPKG

wallee

Version:
461 lines (444 loc) 26.1 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.CustomerCommentsService = void 0; const runtime = require("../runtime"); const index_1 = require("../models/index"); const ServiceApiUtils_1 = require("../utils/ServiceApiUtils"); /** * */ class CustomerCommentsService extends runtime.BaseAPI { constructor(configuration) { super(configuration); } /** * Delete a customer comment */ deleteCustomersCustomerIdCommentsIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling deleteCustomersCustomerIdCommentsId().'); } if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteCustomersCustomerIdCommentsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling deleteCustomersCustomerIdCommentsId().'); } const queryParameters = {}; const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'DELETE'; const path = `/customers/{customerId}/comments/{id}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).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: `/customers/{customerId}/comments/{id}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.VoidApiResponse(response); }); } /** * Delete a customer comment */ deleteCustomersCustomerIdCommentsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.deleteCustomersCustomerIdCommentsIdRaw(requestParameters, initOverrides); }); } /** * List all customer comments */ getCustomersCustomerIdCommentsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling getCustomersCustomerIdComments().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getCustomersCustomerIdComments().'); } 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 = `/customers/{customerId}/comments`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))); 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: `/customers/{customerId}/comments`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CustomerCommentListResponseFromJSON)(jsonValue)); }); } /** * List all customer comments */ getCustomersCustomerIdComments(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getCustomersCustomerIdCommentsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieve a customer comment */ getCustomersCustomerIdCommentsIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling getCustomersCustomerIdCommentsId().'); } if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getCustomersCustomerIdCommentsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getCustomersCustomerIdCommentsId().'); } 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 = `/customers/{customerId}/comments/{id}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).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: `/customers/{customerId}/comments/{id}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CustomerCommentFromJSON)(jsonValue)); }); } /** * Retrieve a customer comment */ getCustomersCustomerIdCommentsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getCustomersCustomerIdCommentsIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Search customer comments */ getCustomersCustomerIdCommentsSearchRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling getCustomersCustomerIdCommentsSearch().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling getCustomersCustomerIdCommentsSearch().'); } 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 = `/customers/{customerId}/comments/search`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))); 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: `/customers/{customerId}/comments/search`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))), method: 'GET', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CustomerCommentSearchResponseFromJSON)(jsonValue)); }); } /** * Search customer comments */ getCustomersCustomerIdCommentsSearch(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getCustomersCustomerIdCommentsSearchRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Update a customer comment */ patchCustomersCustomerIdCommentsIdRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling patchCustomersCustomerIdCommentsId().'); } if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling patchCustomersCustomerIdCommentsId().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling patchCustomersCustomerIdCommentsId().'); } if (requestParameters['customerCommentActive'] == null) { throw new runtime.RequiredError('customerCommentActive', 'Required parameter "customerCommentActive" was null or undefined when calling patchCustomersCustomerIdCommentsId().'); } 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 = `/customers/{customerId}/comments/{id}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).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: `/customers/{customerId}/comments/{id}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: (0, index_1.CustomerCommentActiveToJSON)(requestParameters['customerCommentActive']), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CustomerCommentFromJSON)(jsonValue)); }); } /** * Update a customer comment */ patchCustomersCustomerIdCommentsId(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.patchCustomersCustomerIdCommentsIdRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create a customer comment */ postCustomersCustomerIdCommentsRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling postCustomersCustomerIdComments().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postCustomersCustomerIdComments().'); } if (requestParameters['customerCommentCreate'] == null) { throw new runtime.RequiredError('customerCommentCreate', 'Required parameter "customerCommentCreate" was null or undefined when calling postCustomersCustomerIdComments().'); } 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 = `/customers/{customerId}/comments`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))); 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: `/customers/{customerId}/comments`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))), method: 'POST', headers: headerParameters, query: queryParameters, body: (0, index_1.CustomerCommentCreateToJSON)(requestParameters['customerCommentCreate']), }, updatedInitOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CustomerCommentFromJSON)(jsonValue)); }); } /** * Create a customer comment */ postCustomersCustomerIdComments(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.postCustomersCustomerIdCommentsRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Pin a comment to the top */ postCustomersCustomerIdCommentsIdPinRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling postCustomersCustomerIdCommentsIdPin().'); } if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postCustomersCustomerIdCommentsIdPin().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postCustomersCustomerIdCommentsIdPin().'); } const queryParameters = {}; const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'POST'; const path = `/customers/{customerId}/comments/{id}/pin`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).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: `/customers/{customerId}/comments/{id}/pin`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'POST', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.VoidApiResponse(response); }); } /** * Pin a comment to the top */ postCustomersCustomerIdCommentsIdPin(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postCustomersCustomerIdCommentsIdPinRaw(requestParameters, initOverrides); }); } /** * Remove a pinned comment from the top */ postCustomersCustomerIdCommentsIdUnpinRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters['customerId'] == null) { throw new runtime.RequiredError('customerId', 'Required parameter "customerId" was null or undefined when calling postCustomersCustomerIdCommentsIdUnpin().'); } if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postCustomersCustomerIdCommentsIdUnpin().'); } if (requestParameters['space'] == null) { throw new runtime.RequiredError('space', 'Required parameter "space" was null or undefined when calling postCustomersCustomerIdCommentsIdUnpin().'); } const queryParameters = {}; const headerParameters = {}; if (requestParameters['space'] != null) { headerParameters['Space'] = String(requestParameters['space']); } const method = 'POST'; const path = `/customers/{customerId}/comments/{id}/unpin`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).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: `/customers/{customerId}/comments/{id}/unpin`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))), method: 'POST', headers: headerParameters, query: queryParameters, }, updatedInitOverrides); return new runtime.VoidApiResponse(response); }); } /** * Remove a pinned comment from the top */ postCustomersCustomerIdCommentsIdUnpin(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { yield this.postCustomersCustomerIdCommentsIdUnpinRaw(requestParameters, initOverrides); }); } } exports.CustomerCommentsService = CustomerCommentsService;