/* tslint:disable */ /* eslint-disable */ /** * Identity Security Cloud API - Source Usages * 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 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 GetStatusBySourceIdV1401Response */ export interface GetStatusBySourceIdV1401Response { /** * A message describing the error * @type {any} * @memberof GetStatusBySourceIdV1401Response */ 'error'?: any; } /** * * @export * @interface GetStatusBySourceIdV1429Response */ export interface GetStatusBySourceIdV1429Response { /** * A message describing the error * @type {any} * @memberof GetStatusBySourceIdV1429Response */ 'message'?: any; } /** * 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]; /** * * @export * @interface SourceUsage */ export interface SourceUsage { /** * The first day of the month for which activity is aggregated. * @type {string} * @memberof SourceUsage */ 'date'?: string; /** * The average number of days that accounts were active within this source, for the month. * @type {number} * @memberof SourceUsage */ 'count'?: number; } /** * * @export * @interface SourceUsageStatus */ export interface SourceUsageStatus { /** * Source Usage Status. Acceptable values are: - COMPLETE - This status means that an activity data source has been setup and usage insights are available for the source. - INCOMPLETE - This status means that an activity data source has not been setup and usage insights are not available for the source. * @type {string} * @memberof SourceUsageStatus */ 'status'?: SourceUsageStatusStatusEnum; } export const SourceUsageStatusStatusEnum = { Complete: 'COMPLETE', Incomplete: 'INCOMPLETE' } as const; export type SourceUsageStatusStatusEnum = typeof SourceUsageStatusStatusEnum[keyof typeof SourceUsageStatusStatusEnum]; /** * SourceUsagesApi - axios parameter creator * @export */ export const SourceUsagesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This API returns the status of the source usage insights setup by IDN source ID. * @summary Finds status of source usage * @param {string} sourceId ID of IDN source * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getStatusBySourceIdV1: async (sourceId: string, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'sourceId' is not null or undefined assertParamExists('getStatusBySourceIdV1', 'sourceId', sourceId) const localVarPath = `/source-usages/v1/{sourceId}/status` .replace(`{${"sourceId"}}`, encodeURIComponent(String(sourceId))); // 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, }; }, /** * This API returns a summary of source usage insights for past 12 months. * @summary Returns source usage insights * @param {string} sourceId ID of IDN source * @param {number} [limit] Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @param {number} [offset] Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @param {boolean} [count] If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @param {string} [sorters] Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **date** * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getUsagesBySourceIdV1: async (sourceId: string, limit?: number, offset?: number, count?: boolean, sorters?: string, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'sourceId' is not null or undefined assertParamExists('getUsagesBySourceIdV1', 'sourceId', sourceId) const localVarPath = `/source-usages/v1/{sourceId}/summaries` .replace(`{${"sourceId"}}`, encodeURIComponent(String(sourceId))); // 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; if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (count !== undefined) { localVarQueryParameter['count'] = count; } if (sorters !== undefined) { localVarQueryParameter['sorters'] = sorters; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers}; return { url: toPathString(localVarUrlObj), axiosOptions: localVarRequestOptions, }; }, } }; /** * SourceUsagesApi - functional programming interface * @export */ export const SourceUsagesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = SourceUsagesApiAxiosParamCreator(configuration) return { /** * This API returns the status of the source usage insights setup by IDN source ID. * @summary Finds status of source usage * @param {string} sourceId ID of IDN source * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async getStatusBySourceIdV1(sourceId: string, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getStatusBySourceIdV1(sourceId, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SourceUsagesApi.getStatusBySourceIdV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * This API returns a summary of source usage insights for past 12 months. * @summary Returns source usage insights * @param {string} sourceId ID of IDN source * @param {number} [limit] Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @param {number} [offset] Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @param {boolean} [count] If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @param {string} [sorters] Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **date** * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async getUsagesBySourceIdV1(sourceId: string, limit?: number, offset?: number, count?: boolean, sorters?: string, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUsagesBySourceIdV1(sourceId, limit, offset, count, sorters, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SourceUsagesApi.getUsagesBySourceIdV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * SourceUsagesApi - factory interface * @export */ export const SourceUsagesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = SourceUsagesApiFp(configuration) return { /** * This API returns the status of the source usage insights setup by IDN source ID. * @summary Finds status of source usage * @param {SourceUsagesApiGetStatusBySourceIdV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getStatusBySourceIdV1(requestParameters: SourceUsagesApiGetStatusBySourceIdV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getStatusBySourceIdV1(requestParameters.sourceId, axiosOptions).then((request) => request(axios, basePath)); }, /** * This API returns a summary of source usage insights for past 12 months. * @summary Returns source usage insights * @param {SourceUsagesApiGetUsagesBySourceIdV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getUsagesBySourceIdV1(requestParameters: SourceUsagesApiGetUsagesBySourceIdV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getUsagesBySourceIdV1(requestParameters.sourceId, requestParameters.limit, requestParameters.offset, requestParameters.count, requestParameters.sorters, axiosOptions).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getStatusBySourceIdV1 operation in SourceUsagesApi. * @export * @interface SourceUsagesApiGetStatusBySourceIdV1Request */ export interface SourceUsagesApiGetStatusBySourceIdV1Request { /** * ID of IDN source * @type {string} * @memberof SourceUsagesApiGetStatusBySourceIdV1 */ readonly sourceId: string } /** * Request parameters for getUsagesBySourceIdV1 operation in SourceUsagesApi. * @export * @interface SourceUsagesApiGetUsagesBySourceIdV1Request */ export interface SourceUsagesApiGetUsagesBySourceIdV1Request { /** * ID of IDN source * @type {string} * @memberof SourceUsagesApiGetUsagesBySourceIdV1 */ readonly sourceId: string /** * Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @type {number} * @memberof SourceUsagesApiGetUsagesBySourceIdV1 */ readonly limit?: number /** * Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @type {number} * @memberof SourceUsagesApiGetUsagesBySourceIdV1 */ readonly offset?: number /** * If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. * @type {boolean} * @memberof SourceUsagesApiGetUsagesBySourceIdV1 */ readonly count?: boolean /** * Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **date** * @type {string} * @memberof SourceUsagesApiGetUsagesBySourceIdV1 */ readonly sorters?: string } /** * SourceUsagesApi - object-oriented interface * @export * @class SourceUsagesApi * @extends {BaseAPI} */ export class SourceUsagesApi extends BaseAPI { /** * This API returns the status of the source usage insights setup by IDN source ID. * @summary Finds status of source usage * @param {SourceUsagesApiGetStatusBySourceIdV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof SourceUsagesApi */ public getStatusBySourceIdV1(requestParameters: SourceUsagesApiGetStatusBySourceIdV1Request, axiosOptions?: RawAxiosRequestConfig) { return SourceUsagesApiFp(this.configuration).getStatusBySourceIdV1(requestParameters.sourceId, axiosOptions).then((request) => request(this.axios, this.basePath)); } /** * This API returns a summary of source usage insights for past 12 months. * @summary Returns source usage insights * @param {SourceUsagesApiGetUsagesBySourceIdV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof SourceUsagesApi */ public getUsagesBySourceIdV1(requestParameters: SourceUsagesApiGetUsagesBySourceIdV1Request, axiosOptions?: RawAxiosRequestConfig) { return SourceUsagesApiFp(this.configuration).getUsagesBySourceIdV1(requestParameters.sourceId, requestParameters.limit, requestParameters.offset, requestParameters.count, requestParameters.sorters, axiosOptions).then((request) => request(this.axios, this.basePath)); } }