/* tslint:disable */ /* eslint-disable */ /** * openfilz-api * API for Document Management System * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { AiPreferencesView } from '../models'; // @ts-ignore import type { SaveAiPreferencesRequest } from '../models'; // @ts-ignore import type { Settings } from '../models'; /** * SettingsApi - axios parameter creator */ export const SettingsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary The caller\'s smart-filing preferences * @param {*} [options] Override http request option. * @throws {RequiredError} */ get1: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/settings/ai/preferences`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve user\'s settings : global settings and user\'s preferences. The category labels (aiInsightsCategoryLabels) are in the Accept-Language language, English when it is not supported. * @summary Get user\'s settings * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSettings1: async (acceptLanguage?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/v1/settings`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Accept'] = '*/*'; if (acceptLanguage != null) { localVarHeaderParameter['Accept-Language'] = String(acceptLanguage); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * A null field leaves the current value unchanged. inbox=true creates the caller\'s Inbox folder at their root on demand (named from Accept-Language, else the deployment\'s default language); inbox=false forgets it without deleting the folder. 400 when the Inbox is not offered. * @summary Save the caller\'s smart-filing preferences * @param {SaveAiPreferencesRequest} saveAiPreferencesRequest * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ save: async (saveAiPreferencesRequest: SaveAiPreferencesRequest, acceptLanguage?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'saveAiPreferencesRequest' is not null or undefined assertParamExists('save', 'saveAiPreferencesRequest', saveAiPreferencesRequest) const localVarPath = `/api/v1/settings/ai/preferences`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; if (acceptLanguage != null) { localVarHeaderParameter['Accept-Language'] = String(acceptLanguage); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(saveAiPreferencesRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * SettingsApi - functional programming interface */ export const SettingsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = SettingsApiAxiosParamCreator(configuration) return { /** * * @summary The caller\'s smart-filing preferences * @param {*} [options] Override http request option. * @throws {RequiredError} */ async get1(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.get1(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SettingsApi.get1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieve user\'s settings : global settings and user\'s preferences. The category labels (aiInsightsCategoryLabels) are in the Accept-Language language, English when it is not supported. * @summary Get user\'s settings * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSettings1(acceptLanguage?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSettings1(acceptLanguage, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SettingsApi.getSettings1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * A null field leaves the current value unchanged. inbox=true creates the caller\'s Inbox folder at their root on demand (named from Accept-Language, else the deployment\'s default language); inbox=false forgets it without deleting the folder. 400 when the Inbox is not offered. * @summary Save the caller\'s smart-filing preferences * @param {SaveAiPreferencesRequest} saveAiPreferencesRequest * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async save(saveAiPreferencesRequest: SaveAiPreferencesRequest, acceptLanguage?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.save(saveAiPreferencesRequest, acceptLanguage, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SettingsApi.save']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * SettingsApi - factory interface */ export const SettingsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = SettingsApiFp(configuration) return { /** * * @summary The caller\'s smart-filing preferences * @param {*} [options] Override http request option. * @throws {RequiredError} */ get1(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.get1(options).then((request) => request(axios, basePath)); }, /** * Retrieve user\'s settings : global settings and user\'s preferences. The category labels (aiInsightsCategoryLabels) are in the Accept-Language language, English when it is not supported. * @summary Get user\'s settings * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSettings1(acceptLanguage?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSettings1(acceptLanguage, options).then((request) => request(axios, basePath)); }, /** * A null field leaves the current value unchanged. inbox=true creates the caller\'s Inbox folder at their root on demand (named from Accept-Language, else the deployment\'s default language); inbox=false forgets it without deleting the folder. 400 when the Inbox is not offered. * @summary Save the caller\'s smart-filing preferences * @param {SaveAiPreferencesRequest} saveAiPreferencesRequest * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ save(saveAiPreferencesRequest: SaveAiPreferencesRequest, acceptLanguage?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.save(saveAiPreferencesRequest, acceptLanguage, options).then((request) => request(axios, basePath)); }, }; }; /** * SettingsApi - object-oriented interface */ export class SettingsApi extends BaseAPI { /** * * @summary The caller\'s smart-filing preferences * @param {*} [options] Override http request option. * @throws {RequiredError} */ public get1(options?: RawAxiosRequestConfig) { return SettingsApiFp(this.configuration).get1(options).then((request) => request(this.axios, this.basePath)); } /** * Retrieve user\'s settings : global settings and user\'s preferences. The category labels (aiInsightsCategoryLabels) are in the Accept-Language language, English when it is not supported. * @summary Get user\'s settings * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getSettings1(acceptLanguage?: string, options?: RawAxiosRequestConfig) { return SettingsApiFp(this.configuration).getSettings1(acceptLanguage, options).then((request) => request(this.axios, this.basePath)); } /** * A null field leaves the current value unchanged. inbox=true creates the caller\'s Inbox folder at their root on demand (named from Accept-Language, else the deployment\'s default language); inbox=false forgets it without deleting the folder. 400 when the Inbox is not offered. * @summary Save the caller\'s smart-filing preferences * @param {SaveAiPreferencesRequest} saveAiPreferencesRequest * @param {string} [acceptLanguage] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public save(saveAiPreferencesRequest: SaveAiPreferencesRequest, acceptLanguage?: string, options?: RawAxiosRequestConfig) { return SettingsApiFp(this.configuration).save(saveAiPreferencesRequest, acceptLanguage, options).then((request) => request(this.axios, this.basePath)); } }