/* tslint:disable */ /* eslint-disable */ /** * Identity Security Cloud API - Personal Access Tokens * 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 { } /** * Object for specifying the name of a personal access token to create * @export * @interface CreatePersonalAccessTokenRequest */ export interface CreatePersonalAccessTokenRequest { /** * The name of the personal access token (PAT) to be created. Cannot be the same as another PAT owned by the user for whom this PAT is being created. * @type {string} * @memberof CreatePersonalAccessTokenRequest */ 'name': string; /** * Scopes of the personal access token. If no scope is specified, the token will be created with the default scope \"sp:scopes:all\". This means the personal access token will have all the rights of the owner who created it. * @type {Array} * @memberof CreatePersonalAccessTokenRequest */ 'scope'?: Array | null; /** * Number of seconds an access token is valid when generated using this Personal Access Token. If no value is specified, the token will be created with the default value of 43200. * @type {number} * @memberof CreatePersonalAccessTokenRequest */ 'accessTokenValiditySeconds'?: number | null; /** * Date and time, down to the millisecond, when this personal access token will expire. **Important:** When `expirationDate` is `null` or empty (not included in the request body), the token will never expire. **Required Validation:** If `expirationDate` is `null` or empty, `userAwareTokenNeverExpires` must be set to `true`. This is a required validation rule. **Valid Values (dependent on `userAwareTokenNeverExpires`):** * **When `userAwareTokenNeverExpires` is `true` (or required to be `true`):** `expirationDate` can be `null` or omitted from the request body. When `expirationDate` is `null` or empty, the token will never expire. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (after the current date/time). There is no upper limit on how far in the future the expiration date can be set. `expirationDate` cannot be `null` in this case. **Validation Rules:** * **If `expirationDate` is `null` or not included in the request body:** `userAwareTokenNeverExpires` must be set to `true` (required). The token will never expire. * **If `expirationDate` is provided and is not `null`:** `userAwareTokenNeverExpires` can be omitted. * @type {string} * @memberof CreatePersonalAccessTokenRequest */ 'expirationDate'?: string | null; /** * Indicates that the user creating this Personal Access Token is aware of and acknowledges the security implications of creating a token that will never expire. When set to `true`, this flag confirms that the user understands the security risks associated with non-expiring tokens. **Security Awareness:** Setting this field to `true` serves as an explicit acknowledgment that the user creating the token understands: * Tokens that never expire pose a greater security risk if compromised * Non-expiring tokens should be used only when necessary and with appropriate security measures * Regular rotation and monitoring of non-expiring tokens is recommended **Required Validation:** If `expirationDate` is `null` or empty (not included in the request body), `userAwareTokenNeverExpires` must be set to `true`. This is a required validation rule. **Validation Rules:** * **If `expirationDate` is `null` or not included in the request body:** `userAwareTokenNeverExpires` must be set to `true` (required). * **If `expirationDate` is provided and is not `null`:** `userAwareTokenNeverExpires` can be omitted. **Behavior:** * When set to `true`: Indicates that the user acknowledges they are creating a token that will never expire. When `expirationDate` is `null` or empty, the token will never expire. * When set to `false` or not specified (and `expirationDate` is provided): The token will follow normal expiration rules based on the `expirationDate` field and `accessTokenValiditySeconds` setting. * @type {boolean} * @memberof CreatePersonalAccessTokenRequest */ 'userAwareTokenNeverExpires'?: boolean | null; } /** * * @export * @interface CreatePersonalAccessTokenResponse */ export interface CreatePersonalAccessTokenResponse { /** * The ID of the personal access token (to be used as the username for Basic Auth). * @type {string} * @memberof CreatePersonalAccessTokenResponse */ 'id': string; /** * The secret of the personal access token (to be used as the password for Basic Auth). * @type {string} * @memberof CreatePersonalAccessTokenResponse */ 'secret': string; /** * Scopes of the personal access token. * @type {Array} * @memberof CreatePersonalAccessTokenResponse */ 'scope': Array | null; /** * The name of the personal access token. Cannot be the same as other personal access tokens owned by a user. * @type {string} * @memberof CreatePersonalAccessTokenResponse */ 'name': string; /** * * @type {PatOwner} * @memberof CreatePersonalAccessTokenResponse */ 'owner': PatOwner; /** * The date and time, down to the millisecond, when this personal access token was created. * @type {string} * @memberof CreatePersonalAccessTokenResponse */ 'created': string; /** * Number of seconds an access token is valid when generated using this Personal Access Token. If no value is specified, the token will be created with the default value of 43200. * @type {number} * @memberof CreatePersonalAccessTokenResponse */ 'accessTokenValiditySeconds': number; /** * Date and time, down to the millisecond, when this personal access token will expire. If not provided, the token will expire 6 months after its creation date. The value must be a valid date-time string between the current date and 6 months from the creation date. * @type {string} * @memberof CreatePersonalAccessTokenResponse */ 'expirationDate': string; } /** * * @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 GetPersonalAccessTokenResponse */ export interface GetPersonalAccessTokenResponse { /** * The ID of the personal access token (to be used as the username for Basic Auth). * @type {string} * @memberof GetPersonalAccessTokenResponse */ 'id': string; /** * The name of the personal access token. Cannot be the same as other personal access tokens owned by a user. * @type {string} * @memberof GetPersonalAccessTokenResponse */ 'name': string; /** * Scopes of the personal access token. * @type {Array} * @memberof GetPersonalAccessTokenResponse */ 'scope': Array | null; /** * * @type {PatOwner} * @memberof GetPersonalAccessTokenResponse */ 'owner': PatOwner; /** * The date and time, down to the millisecond, when this personal access token was created. * @type {string} * @memberof GetPersonalAccessTokenResponse */ 'created': string; /** * The date and time, down to the millisecond, when this personal access token was last used to generate an access token. This timestamp does not get updated on every PAT usage, but only once a day. This property can be useful for identifying which PATs are no longer actively used and can be removed. * @type {string} * @memberof GetPersonalAccessTokenResponse */ 'lastUsed'?: string | null; /** * If true, this token is managed by the SailPoint platform, and is not visible in the user interface. For example, Workflows will create managed personal access tokens for users who create workflows. * @type {boolean} * @memberof GetPersonalAccessTokenResponse */ 'managed'?: boolean; /** * Number of seconds an access token is valid when generated using this Personal Access Token. If no value is specified, the token will be created with the default value of 43200. * @type {number} * @memberof GetPersonalAccessTokenResponse */ 'accessTokenValiditySeconds'?: number; /** * Date and time, down to the millisecond, when this personal access token will expire. **Important:** When `expirationDate` is `null` or empty, the token will never expire (and `userAwareTokenNeverExpires` will be `true`). When `expirationDate` is provided, this value must be a future date. There is no upper limit on how far in the future the expiration date can be set. * @type {string} * @memberof GetPersonalAccessTokenResponse */ 'expirationDate'?: string | null; /** * Indicates that the user who created or updated this Personal Access Token is aware of and acknowledges the security implications of creating a token that will never expire. When `true`, this flag confirms that the user understood the security risks associated with non-expiring tokens at the time of creation or update. **Security Awareness:** This field serves as a record that the user acknowledged: * Tokens that never expire pose a greater security risk if compromised * Non-expiring tokens should be used only when necessary and with appropriate security measures * Regular rotation and monitoring of non-expiring tokens is recommended **Behavior:** * When `true`: Indicates that the user acknowledged they were creating a token that will never expire. When `expirationDate` is `null`, the token will never expire. * When `false`: The token follows normal expiration rules based on the `expirationDate` field and `accessTokenValiditySeconds` setting. * @type {boolean} * @memberof GetPersonalAccessTokenResponse */ 'userAwareTokenNeverExpires'?: boolean; } /** * 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; /** * * @export * @interface ListPersonalAccessTokensV1401Response */ export interface ListPersonalAccessTokensV1401Response { /** * A message describing the error * @type {any} * @memberof ListPersonalAccessTokensV1401Response */ 'error'?: any; } /** * * @export * @interface ListPersonalAccessTokensV1429Response */ export interface ListPersonalAccessTokensV1429Response { /** * A message describing the error * @type {any} * @memberof ListPersonalAccessTokensV1429Response */ '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]; /** * Personal access token owner\'s identity. * @export * @interface PatOwner */ export interface PatOwner { /** * Personal access token owner\'s DTO type. * @type {string} * @memberof PatOwner */ 'type'?: PatOwnerTypeEnum; /** * Personal access token owner\'s identity ID. * @type {string} * @memberof PatOwner */ 'id'?: string; /** * Personal access token owner\'s human-readable display name. * @type {string} * @memberof PatOwner */ 'name'?: string; } export const PatOwnerTypeEnum = { Identity: 'IDENTITY' } as const; export type PatOwnerTypeEnum = typeof PatOwnerTypeEnum[keyof typeof PatOwnerTypeEnum]; /** * PersonalAccessTokensApi - axios parameter creator * @export */ export const PersonalAccessTokensApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This creates a personal access token. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (not included in the request body), the token will never expire. **Required Validation:** If `expirationDate` is `null` or empty, `userAwareTokenNeverExpires` must be set to `true`. This is a required validation rule. The valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is `true` (or required to be `true`):** `expirationDate` can be `null` or omitted from the request body. When `expirationDate` is `null` or empty, the token will never expire. This creates a PAT that never expires and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is `null` or not included in the request body:** `userAwareTokenNeverExpires` must be set to `true` (required). The token will never expire. * **If `expirationDate` is provided and is not `null`:** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Create personal access token * @param {CreatePersonalAccessTokenRequest} createPersonalAccessTokenRequest Configuration for creating a personal access token, including name, scope, expiration settings, and user acknowledgment of never-expiring tokens. **Important:** See the endpoint description for validation rules regarding the relationship between `expirationDate` and `userAwareTokenNeverExpires`. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ createPersonalAccessTokenV1: async (createPersonalAccessTokenRequest: CreatePersonalAccessTokenRequest, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'createPersonalAccessTokenRequest' is not null or undefined assertParamExists('createPersonalAccessTokenV1', 'createPersonalAccessTokenRequest', createPersonalAccessTokenRequest) const localVarPath = `/personal-access-tokens/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: 'POST', ...baseOptions, ...axiosOptions}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createPersonalAccessTokenRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), axiosOptions: localVarRequestOptions, }; }, /** * This deletes a personal access token. * @summary Delete personal access token * @param {string} id The personal access token id * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ deletePersonalAccessTokenV1: async (id: string, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('deletePersonalAccessTokenV1', 'id', id) const localVarPath = `/personal-access-tokens/v1/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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: 'DELETE', ...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 gets a collection of personal access tokens associated with the optional `owner-id`. query parameter. If the `owner-id` query parameter is omitted, all personal access tokens for a tenant will be retrieved, but the caller must have the \'idn:all-personal-access-tokens:read\' right. * @summary List personal access tokens * @param {string} [ownerId] The identity ID of the owner whose personal access tokens should be listed. If \"me\", the caller should have the following right: \'idn:my-personal-access-tokens:read\' If an actual owner ID or if the `owner-id` parameter is omitted in the request, the caller should have the following right: \'idn:all-personal-access-tokens:read\'. If the caller has the following right, then managed personal access tokens associated with `owner-id` will be retrieved: \'idn:managed-personal-access-tokens:read\' * @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: **lastUsed**: *le, isnull* * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ listPersonalAccessTokensV1: async (ownerId?: string, filters?: string, axiosOptions: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/personal-access-tokens/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 (ownerId !== undefined) { localVarQueryParameter['owner-id'] = ownerId; } if (filters !== undefined) { localVarQueryParameter['filters'] = filters; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers}; return { url: toPathString(localVarUrlObj), axiosOptions: localVarRequestOptions, }; }, /** * This performs a targeted update to the field(s) of a Personal Access Token. Changing scopes for a Personal Access Token does not impact existing bearer tokens. You will need to create a new bearer token to have the new scopes. Please note that it can take up to 20 minutes for scope changes to be seen on new bearer tokens. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (replaced to `null` or omitted from the patch request), the token will never expire. **Required Validation:** If `expirationDate` is being replaced to `null` or is empty, `userAwareTokenNeverExpires` must be set to `true` in the patch request. This is a required validation rule. When patching `expirationDate` and `userAwareTokenNeverExpires`, the valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is being set to `true` (or required to be `true`):** `expirationDate` can be replaced to `null` or omitted from the patch request. When `expirationDate` is `null` or empty, the token will never expire. This sets the PAT to never expire and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is being replaced to `null`:** `userAwareTokenNeverExpires` must also be present in the patch request with a value of `true` (required). The token will never expire. * **If `expirationDate` is not being replaced to `null` (i.e., set to a future date):** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Patch personal access token * @param {string} id The Personal Access Token id * @param {Array} jsonPatchOperation A list of OAuth client update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * scope * expirationDate * userAwareTokenNeverExpires **Important:** See the endpoint description for validation rules regarding the relationship between `expirationDate` and `userAwareTokenNeverExpires`. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ patchPersonalAccessTokenV1: async (id: string, jsonPatchOperation: Array, axiosOptions: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('patchPersonalAccessTokenV1', 'id', id) // verify required parameter 'jsonPatchOperation' is not null or undefined assertParamExists('patchPersonalAccessTokenV1', 'jsonPatchOperation', jsonPatchOperation) const localVarPath = `/personal-access-tokens/v1/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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, }; }, } }; /** * PersonalAccessTokensApi - functional programming interface * @export */ export const PersonalAccessTokensApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = PersonalAccessTokensApiAxiosParamCreator(configuration) return { /** * This creates a personal access token. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (not included in the request body), the token will never expire. **Required Validation:** If `expirationDate` is `null` or empty, `userAwareTokenNeverExpires` must be set to `true`. This is a required validation rule. The valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is `true` (or required to be `true`):** `expirationDate` can be `null` or omitted from the request body. When `expirationDate` is `null` or empty, the token will never expire. This creates a PAT that never expires and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is `null` or not included in the request body:** `userAwareTokenNeverExpires` must be set to `true` (required). The token will never expire. * **If `expirationDate` is provided and is not `null`:** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Create personal access token * @param {CreatePersonalAccessTokenRequest} createPersonalAccessTokenRequest Configuration for creating a personal access token, including name, scope, expiration settings, and user acknowledgment of never-expiring tokens. **Important:** See the endpoint description for validation rules regarding the relationship between `expirationDate` and `userAwareTokenNeverExpires`. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async createPersonalAccessTokenV1(createPersonalAccessTokenRequest: CreatePersonalAccessTokenRequest, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createPersonalAccessTokenV1(createPersonalAccessTokenRequest, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PersonalAccessTokensApi.createPersonalAccessTokenV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * This deletes a personal access token. * @summary Delete personal access token * @param {string} id The personal access token id * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async deletePersonalAccessTokenV1(id: string, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePersonalAccessTokenV1(id, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PersonalAccessTokensApi.deletePersonalAccessTokenV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * This gets a collection of personal access tokens associated with the optional `owner-id`. query parameter. If the `owner-id` query parameter is omitted, all personal access tokens for a tenant will be retrieved, but the caller must have the \'idn:all-personal-access-tokens:read\' right. * @summary List personal access tokens * @param {string} [ownerId] The identity ID of the owner whose personal access tokens should be listed. If \"me\", the caller should have the following right: \'idn:my-personal-access-tokens:read\' If an actual owner ID or if the `owner-id` parameter is omitted in the request, the caller should have the following right: \'idn:all-personal-access-tokens:read\'. If the caller has the following right, then managed personal access tokens associated with `owner-id` will be retrieved: \'idn:managed-personal-access-tokens:read\' * @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: **lastUsed**: *le, isnull* * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async listPersonalAccessTokensV1(ownerId?: string, filters?: string, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listPersonalAccessTokensV1(ownerId, filters, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PersonalAccessTokensApi.listPersonalAccessTokensV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * This performs a targeted update to the field(s) of a Personal Access Token. Changing scopes for a Personal Access Token does not impact existing bearer tokens. You will need to create a new bearer token to have the new scopes. Please note that it can take up to 20 minutes for scope changes to be seen on new bearer tokens. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (replaced to `null` or omitted from the patch request), the token will never expire. **Required Validation:** If `expirationDate` is being replaced to `null` or is empty, `userAwareTokenNeverExpires` must be set to `true` in the patch request. This is a required validation rule. When patching `expirationDate` and `userAwareTokenNeverExpires`, the valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is being set to `true` (or required to be `true`):** `expirationDate` can be replaced to `null` or omitted from the patch request. When `expirationDate` is `null` or empty, the token will never expire. This sets the PAT to never expire and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is being replaced to `null`:** `userAwareTokenNeverExpires` must also be present in the patch request with a value of `true` (required). The token will never expire. * **If `expirationDate` is not being replaced to `null` (i.e., set to a future date):** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Patch personal access token * @param {string} id The Personal Access Token id * @param {Array} jsonPatchOperation A list of OAuth client update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * scope * expirationDate * userAwareTokenNeverExpires **Important:** See the endpoint description for validation rules regarding the relationship between `expirationDate` and `userAwareTokenNeverExpires`. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ async patchPersonalAccessTokenV1(id: string, jsonPatchOperation: Array, axiosOptions?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.patchPersonalAccessTokenV1(id, jsonPatchOperation, axiosOptions); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PersonalAccessTokensApi.patchPersonalAccessTokenV1']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * PersonalAccessTokensApi - factory interface * @export */ export const PersonalAccessTokensApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = PersonalAccessTokensApiFp(configuration) return { /** * This creates a personal access token. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (not included in the request body), the token will never expire. **Required Validation:** If `expirationDate` is `null` or empty, `userAwareTokenNeverExpires` must be set to `true`. This is a required validation rule. The valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is `true` (or required to be `true`):** `expirationDate` can be `null` or omitted from the request body. When `expirationDate` is `null` or empty, the token will never expire. This creates a PAT that never expires and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is `null` or not included in the request body:** `userAwareTokenNeverExpires` must be set to `true` (required). The token will never expire. * **If `expirationDate` is provided and is not `null`:** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Create personal access token * @param {PersonalAccessTokensApiCreatePersonalAccessTokenV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ createPersonalAccessTokenV1(requestParameters: PersonalAccessTokensApiCreatePersonalAccessTokenV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createPersonalAccessTokenV1(requestParameters.createPersonalAccessTokenRequest, axiosOptions).then((request) => request(axios, basePath)); }, /** * This deletes a personal access token. * @summary Delete personal access token * @param {PersonalAccessTokensApiDeletePersonalAccessTokenV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ deletePersonalAccessTokenV1(requestParameters: PersonalAccessTokensApiDeletePersonalAccessTokenV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deletePersonalAccessTokenV1(requestParameters.id, axiosOptions).then((request) => request(axios, basePath)); }, /** * This gets a collection of personal access tokens associated with the optional `owner-id`. query parameter. If the `owner-id` query parameter is omitted, all personal access tokens for a tenant will be retrieved, but the caller must have the \'idn:all-personal-access-tokens:read\' right. * @summary List personal access tokens * @param {PersonalAccessTokensApiListPersonalAccessTokensV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ listPersonalAccessTokensV1(requestParameters: PersonalAccessTokensApiListPersonalAccessTokensV1Request = {}, axiosOptions?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listPersonalAccessTokensV1(requestParameters.ownerId, requestParameters.filters, axiosOptions).then((request) => request(axios, basePath)); }, /** * This performs a targeted update to the field(s) of a Personal Access Token. Changing scopes for a Personal Access Token does not impact existing bearer tokens. You will need to create a new bearer token to have the new scopes. Please note that it can take up to 20 minutes for scope changes to be seen on new bearer tokens. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (replaced to `null` or omitted from the patch request), the token will never expire. **Required Validation:** If `expirationDate` is being replaced to `null` or is empty, `userAwareTokenNeverExpires` must be set to `true` in the patch request. This is a required validation rule. When patching `expirationDate` and `userAwareTokenNeverExpires`, the valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is being set to `true` (or required to be `true`):** `expirationDate` can be replaced to `null` or omitted from the patch request. When `expirationDate` is `null` or empty, the token will never expire. This sets the PAT to never expire and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is being replaced to `null`:** `userAwareTokenNeverExpires` must also be present in the patch request with a value of `true` (required). The token will never expire. * **If `expirationDate` is not being replaced to `null` (i.e., set to a future date):** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Patch personal access token * @param {PersonalAccessTokensApiPatchPersonalAccessTokenV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} */ patchPersonalAccessTokenV1(requestParameters: PersonalAccessTokensApiPatchPersonalAccessTokenV1Request, axiosOptions?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.patchPersonalAccessTokenV1(requestParameters.id, requestParameters.jsonPatchOperation, axiosOptions).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createPersonalAccessTokenV1 operation in PersonalAccessTokensApi. * @export * @interface PersonalAccessTokensApiCreatePersonalAccessTokenV1Request */ export interface PersonalAccessTokensApiCreatePersonalAccessTokenV1Request { /** * Configuration for creating a personal access token, including name, scope, expiration settings, and user acknowledgment of never-expiring tokens. **Important:** See the endpoint description for validation rules regarding the relationship between `expirationDate` and `userAwareTokenNeverExpires`. * @type {CreatePersonalAccessTokenRequest} * @memberof PersonalAccessTokensApiCreatePersonalAccessTokenV1 */ readonly createPersonalAccessTokenRequest: CreatePersonalAccessTokenRequest } /** * Request parameters for deletePersonalAccessTokenV1 operation in PersonalAccessTokensApi. * @export * @interface PersonalAccessTokensApiDeletePersonalAccessTokenV1Request */ export interface PersonalAccessTokensApiDeletePersonalAccessTokenV1Request { /** * The personal access token id * @type {string} * @memberof PersonalAccessTokensApiDeletePersonalAccessTokenV1 */ readonly id: string } /** * Request parameters for listPersonalAccessTokensV1 operation in PersonalAccessTokensApi. * @export * @interface PersonalAccessTokensApiListPersonalAccessTokensV1Request */ export interface PersonalAccessTokensApiListPersonalAccessTokensV1Request { /** * The identity ID of the owner whose personal access tokens should be listed. If \"me\", the caller should have the following right: \'idn:my-personal-access-tokens:read\' If an actual owner ID or if the `owner-id` parameter is omitted in the request, the caller should have the following right: \'idn:all-personal-access-tokens:read\'. If the caller has the following right, then managed personal access tokens associated with `owner-id` will be retrieved: \'idn:managed-personal-access-tokens:read\' * @type {string} * @memberof PersonalAccessTokensApiListPersonalAccessTokensV1 */ readonly ownerId?: string /** * 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: **lastUsed**: *le, isnull* * @type {string} * @memberof PersonalAccessTokensApiListPersonalAccessTokensV1 */ readonly filters?: string } /** * Request parameters for patchPersonalAccessTokenV1 operation in PersonalAccessTokensApi. * @export * @interface PersonalAccessTokensApiPatchPersonalAccessTokenV1Request */ export interface PersonalAccessTokensApiPatchPersonalAccessTokenV1Request { /** * The Personal Access Token id * @type {string} * @memberof PersonalAccessTokensApiPatchPersonalAccessTokenV1 */ readonly id: string /** * A list of OAuth client update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * scope * expirationDate * userAwareTokenNeverExpires **Important:** See the endpoint description for validation rules regarding the relationship between `expirationDate` and `userAwareTokenNeverExpires`. * @type {Array} * @memberof PersonalAccessTokensApiPatchPersonalAccessTokenV1 */ readonly jsonPatchOperation: Array } /** * PersonalAccessTokensApi - object-oriented interface * @export * @class PersonalAccessTokensApi * @extends {BaseAPI} */ export class PersonalAccessTokensApi extends BaseAPI { /** * This creates a personal access token. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (not included in the request body), the token will never expire. **Required Validation:** If `expirationDate` is `null` or empty, `userAwareTokenNeverExpires` must be set to `true`. This is a required validation rule. The valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is `true` (or required to be `true`):** `expirationDate` can be `null` or omitted from the request body. When `expirationDate` is `null` or empty, the token will never expire. This creates a PAT that never expires and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is `null` or not included in the request body:** `userAwareTokenNeverExpires` must be set to `true` (required). The token will never expire. * **If `expirationDate` is provided and is not `null`:** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Create personal access token * @param {PersonalAccessTokensApiCreatePersonalAccessTokenV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof PersonalAccessTokensApi */ public createPersonalAccessTokenV1(requestParameters: PersonalAccessTokensApiCreatePersonalAccessTokenV1Request, axiosOptions?: RawAxiosRequestConfig) { return PersonalAccessTokensApiFp(this.configuration).createPersonalAccessTokenV1(requestParameters.createPersonalAccessTokenRequest, axiosOptions).then((request) => request(this.axios, this.basePath)); } /** * This deletes a personal access token. * @summary Delete personal access token * @param {PersonalAccessTokensApiDeletePersonalAccessTokenV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof PersonalAccessTokensApi */ public deletePersonalAccessTokenV1(requestParameters: PersonalAccessTokensApiDeletePersonalAccessTokenV1Request, axiosOptions?: RawAxiosRequestConfig) { return PersonalAccessTokensApiFp(this.configuration).deletePersonalAccessTokenV1(requestParameters.id, axiosOptions).then((request) => request(this.axios, this.basePath)); } /** * This gets a collection of personal access tokens associated with the optional `owner-id`. query parameter. If the `owner-id` query parameter is omitted, all personal access tokens for a tenant will be retrieved, but the caller must have the \'idn:all-personal-access-tokens:read\' right. * @summary List personal access tokens * @param {PersonalAccessTokensApiListPersonalAccessTokensV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof PersonalAccessTokensApi */ public listPersonalAccessTokensV1(requestParameters: PersonalAccessTokensApiListPersonalAccessTokensV1Request = {}, axiosOptions?: RawAxiosRequestConfig) { return PersonalAccessTokensApiFp(this.configuration).listPersonalAccessTokensV1(requestParameters.ownerId, requestParameters.filters, axiosOptions).then((request) => request(this.axios, this.basePath)); } /** * This performs a targeted update to the field(s) of a Personal Access Token. Changing scopes for a Personal Access Token does not impact existing bearer tokens. You will need to create a new bearer token to have the new scopes. Please note that it can take up to 20 minutes for scope changes to be seen on new bearer tokens. **expirationDate and userAwareTokenNeverExpires Relationship:** **Important:** When `expirationDate` is `null` or empty (replaced to `null` or omitted from the patch request), the token will never expire. **Required Validation:** If `expirationDate` is being replaced to `null` or is empty, `userAwareTokenNeverExpires` must be set to `true` in the patch request. This is a required validation rule. When patching `expirationDate` and `userAwareTokenNeverExpires`, the valid values for `expirationDate` depend on the value provided for `userAwareTokenNeverExpires`: * **When `userAwareTokenNeverExpires` is being set to `true` (or required to be `true`):** `expirationDate` can be replaced to `null` or omitted from the patch request. When `expirationDate` is `null` or empty, the token will never expire. This sets the PAT to never expire and serves as an explicit acknowledgment that the user is aware of the security implications of creating a non-expiring token. * **When `userAwareTokenNeverExpires` is `false` or omitted:** `expirationDate` must be provided and must be a valid date-time string representing a future date (there is no upper limit). `expirationDate` cannot be `null` in this case. In this scenario, `userAwareTokenNeverExpires` can be omitted. **Validation Rules:** * **If `expirationDate` is being replaced to `null`:** `userAwareTokenNeverExpires` must also be present in the patch request with a value of `true` (required). The token will never expire. * **If `expirationDate` is not being replaced to `null` (i.e., set to a future date):** `userAwareTokenNeverExpires` can be omitted. **Security Considerations:** The `userAwareTokenNeverExpires` field is designed to ensure that users explicitly acknowledge the security implications of creating tokens that never expire. Setting this field to `true` indicates that the user understands the increased security risks and has made an informed decision to proceed. **Note:** The `userAwareTokenNeverExpires` field indicates that the user acknowledges they are creating a token that will never expire. It does not affect token behavior beyond indicating this acknowledgment. * @summary Patch personal access token * @param {PersonalAccessTokensApiPatchPersonalAccessTokenV1Request} requestParameters Request parameters. * @param {*} [axiosOptions] Override http request option. * @throws {RequiredError} * @memberof PersonalAccessTokensApi */ public patchPersonalAccessTokenV1(requestParameters: PersonalAccessTokensApiPatchPersonalAccessTokenV1Request, axiosOptions?: RawAxiosRequestConfig) { return PersonalAccessTokensApiFp(this.configuration).patchPersonalAccessTokenV1(requestParameters.id, requestParameters.jsonPatchOperation, axiosOptions).then((request) => request(this.axios, this.basePath)); } }