/* tslint:disable */ /* eslint-disable */ /** * EMIL Tenant Service * The EMIL TenantService API description * * The version of the OpenAPI document: 1.0 * Contact: kontakt@emil.de * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { GetOrganizationResponseClass } from '../models'; // @ts-ignore import { ListOrganizationsResponseClass } from '../models'; // @ts-ignore import { UpdateOrganizationRequestDtoRest } from '../models'; // @ts-ignore import { UpdateOrganizationResponseClass } from '../models'; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; const FormData = require('form-data'); /** * OrganizationsApi - axios parameter creator * @export */ export const OrganizationsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get Organization by code **Required Permissions** \"tenant-management.organizations.view\" * @summary Retrieve the Organization * @param {string} code * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrganization: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('getOrganization', 'code', code) const localVarPath = `/tenantservice/v1/organizations/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This will fetch list of organizations **Required Permissions** \"tenant-management.organizations.view\" * @summary List organizations * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result. * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listOrganizations: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/tenantservice/v1/organizations`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageToken !== undefined) { localVarQueryParameter['pageToken'] = pageToken; } if (filter !== undefined) { localVarQueryParameter['filter'] = filter; } if (search !== undefined) { localVarQueryParameter['search'] = search; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (expand !== undefined) { localVarQueryParameter['expand'] = expand; } if (filters !== undefined) { localVarQueryParameter['filters'] = filters; } if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update organization data **Required Permissions** \"tenant-management.organizations.update\" * @summary Update the Organization * @param {string} code * @param {UpdateOrganizationRequestDtoRest} updateOrganizationRequestDtoRest * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrganization: async (code: string, updateOrganizationRequestDtoRest: UpdateOrganizationRequestDtoRest, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('updateOrganization', 'code', code) // verify required parameter 'updateOrganizationRequestDtoRest' is not null or undefined assertParamExists('updateOrganization', 'updateOrganizationRequestDtoRest', updateOrganizationRequestDtoRest) const localVarPath = `/tenantservice/v1/organizations/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateOrganizationRequestDtoRest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * OrganizationsApi - functional programming interface * @export */ export const OrganizationsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = OrganizationsApiAxiosParamCreator(configuration) return { /** * Get Organization by code **Required Permissions** \"tenant-management.organizations.view\" * @summary Retrieve the Organization * @param {string} code * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getOrganization(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getOrganization(code, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This will fetch list of organizations **Required Permissions** \"tenant-management.organizations.view\" * @summary List organizations * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result. * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listOrganizations(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listOrganizations(authorization, pageSize, pageToken, filter, search, order, expand, filters, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Update organization data **Required Permissions** \"tenant-management.organizations.update\" * @summary Update the Organization * @param {string} code * @param {UpdateOrganizationRequestDtoRest} updateOrganizationRequestDtoRest * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateOrganization(code: string, updateOrganizationRequestDtoRest: UpdateOrganizationRequestDtoRest, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganization(code, updateOrganizationRequestDtoRest, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * OrganizationsApi - factory interface * @export */ export const OrganizationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = OrganizationsApiFp(configuration) return { /** * Get Organization by code **Required Permissions** \"tenant-management.organizations.view\" * @summary Retrieve the Organization * @param {string} code * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrganization(code: string, authorization?: string, options?: any): AxiosPromise { return localVarFp.getOrganization(code, authorization, options).then((request) => request(axios, basePath)); }, /** * This will fetch list of organizations **Required Permissions** \"tenant-management.organizations.view\" * @summary List organizations * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result. * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listOrganizations(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise { return localVarFp.listOrganizations(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath)); }, /** * Update organization data **Required Permissions** \"tenant-management.organizations.update\" * @summary Update the Organization * @param {string} code * @param {UpdateOrganizationRequestDtoRest} updateOrganizationRequestDtoRest * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrganization(code: string, updateOrganizationRequestDtoRest: UpdateOrganizationRequestDtoRest, authorization?: string, options?: any): AxiosPromise { return localVarFp.updateOrganization(code, updateOrganizationRequestDtoRest, authorization, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getOrganization operation in OrganizationsApi. * @export * @interface OrganizationsApiGetOrganizationRequest */ export interface OrganizationsApiGetOrganizationRequest { /** * * @type {string} * @memberof OrganizationsApiGetOrganization */ readonly code: string /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof OrganizationsApiGetOrganization */ readonly authorization?: string } /** * Request parameters for listOrganizations operation in OrganizationsApi. * @export * @interface OrganizationsApiListOrganizationsRequest */ export interface OrganizationsApiListOrganizationsRequest { /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly authorization?: string /** * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @type {number} * @memberof OrganizationsApiListOrganizations */ readonly pageSize?: number /** * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly pageToken?: string /** * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly filter?: string /** * To search the list by any field, pass search=xxx to fetch the result. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly search?: string /** * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly order?: string /** * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly expand?: string /** * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @type {string} * @memberof OrganizationsApiListOrganizations */ readonly filters?: string } /** * Request parameters for updateOrganization operation in OrganizationsApi. * @export * @interface OrganizationsApiUpdateOrganizationRequest */ export interface OrganizationsApiUpdateOrganizationRequest { /** * * @type {string} * @memberof OrganizationsApiUpdateOrganization */ readonly code: string /** * * @type {UpdateOrganizationRequestDtoRest} * @memberof OrganizationsApiUpdateOrganization */ readonly updateOrganizationRequestDtoRest: UpdateOrganizationRequestDtoRest /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof OrganizationsApiUpdateOrganization */ readonly authorization?: string } /** * OrganizationsApi - object-oriented interface * @export * @class OrganizationsApi * @extends {BaseAPI} */ export class OrganizationsApi extends BaseAPI { /** * Get Organization by code **Required Permissions** \"tenant-management.organizations.view\" * @summary Retrieve the Organization * @param {OrganizationsApiGetOrganizationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OrganizationsApi */ public getOrganization(requestParameters: OrganizationsApiGetOrganizationRequest, options?: AxiosRequestConfig) { return OrganizationsApiFp(this.configuration).getOrganization(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * This will fetch list of organizations **Required Permissions** \"tenant-management.organizations.view\" * @summary List organizations * @param {OrganizationsApiListOrganizationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OrganizationsApi */ public listOrganizations(requestParameters: OrganizationsApiListOrganizationsRequest = {}, options?: AxiosRequestConfig) { return OrganizationsApiFp(this.configuration).listOrganizations(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath)); } /** * Update organization data **Required Permissions** \"tenant-management.organizations.update\" * @summary Update the Organization * @param {OrganizationsApiUpdateOrganizationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OrganizationsApi */ public updateOrganization(requestParameters: OrganizationsApiUpdateOrganizationRequest, options?: AxiosRequestConfig) { return OrganizationsApiFp(this.configuration).updateOrganization(requestParameters.code, requestParameters.updateOrganizationRequestDtoRest, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } }