/* tslint:disable */ /* eslint-disable */ /** * Identity Security Cloud API - Requestable Objects * 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 IdentityReferenceWithNameAndEmail */ export interface IdentityReferenceWithNameAndEmail { /** * The type can only be IDENTITY. This is read-only. * @type {string} * @memberof IdentityReferenceWithNameAndEmail */ 'type'?: string; /** * Identity ID. * @type {string} * @memberof IdentityReferenceWithNameAndEmail */ 'id'?: string; /** * Identity\'s human-readable display name. This is read-only. * @type {string} * @memberof IdentityReferenceWithNameAndEmail */ 'name'?: string; /** * Identity\'s email address. This is read-only. * @type {string} * @memberof IdentityReferenceWithNameAndEmail */ 'email'?: string | null; } /** * * @export * @interface ListRequestableObjectsV1401Response */ export interface ListRequestableObjectsV1401Response { /** * A message describing the error * @type {any} * @memberof ListRequestableObjectsV1401Response */ 'error'?: any; } /** * * @export * @interface ListRequestableObjectsV1429Response */ export interface ListRequestableObjectsV1429Response { /** * A message describing the error * @type {any} * @memberof ListRequestableObjectsV1429Response */ '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 RequestableObject */ export interface RequestableObject { /** * Id of the requestable object itself * @type {string} * @memberof RequestableObject */ 'id'?: string; /** * Human-readable display name of the requestable object * @type {string} * @memberof RequestableObject */ 'name'?: string; /** * The time when the requestable object was created * @type {string} * @memberof RequestableObject */ 'created'?: string; /** * The time when the requestable object was last modified * @type {string} * @memberof RequestableObject */ 'modified'?: string | null; /** * Description of the requestable object. * @type {string} * @memberof RequestableObject */ 'description'?: string | null; /** * * @type {RequestableObjectType} * @memberof RequestableObject */ 'type'?: RequestableObjectType; /** * * @type {RequestableObjectRequestStatus} * @memberof RequestableObject */ 'requestStatus'?: RequestableObjectRequestStatus; /** * If *requestStatus* is *PENDING*, indicates the id of the associated account activity. * @type {string} * @memberof RequestableObject */ 'identityRequestId'?: string | null; /** * * @type {IdentityReferenceWithNameAndEmail} * @memberof RequestableObject */ 'ownerRef'?: IdentityReferenceWithNameAndEmail | null; /** * Whether the requester must provide comments when requesting the object. * @type {boolean} * @memberof RequestableObject */ 'requestCommentsRequired'?: boolean; } /** * Status indicating the ability of an access request for the object to be made by or on behalf of the identity specified by *identity-id*. *AVAILABLE* indicates the object is available to request. *PENDING* indicates the object is unavailable because the identity has a pending request in flight. *ASSIGNED* indicates the object is unavailable because the identity already has the indicated role or access profile. If *identity-id* is not specified (allowed only for admin users), then status will be *AVAILABLE* for all results. * @export * @enum {string} */ export const RequestableObjectRequestStatus = { Available: 'AVAILABLE', Pending: 'PENDING', Assigned: 'ASSIGNED' } as const; export type RequestableObjectRequestStatus = typeof RequestableObjectRequestStatus[keyof typeof RequestableObjectRequestStatus]; /** * Currently supported requestable object types. * @export * @enum {string} */ export const RequestableObjectType = { AccessProfile: 'ACCESS_PROFILE', Role: 'ROLE', Entitlement: 'ENTITLEMENT' } as const; export type RequestableObjectType = typeof RequestableObjectType[keyof typeof RequestableObjectType]; /** * RequestableObjectsApi - axios parameter creator * @export */ export const RequestableObjectsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get a list of acccess items that can be requested through the [Access Request endpoints](https://developer.sailpoint.com/docs/api/access-requests). Access items are marked with `AVAILABLE`, `PENDING` or `ASSIGNED` with respect to the identity provided using `identity-id` query parameter. This endpoint only lists roles and access profiles. For gathering requestable entitlements, the [Entitlements List API](https://developer.sailpoint.com/docs/api/list-entitlements-v-1) can be used with the segmented-for-identity parameter. Any authenticated token can call this endpoint to see their requestable access items. * @summary Requestable objects list * @param {string} [identityId] If present, the value returns only requestable objects for the specified identity. * Admin users can call this with any identity ID value. * Non-admin users can only specify *me* or pass their own identity ID value. * If absent, returns a list of all requestable objects for the tenant. Only admin users can make such a call. In this case, the available, pending, assigned accesses will not be annotated in the result. * @param {Array} [types] Filters the results to the specified type/types, where each type is one of `ROLE` or `ACCESS_PROFILE`. If absent, all types are returned. SailPoint may add support for additional types in the future without notice. * @param {string} [term] Allows searching requestable access items with a partial match on the name or description. If `term` is provided, then the API will ignore the `filter` query parameter. * @param {Array} [statuses] Filters the result to the specified status/statuses, where each status is one of `AVAILABLE`, `ASSIGNED`, or `PENDING`. Specifying this parameter without also specifying an `identity-id` parameter results in an error. SailPoint may add additional statuses in the future without notice. * @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} [filters] Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in* **name**: *eq, in, sw* * @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: **name** * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ listRequestableObjectsV1: async (identityId?: string, types?: Array, term?: string, statuses?: Array, limit?: number, offset?: number, count?: boolean, filters?: string, sorters?: string, axiosOptions: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/requestable-objects/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; if (identityId !== undefined) { localVarQueryParameter['identity-id'] = identityId; } if (types) { localVarQueryParameter['types'] = types.join(COLLECTION_FORMATS.csv); } if (term !== undefined) { localVarQueryParameter['term'] = term; } if (statuses) { localVarQueryParameter['statuses'] = statuses.join(COLLECTION_FORMATS.csv); } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (count !== undefined) { localVarQueryParameter['count'] = count; } if (filters !== undefined) { localVarQueryParameter['filters'] = filters; } 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, }; }, } }; /** * RequestableObjectsApi - functional programming interface * @export */ export const RequestableObjectsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = RequestableObjectsApiAxiosParamCreator(configuration) return { /** * Get a list of acccess items that can be requested through the [Access Request endpoints](https://developer.sailpoint.com/docs/api/access-requests). Access items are marked with `AVAILABLE`, `PENDING` or `ASSIGNED` with respect to the identity provided using `identity-id` query parameter. This endpoint only lists roles and access profiles. For gathering requestable entitlements, the [Entitlements List API](https://developer.sailpoint.com/docs/api/list-entitlements-v-1) can be used with the segmented-for-identity parameter. Any authenticated token can call this endpoint to see their requestable access items. * @summary Requestable objects list * @param {string} [identityId] If present, the value returns only requestable objects for the specified identity. * Admin users can call this with any identity ID value. * Non-admin users can only specify *me* or pass their own identity ID value. * If absent, returns a list of all requestable objects for the tenant. Only admin users can make such a call. In this case, the available, pending, assigned accesses will not be annotated in the result. * @param {Array} [types] Filters the results to the specified type/types, where each type is one of `ROLE` or `ACCESS_PROFILE`. If absent, all types are returned. SailPoint may add support for additional types in the future without notice. * @param {string} [term] Allows searching requestable access items with a partial match on the name or description. If `term` is provided, then the API will ignore the `filter` query parameter. * @param {Array} [statuses] Filters the result to the specified status/statuses, where each status is one of `AVAILABLE`, `ASSIGNED`, or `PENDING`. Specifying this parameter without also specifying an `identity-id` parameter results in an error. SailPoint may add additional statuses in the future without notice. * @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} [filters] Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in* **name**: *eq, in, sw* * @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: **name** * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async listRequestableObjectsV1(identityId?: string, types?: Array, term?: string, statuses?: Array, limit?: number, offset?: number, count?: boolean, filters?: string, sorters?: string, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listRequestableObjectsV1(identityId, types, term, statuses, limit, offset, count, filters, sorters, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['RequestableObjectsApi.listRequestableObjectsV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * RequestableObjectsApi - factory interface * @export */ export const RequestableObjectsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = RequestableObjectsApiFp(configuration) return { /** * Get a list of acccess items that can be requested through the [Access Request endpoints](https://developer.sailpoint.com/docs/api/access-requests). Access items are marked with `AVAILABLE`, `PENDING` or `ASSIGNED` with respect to the identity provided using `identity-id` query parameter. This endpoint only lists roles and access profiles. For gathering requestable entitlements, the [Entitlements List API](https://developer.sailpoint.com/docs/api/list-entitlements-v-1) can be used with the segmented-for-identity parameter. Any authenticated token can call this endpoint to see their requestable access items. * @summary Requestable objects list * @param {RequestableObjectsApiListRequestableObjectsV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ listRequestableObjectsV1(requestParameters: RequestableObjectsApiListRequestableObjectsV1Request = {}, axiosOptions?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listRequestableObjectsV1(requestParameters.identityId, requestParameters.types, requestParameters.term, requestParameters.statuses, requestParameters.limit, requestParameters.offset, requestParameters.count, requestParameters.filters, requestParameters.sorters, axiosOptions).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for listRequestableObjectsV1 operation in RequestableObjectsApi. * @export * @interface RequestableObjectsApiListRequestableObjectsV1Request */ export interface RequestableObjectsApiListRequestableObjectsV1Request { /** * If present, the value returns only requestable objects for the specified identity. * Admin users can call this with any identity ID value. * Non-admin users can only specify *me* or pass their own identity ID value. * If absent, returns a list of all requestable objects for the tenant. Only admin users can make such a call. In this case, the available, pending, assigned accesses will not be annotated in the result. * @type {string} * @memberof RequestableObjectsApiListRequestableObjectsV1 */ readonly identityId?: string /** * Filters the results to the specified type/types, where each type is one of `ROLE` or `ACCESS_PROFILE`. If absent, all types are returned. SailPoint may add support for additional types in the future without notice. * @type {Array<'ACCESS_PROFILE' | 'ROLE'>} * @memberof RequestableObjectsApiListRequestableObjectsV1 */ readonly types?: Array /** * Allows searching requestable access items with a partial match on the name or description. If `term` is provided, then the API will ignore the `filter` query parameter. * @type {string} * @memberof RequestableObjectsApiListRequestableObjectsV1 */ readonly term?: string /** * Filters the result to the specified status/statuses, where each status is one of `AVAILABLE`, `ASSIGNED`, or `PENDING`. Specifying this parameter without also specifying an `identity-id` parameter results in an error. SailPoint may add additional statuses in the future without notice. * @type {Array} * @memberof RequestableObjectsApiListRequestableObjectsV1 */ readonly statuses?: Array /** * 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 RequestableObjectsApiListRequestableObjectsV1 */ 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 RequestableObjectsApiListRequestableObjectsV1 */ 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 RequestableObjectsApiListRequestableObjectsV1 */ readonly count?: boolean /** * Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in* **name**: *eq, in, sw* * @type {string} * @memberof RequestableObjectsApiListRequestableObjectsV1 */ readonly filters?: string /** * 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: **name** * @type {string} * @memberof RequestableObjectsApiListRequestableObjectsV1 */ readonly sorters?: string } /** * RequestableObjectsApi - object-oriented interface * @export * @class RequestableObjectsApi * @extends {BaseAPI} */ export class RequestableObjectsApi extends BaseAPI { /** * Get a list of acccess items that can be requested through the [Access Request endpoints](https://developer.sailpoint.com/docs/api/access-requests). Access items are marked with `AVAILABLE`, `PENDING` or `ASSIGNED` with respect to the identity provided using `identity-id` query parameter. This endpoint only lists roles and access profiles. For gathering requestable entitlements, the [Entitlements List API](https://developer.sailpoint.com/docs/api/list-entitlements-v-1) can be used with the segmented-for-identity parameter. Any authenticated token can call this endpoint to see their requestable access items. * @summary Requestable objects list * @param {RequestableObjectsApiListRequestableObjectsV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof RequestableObjectsApi */ public listRequestableObjectsV1(requestParameters: RequestableObjectsApiListRequestableObjectsV1Request = {}, axiosOptions?: RawAxiosRequestConfig) { return RequestableObjectsApiFp(this.configuration).listRequestableObjectsV1(requestParameters.identityId, requestParameters.types, requestParameters.term, requestParameters.statuses, requestParameters.limit, requestParameters.offset, requestParameters.count, requestParameters.filters, requestParameters.sorters, axiosOptions).then((request) => request(this.axios, this.basePath)); } } /** * @export */ export const ListRequestableObjectsV1TypesEnum = { AccessProfile: 'ACCESS_PROFILE', Role: 'ROLE' } as const; export type ListRequestableObjectsV1TypesEnum = typeof ListRequestableObjectsV1TypesEnum[keyof typeof ListRequestableObjectsV1TypesEnum];