UNPKG

@datenkraft/bb-organization-structure-api-ts-client

Version:

The organization-structure API TS Client enables you to work with the organization-structure API

451 lines (450 loc) 24.4 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Backbone Organization Structure API * - alpha: Currently developed API version. Subject to major changes. - beta: A semi-stable early access version. New features can be added. Breaking changes are possible. - stable: The API is recommended for use in production. [Changelog](https://organization-structure-api.steve.niceshops.com/v2/docs/changelog.html) All data is transferred in UTF-8 encoding.\\ The API uses stateless HTTP. No cookies have to be kept.\\ Authentication via OAuth2 client credentials flow. [Privacy Policy](https://www.niceshops.com/en/dienstleistungen/data-privacy-policy) [Backbone Organization Structure API PHP client @Packagist](https://packagist.org/packages/datenkraft/bb-organization-structure-api-php-client) * * The version of the OpenAPI document: v2.beta * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ 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()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomerApi = exports.CustomerApiFactory = exports.CustomerApiFp = exports.CustomerApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // URLSearchParams not necessarily used // @ts-ignore const url_1 = require("url"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * CustomerApi - axios parameter creator * @export */ const CustomerApiAxiosParamCreator = function (configuration) { return { /** * Delete a Customer * @summary Delete a Customer * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCustomer: (customerId, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'customerId' is not null or undefined (0, common_1.assertParamExists)('deleteCustomer', 'customerId', customerId); const localVarPath = `/customer/{customerId}` .replace(`{${"customerId"}}`, encodeURIComponent(String(customerId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a Customer by customerId * @summary Get a Customer by customerId * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomer: (customerId, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'customerId' is not null or undefined (0, common_1.assertParamExists)('getCustomer', 'customerId', customerId); const localVarPath = `/customer/{customerId}` .replace(`{${"customerId"}}`, encodeURIComponent(String(customerId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a list of customers * @summary Get a list of customers * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterOrganizationId] Organization Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomerCollection: (page, pageSize, paginationMode, filterOrganizationId, options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/customer`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (paginationMode !== undefined) { localVarQueryParameter['paginationMode'] = paginationMode; } if (filterOrganizationId !== undefined) { localVarQueryParameter['filter[organizationId]'] = filterOrganizationId; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Update one or more fields of a Customer * @summary Update a Customer * @param {string} customerId Customer Id * @param {PatchCustomer} patchCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchCustomer: (customerId, patchCustomer, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'customerId' is not null or undefined (0, common_1.assertParamExists)('patchCustomer', 'customerId', customerId); // verify required parameter 'patchCustomer' is not null or undefined (0, common_1.assertParamExists)('patchCustomer', 'patchCustomer', patchCustomer); const localVarPath = `/customer/{customerId}` .replace(`{${"customerId"}}`, encodeURIComponent(String(customerId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(patchCustomer, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Add a new Customer * @summary Add a new Customer * @param {NewCustomer} newCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} */ postCustomer: (newCustomer, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'newCustomer' is not null or undefined (0, common_1.assertParamExists)('postCustomer', 'newCustomer', newCustomer); const localVarPath = `/customer`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(newCustomer, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.CustomerApiAxiosParamCreator = CustomerApiAxiosParamCreator; /** * CustomerApi - functional programming interface * @export */ const CustomerApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.CustomerApiAxiosParamCreator)(configuration); return { /** * Delete a Customer * @summary Delete a Customer * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCustomer(customerId, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteCustomer(customerId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a Customer by customerId * @summary Get a Customer by customerId * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomer(customerId, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getCustomer(customerId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a list of customers * @summary Get a list of customers * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterOrganizationId] Organization Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomerCollection(page, pageSize, paginationMode, filterOrganizationId, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getCustomerCollection(page, pageSize, paginationMode, filterOrganizationId, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Update one or more fields of a Customer * @summary Update a Customer * @param {string} customerId Customer Id * @param {PatchCustomer} patchCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchCustomer(customerId, patchCustomer, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.patchCustomer(customerId, patchCustomer, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Add a new Customer * @summary Add a new Customer * @param {NewCustomer} newCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} */ postCustomer(newCustomer, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.postCustomer(newCustomer, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, }; }; exports.CustomerApiFp = CustomerApiFp; /** * CustomerApi - factory interface * @export */ const CustomerApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.CustomerApiFp)(configuration); return { /** * Delete a Customer * @summary Delete a Customer * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCustomer(customerId, options) { return localVarFp.deleteCustomer(customerId, options).then((request) => request(axios, basePath)); }, /** * Get a Customer by customerId * @summary Get a Customer by customerId * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomer(customerId, options) { return localVarFp.getCustomer(customerId, options).then((request) => request(axios, basePath)); }, /** * Get a list of customers * @summary Get a list of customers * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterOrganizationId] Organization Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCustomerCollection(page, pageSize, paginationMode, filterOrganizationId, options) { return localVarFp.getCustomerCollection(page, pageSize, paginationMode, filterOrganizationId, options).then((request) => request(axios, basePath)); }, /** * Update one or more fields of a Customer * @summary Update a Customer * @param {string} customerId Customer Id * @param {PatchCustomer} patchCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchCustomer(customerId, patchCustomer, options) { return localVarFp.patchCustomer(customerId, patchCustomer, options).then((request) => request(axios, basePath)); }, /** * Add a new Customer * @summary Add a new Customer * @param {NewCustomer} newCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} */ postCustomer(newCustomer, options) { return localVarFp.postCustomer(newCustomer, options).then((request) => request(axios, basePath)); }, }; }; exports.CustomerApiFactory = CustomerApiFactory; /** * CustomerApi - object-oriented interface * @export * @class CustomerApi * @extends {BaseAPI} */ class CustomerApi extends base_1.BaseAPI { /** * Delete a Customer * @summary Delete a Customer * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CustomerApi */ deleteCustomer(customerId, options) { return (0, exports.CustomerApiFp)(this.configuration).deleteCustomer(customerId, options).then((request) => request(this.axios, this.basePath)); } /** * Get a Customer by customerId * @summary Get a Customer by customerId * @param {string} customerId Customer Id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CustomerApi */ getCustomer(customerId, options) { return (0, exports.CustomerApiFp)(this.configuration).getCustomer(customerId, options).then((request) => request(this.axios, this.basePath)); } /** * Get a list of customers * @summary Get a list of customers * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [filterOrganizationId] Organization Id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CustomerApi */ getCustomerCollection(page, pageSize, paginationMode, filterOrganizationId, options) { return (0, exports.CustomerApiFp)(this.configuration).getCustomerCollection(page, pageSize, paginationMode, filterOrganizationId, options).then((request) => request(this.axios, this.basePath)); } /** * Update one or more fields of a Customer * @summary Update a Customer * @param {string} customerId Customer Id * @param {PatchCustomer} patchCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CustomerApi */ patchCustomer(customerId, patchCustomer, options) { return (0, exports.CustomerApiFp)(this.configuration).patchCustomer(customerId, patchCustomer, options).then((request) => request(this.axios, this.basePath)); } /** * Add a new Customer * @summary Add a new Customer * @param {NewCustomer} newCustomer * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CustomerApi */ postCustomer(newCustomer, options) { return (0, exports.CustomerApiFp)(this.configuration).postCustomer(newCustomer, options).then((request) => request(this.axios, this.basePath)); } } exports.CustomerApi = CustomerApi;