/* tslint:disable */ /* eslint-disable */ /** * Identity Security Cloud API - Tenant Context * Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. * * The version of the OpenAPI document: v1 * * * 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 } from './common'; import type { RequestArgs } from './base'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; /** * * @export * @interface ArrayInner */ export interface ArrayInner { } /** * * @export * @interface ErrorMessageDto */ export interface ErrorMessageDto { /** * The locale for the message text, a BCP 47 language tag. * @type {string} * @memberof ErrorMessageDto */ 'locale'?: string | null; /** * * @type {LocaleOrigin} * @memberof ErrorMessageDto */ 'localeOrigin'?: LocaleOrigin | null; /** * Actual text of the error message in the indicated locale. * @type {string} * @memberof ErrorMessageDto */ 'text'?: string; } /** * * @export * @interface ErrorResponseDto */ export interface ErrorResponseDto { /** * Fine-grained error code providing more detail of the error. * @type {string} * @memberof ErrorResponseDto */ 'detailCode'?: string; /** * Unique tracking id for the error. * @type {string} * @memberof ErrorResponseDto */ 'trackingId'?: string; /** * Generic localized reason for error * @type {Array} * @memberof ErrorResponseDto */ 'messages'?: Array; /** * Plain-text descriptive reasons to provide additional detail to the text provided in the messages field * @type {Array} * @memberof ErrorResponseDto */ 'causes'?: Array; } /** * * @export * @interface GetTenantContextV1200ResponseInner */ export interface GetTenantContextV1200ResponseInner { /** * * @type {string} * @memberof GetTenantContextV1200ResponseInner */ 'key'?: string; /** * * @type {string} * @memberof GetTenantContextV1200ResponseInner */ 'value'?: string; } /** * * @export * @interface GetTenantContextV1401Response */ export interface GetTenantContextV1401Response { /** * A message describing the error * @type {any} * @memberof GetTenantContextV1401Response */ 'error'?: any; } /** * * @export * @interface GetTenantContextV1429Response */ export interface GetTenantContextV1429Response { /** * A message describing the error * @type {any} * @memberof GetTenantContextV1429Response */ 'message'?: any; } /** * A JSONPatch Operation as defined by [RFC 6902 - JSON Patch](https://tools.ietf.org/html/rfc6902) * @export * @interface JsonPatchOperation */ export interface JsonPatchOperation { /** * The operation to be performed * @type {string} * @memberof JsonPatchOperation */ 'op': JsonPatchOperationOpEnum; /** * A string JSON Pointer representing the target path to an element to be affected by the operation * @type {string} * @memberof JsonPatchOperation */ 'path': string; /** * * @type {JsonPatchOperationValue} * @memberof JsonPatchOperation */ 'value'?: JsonPatchOperationValue; } export const JsonPatchOperationOpEnum = { Add: 'add', Remove: 'remove', Replace: 'replace', Move: 'move', Copy: 'copy', Test: 'test' } as const; export type JsonPatchOperationOpEnum = typeof JsonPatchOperationOpEnum[keyof typeof JsonPatchOperationOpEnum]; /** * @type JsonPatchOperationValue * The value to be used for the operation, required for \"add\" and \"replace\" operations * @export */ export type JsonPatchOperationValue = Array | boolean | number | object | string; /** * An indicator of how the locale was selected. *DEFAULT* means the locale is the system default. *REQUEST* means the locale was selected from the request context (i.e., best match based on the *Accept-Language* header). Additional values may be added in the future without notice. * @export * @enum {string} */ export const LocaleOrigin = { Default: 'DEFAULT', Request: 'REQUEST' } as const; export type LocaleOrigin = typeof LocaleOrigin[keyof typeof LocaleOrigin]; /** * TenantContextApi - axios parameter creator * @export */ export const TenantContextApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns all key-value pairs representing the current state of the tenant\'s context. Each tenant is limited to a maximum of 100 key-value pairs. * @summary Retrieve tenant context * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getTenantContextV1: async (axiosOptions: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/tenant-context/v1`; // 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, ...axiosOptions}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers}; return { url: toPathString(localVarUrlObj), axiosOptions: localVarRequestOptions, }; }, /** * Allows the user to make incremental updates to tenant context records using [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax. This endpoint is specifically designed to modify the `/Key/_*` field, supporting operations such as `add`, `remove`, or `replace` to manage key-value pairs. Note that each tenant is limited to a maximum of 100 key-value pairs. * @summary Update tenant context * @param {JsonPatchOperation} jsonPatchOperation * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ patchTenantContextV1: async (jsonPatchOperation: JsonPatchOperation, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'jsonPatchOperation' is not null or undefined assertParamExists('patchTenantContextV1', 'jsonPatchOperation', jsonPatchOperation) const localVarPath = `/tenant-context/v1`; // 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: 'PATCH', ...baseOptions, ...axiosOptions}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers}; localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchOperation, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), axiosOptions: localVarRequestOptions, }; }, } }; /** * TenantContextApi - functional programming interface * @export */ export const TenantContextApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = TenantContextApiAxiosParamCreator(configuration) return { /** * Returns all key-value pairs representing the current state of the tenant\'s context. Each tenant is limited to a maximum of 100 key-value pairs. * @summary Retrieve tenant context * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async getTenantContextV1(axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTenantContextV1(axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TenantContextApi.getTenantContextV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Allows the user to make incremental updates to tenant context records using [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax. This endpoint is specifically designed to modify the `/Key/_*` field, supporting operations such as `add`, `remove`, or `replace` to manage key-value pairs. Note that each tenant is limited to a maximum of 100 key-value pairs. * @summary Update tenant context * @param {JsonPatchOperation} jsonPatchOperation * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async patchTenantContextV1(jsonPatchOperation: JsonPatchOperation, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.patchTenantContextV1(jsonPatchOperation, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['TenantContextApi.patchTenantContextV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * TenantContextApi - factory interface * @export */ export const TenantContextApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = TenantContextApiFp(configuration) return { /** * Returns all key-value pairs representing the current state of the tenant\'s context. Each tenant is limited to a maximum of 100 key-value pairs. * @summary Retrieve tenant context * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getTenantContextV1(axiosOptions?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getTenantContextV1(axiosOptions).then((request) => request(axios, basePath)); }, /** * Allows the user to make incremental updates to tenant context records using [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax. This endpoint is specifically designed to modify the `/Key/_*` field, supporting operations such as `add`, `remove`, or `replace` to manage key-value pairs. Note that each tenant is limited to a maximum of 100 key-value pairs. * @summary Update tenant context * @param {TenantContextApiPatchTenantContextV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ patchTenantContextV1(requestParameters: TenantContextApiPatchTenantContextV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.patchTenantContextV1(requestParameters.jsonPatchOperation, axiosOptions).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for patchTenantContextV1 operation in TenantContextApi. * @export * @interface TenantContextApiPatchTenantContextV1Request */ export interface TenantContextApiPatchTenantContextV1Request { /** * * @type {JsonPatchOperation} * @memberof TenantContextApiPatchTenantContextV1 */ readonly jsonPatchOperation: JsonPatchOperation } /** * TenantContextApi - object-oriented interface * @export * @class TenantContextApi * @extends {BaseAPI} */ export class TenantContextApi extends BaseAPI { /** * Returns all key-value pairs representing the current state of the tenant\'s context. Each tenant is limited to a maximum of 100 key-value pairs. * @summary Retrieve tenant context * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof TenantContextApi */ public getTenantContextV1(axiosOptions?: RawAxiosRequestConfig) { return TenantContextApiFp(this.configuration).getTenantContextV1(axiosOptions).then((request) => request(this.axios, this.basePath)); } /** * Allows the user to make incremental updates to tenant context records using [JSON Patch](https://tools.ietf.org/html/rfc6902) syntax. This endpoint is specifically designed to modify the `/Key/_*` field, supporting operations such as `add`, `remove`, or `replace` to manage key-value pairs. Note that each tenant is limited to a maximum of 100 key-value pairs. * @summary Update tenant context * @param {TenantContextApiPatchTenantContextV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof TenantContextApi */ public patchTenantContextV1(requestParameters: TenantContextApiPatchTenantContextV1Request, axiosOptions?: RawAxiosRequestConfig) { return TenantContextApiFp(this.configuration).patchTenantContextV1(requestParameters.jsonPatchOperation, axiosOptions).then((request) => request(this.axios, this.basePath)); } }