/* tslint:disable */ /* eslint-disable */ /** * Identity Security Cloud API - Account 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 AccountUsage */ export interface AccountUsage { /** * The first day of the month for which activity is aggregated. * @type {string} * @memberof AccountUsage */ 'date'?: string; /** * The number of days within the month that the account was active in a source. * @type {number} * @memberof AccountUsage */ 'count'?: number; } /** * * @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 GetUsagesByAccountIdV1401Response */ export interface GetUsagesByAccountIdV1401Response { /** * A message describing the error * @type {any} * @memberof GetUsagesByAccountIdV1401Response */ 'error'?: any; } /** * * @export * @interface GetUsagesByAccountIdV1429Response */ export interface GetUsagesByAccountIdV1429Response { /** * A message describing the error * @type {any} * @memberof GetUsagesByAccountIdV1429Response */ '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]; /** * AccountUsagesApi - axios parameter creator * @export */ export const AccountUsagesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This API returns a summary of account usage insights for past 12 months. * @summary Returns account usage insights * @param {string} accountId ID of IDN account * @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} */ getUsagesByAccountIdV1: async (accountId: string, limit?: number, offset?: number, count?: boolean, sorters?: string, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'accountId' is not null or undefined assertParamExists('getUsagesByAccountIdV1', 'accountId', accountId) const localVarPath = `/account-usages/v1/{accountId}/summaries` .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId))); // 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, }; }, } }; /** * AccountUsagesApi - functional programming interface * @export */ export const AccountUsagesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AccountUsagesApiAxiosParamCreator(configuration) return { /** * This API returns a summary of account usage insights for past 12 months. * @summary Returns account usage insights * @param {string} accountId ID of IDN account * @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 getUsagesByAccountIdV1(accountId: string, limit?: number, offset?: number, count?: boolean, sorters?: string, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getUsagesByAccountIdV1(accountId, limit, offset, count, sorters, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['AccountUsagesApi.getUsagesByAccountIdV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * AccountUsagesApi - factory interface * @export */ export const AccountUsagesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AccountUsagesApiFp(configuration) return { /** * This API returns a summary of account usage insights for past 12 months. * @summary Returns account usage insights * @param {AccountUsagesApiGetUsagesByAccountIdV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ getUsagesByAccountIdV1(requestParameters: AccountUsagesApiGetUsagesByAccountIdV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getUsagesByAccountIdV1(requestParameters.accountId, requestParameters.limit, requestParameters.offset, requestParameters.count, requestParameters.sorters, axiosOptions).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getUsagesByAccountIdV1 operation in AccountUsagesApi. * @export * @interface AccountUsagesApiGetUsagesByAccountIdV1Request */ export interface AccountUsagesApiGetUsagesByAccountIdV1Request { /** * ID of IDN account * @type {string} * @memberof AccountUsagesApiGetUsagesByAccountIdV1 */ readonly accountId: 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 AccountUsagesApiGetUsagesByAccountIdV1 */ 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 AccountUsagesApiGetUsagesByAccountIdV1 */ 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 AccountUsagesApiGetUsagesByAccountIdV1 */ 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 AccountUsagesApiGetUsagesByAccountIdV1 */ readonly sorters?: string } /** * AccountUsagesApi - object-oriented interface * @export * @class AccountUsagesApi * @extends {BaseAPI} */ export class AccountUsagesApi extends BaseAPI { /** * This API returns a summary of account usage insights for past 12 months. * @summary Returns account usage insights * @param {AccountUsagesApiGetUsagesByAccountIdV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof AccountUsagesApi */ public getUsagesByAccountIdV1(requestParameters: AccountUsagesApiGetUsagesByAccountIdV1Request, axiosOptions?: RawAxiosRequestConfig) { return AccountUsagesApiFp(this.configuration).getUsagesByAccountIdV1(requestParameters.accountId, requestParameters.limit, requestParameters.offset, requestParameters.count, requestParameters.sorters, axiosOptions).then((request) => request(this.axios, this.basePath)); } }