/* 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 { CreateReportRequest } from '../models'; // @ts-ignore import { CreateReportResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ReportConflictResponse } from '../models'; // @ts-ignore import { ReportJobResponse } from '../models'; // @ts-ignore import { ReportListResponse } from '../models'; // @ts-ignore import { ReportStatus } from '../models'; // @ts-ignore import { ReportType } from '../models'; /** * ReportsBetaApi - axios parameter creator * @export */ export const ReportsBetaApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Creates a new asynchronous report job and returns a receipt containing the report ID. Poll `GET /v1/reports/{reportId}` to check status. When `status` is `COMPLETED`, the poll response includes a fresh pre-signed download URL in `links.downloadUrl`. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Create a report * @param {CreateReportRequest} createReportRequest * @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} */ createReport: async (createReportRequest: CreateReportRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createReport', 'createReportRequest', createReportRequest) const localVarPath = `/reports`; // 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, ...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 = 'createReport'; 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(createReportRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the current status of a report job. Check the `status` field to determine the outcome. When `status` is `COMPLETED`, the response includes a fresh pre-signed download URL in `links.downloadUrl` (TTL ~1 hour). Re-poll this endpoint to obtain a new URL after expiry. When `status` is `FAILED`, the `failedAt` timestamp indicates when the failure occurred. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Get report status * @param {string} reportId The unique identifier of the report job * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReport: async (reportId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getReport', 'reportId', reportId) const localVarPath = `/reports/{reportId}` .replace(`{${"reportId"}}`, encodeURIComponent(String(reportId))); // 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 = 'getReport'; 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 report jobs scoped to the calling tenant. **Note:** Download URLs are not included in list responses. Call `GET /v1/reports/{reportId}` to obtain a fresh signed download URL for a specific completed report. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary List reports * @param {string} [pageCursor] Opaque cursor returned from a previous list call * @param {number} [pageSize] Maximum number of items per page * @param {ListReportsSortByEnum} [sortBy] Field to sort by * @param {ListReportsOrderEnum} [order] Sort direction * @param {Array} [status] Filter by lifecycle status. Repeat the parameter to filter on multiple statuses (e.g., ?status=QUEUED&status=PROCESSING). * @param {Array} [reportType] Filter by report type. Repeat the parameter to filter on multiple types. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReports: async (pageCursor?: string, pageSize?: number, sortBy?: ListReportsSortByEnum, order?: ListReportsOrderEnum, status?: Array, reportType?: Array, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/reports`; // 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 = 'listReports'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (status) { localVarQueryParameter['status'] = status; } if (reportType) { localVarQueryParameter['reportType'] = reportType; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ReportsBetaApi - functional programming interface * @export */ export const ReportsBetaApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ReportsBetaApiAxiosParamCreator(configuration) return { /** * Creates a new asynchronous report job and returns a receipt containing the report ID. Poll `GET /v1/reports/{reportId}` to check status. When `status` is `COMPLETED`, the poll response includes a fresh pre-signed download URL in `links.downloadUrl`. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Create a report * @param {CreateReportRequest} createReportRequest * @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 createReport(createReportRequest: CreateReportRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createReport(createReportRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ReportsBetaApi.createReport']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the current status of a report job. Check the `status` field to determine the outcome. When `status` is `COMPLETED`, the response includes a fresh pre-signed download URL in `links.downloadUrl` (TTL ~1 hour). Re-poll this endpoint to obtain a new URL after expiry. When `status` is `FAILED`, the `failedAt` timestamp indicates when the failure occurred. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Get report status * @param {string} reportId The unique identifier of the report job * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getReport(reportId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getReport(reportId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ReportsBetaApi.getReport']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a paginated list of report jobs scoped to the calling tenant. **Note:** Download URLs are not included in list responses. Call `GET /v1/reports/{reportId}` to obtain a fresh signed download URL for a specific completed report. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary List reports * @param {string} [pageCursor] Opaque cursor returned from a previous list call * @param {number} [pageSize] Maximum number of items per page * @param {ListReportsSortByEnum} [sortBy] Field to sort by * @param {ListReportsOrderEnum} [order] Sort direction * @param {Array} [status] Filter by lifecycle status. Repeat the parameter to filter on multiple statuses (e.g., ?status=QUEUED&status=PROCESSING). * @param {Array} [reportType] Filter by report type. Repeat the parameter to filter on multiple types. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listReports(pageCursor?: string, pageSize?: number, sortBy?: ListReportsSortByEnum, order?: ListReportsOrderEnum, status?: Array, reportType?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listReports(pageCursor, pageSize, sortBy, order, status, reportType, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ReportsBetaApi.listReports']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * ReportsBetaApi - factory interface * @export */ export const ReportsBetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ReportsBetaApiFp(configuration) return { /** * Creates a new asynchronous report job and returns a receipt containing the report ID. Poll `GET /v1/reports/{reportId}` to check status. When `status` is `COMPLETED`, the poll response includes a fresh pre-signed download URL in `links.downloadUrl`. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Create a report * @param {ReportsBetaApiCreateReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createReport(requestParameters: ReportsBetaApiCreateReportRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createReport(requestParameters.createReportRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Returns the current status of a report job. Check the `status` field to determine the outcome. When `status` is `COMPLETED`, the response includes a fresh pre-signed download URL in `links.downloadUrl` (TTL ~1 hour). Re-poll this endpoint to obtain a new URL after expiry. When `status` is `FAILED`, the `failedAt` timestamp indicates when the failure occurred. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Get report status * @param {ReportsBetaApiGetReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getReport(requestParameters: ReportsBetaApiGetReportRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getReport(requestParameters.reportId, options).then((request) => request(axios, basePath)); }, /** * Returns a paginated list of report jobs scoped to the calling tenant. **Note:** Download URLs are not included in list responses. Call `GET /v1/reports/{reportId}` to obtain a fresh signed download URL for a specific completed report. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary List reports * @param {ReportsBetaApiListReportsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listReports(requestParameters: ReportsBetaApiListReportsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listReports(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sortBy, requestParameters.order, requestParameters.status, requestParameters.reportType, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createReport operation in ReportsBetaApi. * @export * @interface ReportsBetaApiCreateReportRequest */ export interface ReportsBetaApiCreateReportRequest { /** * * @type {CreateReportRequest} * @memberof ReportsBetaApiCreateReport */ readonly createReportRequest: CreateReportRequest /** * 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 ReportsBetaApiCreateReport */ readonly idempotencyKey?: string } /** * Request parameters for getReport operation in ReportsBetaApi. * @export * @interface ReportsBetaApiGetReportRequest */ export interface ReportsBetaApiGetReportRequest { /** * The unique identifier of the report job * @type {string} * @memberof ReportsBetaApiGetReport */ readonly reportId: string } /** * Request parameters for listReports operation in ReportsBetaApi. * @export * @interface ReportsBetaApiListReportsRequest */ export interface ReportsBetaApiListReportsRequest { /** * Opaque cursor returned from a previous list call * @type {string} * @memberof ReportsBetaApiListReports */ readonly pageCursor?: string /** * Maximum number of items per page * @type {number} * @memberof ReportsBetaApiListReports */ readonly pageSize?: number /** * Field to sort by * @type {'createdAt' | 'completedAt'} * @memberof ReportsBetaApiListReports */ readonly sortBy?: ListReportsSortByEnum /** * Sort direction * @type {'ASC' | 'DESC'} * @memberof ReportsBetaApiListReports */ readonly order?: ListReportsOrderEnum /** * Filter by lifecycle status. Repeat the parameter to filter on multiple statuses (e.g., ?status=QUEUED&status=PROCESSING). * @type {Array} * @memberof ReportsBetaApiListReports */ readonly status?: Array /** * Filter by report type. Repeat the parameter to filter on multiple types. * @type {Array} * @memberof ReportsBetaApiListReports */ readonly reportType?: Array } /** * ReportsBetaApi - object-oriented interface * @export * @class ReportsBetaApi * @extends {BaseAPI} */ export class ReportsBetaApi extends BaseAPI { /** * Creates a new asynchronous report job and returns a receipt containing the report ID. Poll `GET /v1/reports/{reportId}` to check status. When `status` is `COMPLETED`, the poll response includes a fresh pre-signed download URL in `links.downloadUrl`. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Create a report * @param {ReportsBetaApiCreateReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsBetaApi */ public createReport(requestParameters: ReportsBetaApiCreateReportRequest) { return ReportsBetaApiFp(this.configuration).createReport(requestParameters.createReportRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the current status of a report job. Check the `status` field to determine the outcome. When `status` is `COMPLETED`, the response includes a fresh pre-signed download URL in `links.downloadUrl` (TTL ~1 hour). Re-poll this endpoint to obtain a new URL after expiry. When `status` is `FAILED`, the `failedAt` timestamp indicates when the failure occurred. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary Get report status * @param {ReportsBetaApiGetReportRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsBetaApi */ public getReport(requestParameters: ReportsBetaApiGetReportRequest) { return ReportsBetaApiFp(this.configuration).getReport(requestParameters.reportId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a paginated list of report jobs scoped to the calling tenant. **Note:** Download URLs are not included in list responses. Call `GET /v1/reports/{reportId}` to obtain a fresh signed download URL for a specific completed report. **Note:** These endpoints are currently in beta and might be subject to changes. Endpoint Permission: Viewer and above. * @summary List reports * @param {ReportsBetaApiListReportsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ReportsBetaApi */ public listReports(requestParameters: ReportsBetaApiListReportsRequest = {}) { return ReportsBetaApiFp(this.configuration).listReports(requestParameters.pageCursor, requestParameters.pageSize, requestParameters.sortBy, requestParameters.order, requestParameters.status, requestParameters.reportType).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const ListReportsSortByEnum = { CreatedAt: 'createdAt', CompletedAt: 'completedAt' } as const; export type ListReportsSortByEnum = typeof ListReportsSortByEnum[keyof typeof ListReportsSortByEnum]; /** * @export */ export const ListReportsOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type ListReportsOrderEnum = typeof ListReportsOrderEnum[keyof typeof ListReportsOrderEnum];