/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * 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'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // 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 { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetFindingsExternalResponse } from '../models'; // @ts-ignore import { SecurityFindingDetailed } from '../models'; // @ts-ignore import { UpdateFindingExternalRequest } from '../models'; /** * SecurityPostureManagementApi - axios parameter creator * @export */ export const SecurityPostureManagementApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns a single FSPM security finding for the workspace, redacted to the public field set. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get a FSPM security finding by ID * @param {string} id Unique identifier of the finding * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSecurityFindingById: async (id: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getSecurityFindingById', 'id', id) const localVarPath = `/security/fspm/findings/{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: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getSecurityFindingById'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a paginated list of FSPM security findings for the workspace. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get FSPM security findings * @param {string} [pageCursor] Cursor indicating the page position. Omit to fetch the first page. * @param {number} [pageSize] Number of results per page * @param {GetSecurityFindingsSeverityEnum} [severity] Filter by severity level * @param {GetSecurityFindingsCategoryEnum} [category] Filter by finding category * @param {GetSecurityFindingsStatusEnum} [status] Filter by finding status * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSecurityFindings: async (pageCursor?: string, pageSize?: number, severity?: GetSecurityFindingsSeverityEnum, category?: GetSecurityFindingsCategoryEnum, status?: GetSecurityFindingsStatusEnum, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/security/fspm/findings`; // 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, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getSecurityFindings'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (severity !== undefined) { localVarQueryParameter['severity'] = severity; } if (category !== undefined) { localVarQueryParameter['category'] = category; } if (status !== undefined) { localVarQueryParameter['status'] = status; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Accepts or reopens a finding for the workspace. When accepting a finding (`status: \"ACCEPTED\"`), `statusUpdatedReason` is required. Endpoint Roles: Security Admin. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Update a FSPM security finding by ID * @param {UpdateFindingExternalRequest} updateFindingExternalRequest * @param {string} id Unique identifier of the finding * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSecurityFindingById: async (updateFindingExternalRequest: UpdateFindingExternalRequest, id: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateSecurityFindingById', 'updateFindingExternalRequest', updateFindingExternalRequest) assertParamExistsAndNotEmpty('updateSecurityFindingById', 'id', id) const localVarPath = `/security/fspm/findings/{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, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'updateSecurityFindingById'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateFindingExternalRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * SecurityPostureManagementApi - functional programming interface * @export */ export const SecurityPostureManagementApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = SecurityPostureManagementApiAxiosParamCreator(configuration) return { /** * Returns a single FSPM security finding for the workspace, redacted to the public field set. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get a FSPM security finding by ID * @param {string} id Unique identifier of the finding * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSecurityFindingById(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSecurityFindingById(id, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['SecurityPostureManagementApi.getSecurityFindingById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a paginated list of FSPM security findings for the workspace. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get FSPM security findings * @param {string} [pageCursor] Cursor indicating the page position. Omit to fetch the first page. * @param {number} [pageSize] Number of results per page * @param {GetSecurityFindingsSeverityEnum} [severity] Filter by severity level * @param {GetSecurityFindingsCategoryEnum} [category] Filter by finding category * @param {GetSecurityFindingsStatusEnum} [status] Filter by finding status * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSecurityFindings(pageCursor?: string, pageSize?: number, severity?: GetSecurityFindingsSeverityEnum, category?: GetSecurityFindingsCategoryEnum, status?: GetSecurityFindingsStatusEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSecurityFindings(pageCursor, pageSize, severity, category, status, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['SecurityPostureManagementApi.getSecurityFindings']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Accepts or reopens a finding for the workspace. When accepting a finding (`status: \"ACCEPTED\"`), `statusUpdatedReason` is required. Endpoint Roles: Security Admin. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Update a FSPM security finding by ID * @param {UpdateFindingExternalRequest} updateFindingExternalRequest * @param {string} id Unique identifier of the finding * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSecurityFindingById(updateFindingExternalRequest: UpdateFindingExternalRequest, id: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateSecurityFindingById(updateFindingExternalRequest, id, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['SecurityPostureManagementApi.updateSecurityFindingById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * SecurityPostureManagementApi - factory interface * @export */ export const SecurityPostureManagementApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = SecurityPostureManagementApiFp(configuration) return { /** * Returns a single FSPM security finding for the workspace, redacted to the public field set. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get a FSPM security finding by ID * @param {SecurityPostureManagementApiGetSecurityFindingByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSecurityFindingById(requestParameters: SecurityPostureManagementApiGetSecurityFindingByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSecurityFindingById(requestParameters.id, options).then((request) => request(axios, basePath)); }, /** * Returns a paginated list of FSPM security findings for the workspace. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get FSPM security findings * @param {SecurityPostureManagementApiGetSecurityFindingsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSecurityFindings(requestParameters: SecurityPostureManagementApiGetSecurityFindingsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSecurityFindings(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.severity, requestParameters.category, requestParameters.status, options).then((request) => request(axios, basePath)); }, /** * Accepts or reopens a finding for the workspace. When accepting a finding (`status: \"ACCEPTED\"`), `statusUpdatedReason` is required. Endpoint Roles: Security Admin. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Update a FSPM security finding by ID * @param {SecurityPostureManagementApiUpdateSecurityFindingByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSecurityFindingById(requestParameters: SecurityPostureManagementApiUpdateSecurityFindingByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateSecurityFindingById(requestParameters.updateFindingExternalRequest, requestParameters.id, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getSecurityFindingById operation in SecurityPostureManagementApi. * @export * @interface SecurityPostureManagementApiGetSecurityFindingByIdRequest */ export interface SecurityPostureManagementApiGetSecurityFindingByIdRequest { /** * Unique identifier of the finding * @type {string} * @memberof SecurityPostureManagementApiGetSecurityFindingById */ readonly id: string } /** * Request parameters for getSecurityFindings operation in SecurityPostureManagementApi. * @export * @interface SecurityPostureManagementApiGetSecurityFindingsRequest */ export interface SecurityPostureManagementApiGetSecurityFindingsRequest { /** * Cursor indicating the page position. Omit to fetch the first page. * @type {string} * @memberof SecurityPostureManagementApiGetSecurityFindings */ readonly pageCursor?: string /** * Number of results per page * @type {number} * @memberof SecurityPostureManagementApiGetSecurityFindings */ readonly pageSize?: number /** * Filter by severity level * @type {'INFO' | 'LOW' | 'MEDIUM' | 'HIGH'} * @memberof SecurityPostureManagementApiGetSecurityFindings */ readonly severity?: GetSecurityFindingsSeverityEnum /** * Filter by finding category * @type {'USER_MANAGEMENT' | 'APPROVAL_GROUP_MANAGEMENT' | 'POLICY_ENGINE_UTILIZATION' | 'WORKSPACE_CONFIGURATION' | 'DEFI_ACCESS' | 'FLEET_MANAGEMENT'} * @memberof SecurityPostureManagementApiGetSecurityFindings */ readonly category?: GetSecurityFindingsCategoryEnum /** * Filter by finding status * @type {'OPEN' | 'ACCEPTED' | 'RESOLVED'} * @memberof SecurityPostureManagementApiGetSecurityFindings */ readonly status?: GetSecurityFindingsStatusEnum } /** * Request parameters for updateSecurityFindingById operation in SecurityPostureManagementApi. * @export * @interface SecurityPostureManagementApiUpdateSecurityFindingByIdRequest */ export interface SecurityPostureManagementApiUpdateSecurityFindingByIdRequest { /** * * @type {UpdateFindingExternalRequest} * @memberof SecurityPostureManagementApiUpdateSecurityFindingById */ readonly updateFindingExternalRequest: UpdateFindingExternalRequest /** * Unique identifier of the finding * @type {string} * @memberof SecurityPostureManagementApiUpdateSecurityFindingById */ readonly id: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof SecurityPostureManagementApiUpdateSecurityFindingById */ readonly idempotencyKey?: string } /** * SecurityPostureManagementApi - object-oriented interface * @export * @class SecurityPostureManagementApi * @extends {BaseAPI} */ export class SecurityPostureManagementApi extends BaseAPI { /** * Returns a single FSPM security finding for the workspace, redacted to the public field set. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get a FSPM security finding by ID * @param {SecurityPostureManagementApiGetSecurityFindingByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SecurityPostureManagementApi */ public getSecurityFindingById(requestParameters: SecurityPostureManagementApiGetSecurityFindingByIdRequest) { return SecurityPostureManagementApiFp(this.configuration).getSecurityFindingById(requestParameters.id).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a paginated list of FSPM security findings for the workspace. Endpoint Roles: Security Admin, Security Auditor. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Get FSPM security findings * @param {SecurityPostureManagementApiGetSecurityFindingsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SecurityPostureManagementApi */ public getSecurityFindings(requestParameters: SecurityPostureManagementApiGetSecurityFindingsRequest = {}) { return SecurityPostureManagementApiFp(this.configuration).getSecurityFindings(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.severity, requestParameters.category, requestParameters.status).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Accepts or reopens a finding for the workspace. When accepting a finding (`status: \"ACCEPTED\"`), `statusUpdatedReason` is required. Endpoint Roles: Security Admin. **Note:** This endpoint is available only for the FSPM Pro package. It is not available for FSPM Basic. * @summary Update a FSPM security finding by ID * @param {SecurityPostureManagementApiUpdateSecurityFindingByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SecurityPostureManagementApi */ public updateSecurityFindingById(requestParameters: SecurityPostureManagementApiUpdateSecurityFindingByIdRequest) { return SecurityPostureManagementApiFp(this.configuration).updateSecurityFindingById(requestParameters.updateFindingExternalRequest, requestParameters.id, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetSecurityFindingsSeverityEnum = { Info: 'INFO', Low: 'LOW', Medium: 'MEDIUM', High: 'HIGH' } as const; export type GetSecurityFindingsSeverityEnum = typeof GetSecurityFindingsSeverityEnum[keyof typeof GetSecurityFindingsSeverityEnum]; /** * @export */ export const GetSecurityFindingsCategoryEnum = { UserManagement: 'USER_MANAGEMENT', ApprovalGroupManagement: 'APPROVAL_GROUP_MANAGEMENT', PolicyEngineUtilization: 'POLICY_ENGINE_UTILIZATION', WorkspaceConfiguration: 'WORKSPACE_CONFIGURATION', DefiAccess: 'DEFI_ACCESS', FleetManagement: 'FLEET_MANAGEMENT' } as const; export type GetSecurityFindingsCategoryEnum = typeof GetSecurityFindingsCategoryEnum[keyof typeof GetSecurityFindingsCategoryEnum]; /** * @export */ export const GetSecurityFindingsStatusEnum = { Open: 'OPEN', Accepted: 'ACCEPTED', Resolved: 'RESOLVED' } as const; export type GetSecurityFindingsStatusEnum = typeof GetSecurityFindingsStatusEnum[keyof typeof GetSecurityFindingsStatusEnum];