/* 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 { CreateWebhookMtlsConfigRequest } from '../models'; // @ts-ignore import { CreateWebhookOauthRequest } from '../models'; // @ts-ignore import { CreateWebhookRequest } from '../models'; // @ts-ignore import { DeleteWebhookMtlsConfigResponse } from '../models'; // @ts-ignore import { DeleteWebhookOauthResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { NotificationAttemptsPaginatedResponse } from '../models'; // @ts-ignore import { NotificationPaginatedResponse } from '../models'; // @ts-ignore import { NotificationStatus } from '../models'; // @ts-ignore import { NotificationWithData } from '../models'; // @ts-ignore import { ResendByQueryRequest } from '../models'; // @ts-ignore import { ResendByQueryResponse } from '../models'; // @ts-ignore import { ResendFailedNotificationsJobStatusResponse } from '../models'; // @ts-ignore import { ResendFailedNotificationsRequest } from '../models'; // @ts-ignore import { ResendFailedNotificationsResponse } from '../models'; // @ts-ignore import { ResendNotificationsByResourceIdRequest } from '../models'; // @ts-ignore import { UpdateWebhookMtlsConfigRequest } from '../models'; // @ts-ignore import { UpdateWebhookOauthRequest } from '../models'; // @ts-ignore import { UpdateWebhookRequest } from '../models'; // @ts-ignore import { Webhook } from '../models'; // @ts-ignore import { WebhookEvent } from '../models'; // @ts-ignore import { WebhookMetric } from '../models'; // @ts-ignore import { WebhookMtlsConfig } from '../models'; // @ts-ignore import { WebhookMtlsConfigsList } from '../models'; // @ts-ignore import { WebhookMtlsCsrResponse } from '../models'; // @ts-ignore import { WebhookOauthCredentials } from '../models'; // @ts-ignore import { WebhookOauthList } from '../models'; // @ts-ignore import { WebhookPaginatedResponse } from '../models'; /** * WebhooksV2Api - axios parameter creator * @export */ export const WebhooksV2ApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Creates a new webhook, which will be triggered on the specified events **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create a new webhook * @param {CreateWebhookRequest} createWebhookRequest * @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} */ createWebhook: async (createWebhookRequest: CreateWebhookRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createWebhook', 'createWebhookRequest', createWebhookRequest) const localVarPath = `/webhooks`; // 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 = 'createWebhook'; 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(createWebhookRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Stores a certificate signed against the CSR from `GET /v1/webhooks_settings/mtls_csr` and returns its id, which is then set as `webhookMtlsId` on a webhook or on OAuth credentials. The private key the certificate was issued for is derived from the certificate, so it is never named by the caller. Re-uploading a certificate already stored returns the existing id rather than creating a second configuration, so several webhooks and OAuth credentials can share one certificate. A certificate that was not issued for a private key this workspace holds is rejected with a `400`. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create an mTLS configuration * @param {CreateWebhookMtlsConfigRequest} createWebhookMtlsConfigRequest * @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} */ createWebhookMtlsConfig: async (createWebhookMtlsConfigRequest: CreateWebhookMtlsConfigRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createWebhookMtlsConfig', 'createWebhookMtlsConfigRequest', createWebhookMtlsConfigRequest) const localVarPath = `/webhooks_settings/mtls`; // 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 = 'createWebhookMtlsConfig'; 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(createWebhookMtlsConfigRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Creates a reusable OAuth client credential set. Attach it to a webhook by passing the returned id as that webhook\'s `webhookOauthId`. Several webhooks may share one credential set, so rotating its client secret covers all of them at once. The client secret is write-only and is never returned. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create OAuth credentials * @param {CreateWebhookOauthRequest} createWebhookOauthRequest * @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} */ createWebhookOauth: async (createWebhookOauthRequest: CreateWebhookOauthRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createWebhookOauth', 'createWebhookOauthRequest', createWebhookOauthRequest) const localVarPath = `/webhooks_settings/oauth`; // 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 = 'createWebhookOauth'; 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(createWebhookOauthRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Delete webhook * @param {string} webhookId The unique identifier of the webhook * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhook: async (webhookId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteWebhook', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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, ...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 = 'deleteWebhook'; 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, }; }, /** * Deletes an mTLS configuration. By default the delete is refused while the configuration is still in use: if any webhook or OAuth credentials reference it, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of what references it. This protects a shared configuration from being removed out from under the webhooks and token requests that depend on it. Pass `forceDelete=true` to delete anyway. That detaches everything referencing it — it clears `webhookMtlsId` on each webhook and OAuth credentials, it does **not** delete them — then deletes the configuration and returns the deleted resource together with `detachedWebhookIds` and `detachedWebhookOauthIds`. Detached webhooks keep delivering notifications, and detached OAuth credentials keep requesting tokens, but without a client certificate, so an endpoint that requires mTLS will reject them from that point on. When nothing references the configuration the delete succeeds either way, and both lists come back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete an mTLS configuration * @param {string} webhookMtlsId The unique identifier of the mTLS configuration * @param {boolean} [forceDelete] Delete the configuration even while webhooks or OAuth credentials still reference it, detaching them instead of refusing; their ids are returned in `detachedWebhookIds` and `detachedWebhookOauthIds`. Leave it unset, or `false`, to get a `409 Conflict` whenever anything still references the configuration. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhookMtlsConfig: async (webhookMtlsId: string, forceDelete?: boolean, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteWebhookMtlsConfig', 'webhookMtlsId', webhookMtlsId) const localVarPath = `/webhooks_settings/mtls/{webhookMtlsId}` .replace(`{${"webhookMtlsId"}}`, encodeURIComponent(String(webhookMtlsId))); // 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, ...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 = 'deleteWebhookMtlsConfig'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (forceDelete !== undefined) { localVarQueryParameter['forceDelete'] = forceDelete; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Deletes an OAuth credential set. By default the delete is refused while the credentials are still in use: if any webhook references them, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of the referencing webhooks. This protects a shared credential set from being removed out from under the webhooks that depend on it, since several webhooks may reference the same one. Pass `forceDelete=true` to delete anyway. That detaches every referencing webhook — it clears each webhook\'s `webhookOauthId`, it does **not** delete the webhook — then deletes the credential set and returns the deleted resource together with `detachedWebhookIds`. The detached webhooks keep delivering notifications, but without an `Authorization` header, so their endpoints will see unauthenticated deliveries from that point on. When nothing references the credentials the delete succeeds either way, and `detachedWebhookIds` comes back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete OAuth credentials * @param {string} webhookOauthId The unique identifier of the OAuth credentials * @param {boolean} [forceDelete] Delete the credentials even while webhooks still reference them, detaching those webhooks instead of refusing. Leave it unset, or `false`, to get a `409 Conflict` whenever anything still references the credentials. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhookOauth: async (webhookOauthId: string, forceDelete?: boolean, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteWebhookOauth', 'webhookOauthId', webhookOauthId) const localVarPath = `/webhooks_settings/oauth/{webhookOauthId}` .replace(`{${"webhookOauthId"}}`, encodeURIComponent(String(webhookOauthId))); // 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, ...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 = 'deleteWebhookOauth'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (forceDelete !== undefined) { localVarQueryParameter['forceDelete'] = forceDelete; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get webhook metrics by webhook id and metric name * @summary Get webhook metrics * @param {string} webhookId * @param {GetMetricsMetricNameEnum} metricName Name of the metric to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetrics: async (webhookId: string, metricName: GetMetricsMetricNameEnum, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getMetrics', 'webhookId', webhookId) assertParamExistsAndNotEmpty('getMetrics', 'metricName', metricName) const localVarPath = `/webhooks/{webhookId}/metrics/{metricName}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))) .replace(`{${"metricName"}}`, encodeURIComponent(String(metricName))); // 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 = 'getMetrics'; 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 the Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate. The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Get mTLS CSR * @param {GetMtlsCsrKeyAlgorithmEnum} [keyAlgorithm] Algorithm of the private key the CSR is generated for. ECDSA keys are smaller and quicker to issue, but the certificate authority signing the request has to accept an EC subject key, which some do not by default. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMtlsCsr: async (keyAlgorithm?: GetMtlsCsrKeyAlgorithmEnum, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/webhooks_settings/mtls_csr`; // 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 = 'getMtlsCsr'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (keyAlgorithm !== undefined) { localVarQueryParameter['keyAlgorithm'] = keyAlgorithm; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get notification by id * @summary Get notification by id * @param {string} webhookId The ID of the webhook to fetch * @param {string} notificationId The ID of the notification to fetch * @param {boolean} [includeData] Include the data of the notification * @param {*} [options] Override http request option. * @throws {RequiredError} */ getNotification: async (webhookId: string, notificationId: string, includeData?: boolean, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getNotification', 'webhookId', webhookId) assertParamExistsAndNotEmpty('getNotification', 'notificationId', notificationId) const localVarPath = `/webhooks/{webhookId}/notifications/{notificationId}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))) .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId))); // 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 = 'getNotification'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (includeData !== undefined) { localVarQueryParameter['includeData'] = includeData; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get notification attempts by notification id * @summary Get notification attempts * @param {string} webhookId The ID of the webhook to fetch * @param {string} notificationId The ID of the notification to fetch * @param {string} [pageCursor] Cursor of the required page * @param {number} [pageSize] Maximum number of items in the page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getNotificationAttempts: async (webhookId: string, notificationId: string, pageCursor?: string, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getNotificationAttempts', 'webhookId', webhookId) assertParamExistsAndNotEmpty('getNotificationAttempts', 'notificationId', notificationId) const localVarPath = `/webhooks/{webhookId}/notifications/{notificationId}/attempts` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))) .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId))); // 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 = 'getNotificationAttempts'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get all notifications by webhook id (paginated) * @summary Get all notifications by webhook id * @param {string} webhookId * @param {GetNotificationsOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {GetNotificationsSortByEnum} [sortBy] Sort by field * @param {string} [pageCursor] Cursor of the required page * @param {number} [pageSize] Maximum number of items in the page * @param {number} [startTime] Start time in milliseconds since epoch to filter by notifications created after this time (default 31 days ago) * @param {number} [endTime] End time in milliseconds since epoch to filter by notifications created before this time (default current time) * @param {Array} [statuses] List of notification statuses to filter by * @param {Array} [events] List of webhook event types to filter by * @param {string} [resourceId] Resource ID to filter by * @param {*} [options] Override http request option. * @throws {RequiredError} */ getNotifications: async (webhookId: string, order?: GetNotificationsOrderEnum, sortBy?: GetNotificationsSortByEnum, pageCursor?: string, pageSize?: number, startTime?: number, endTime?: number, statuses?: Array, events?: Array, resourceId?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getNotifications', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}/notifications` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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 = 'getNotifications'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (order !== undefined) { localVarQueryParameter['order'] = order; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (startTime !== undefined) { localVarQueryParameter['startTime'] = startTime; } if (endTime !== undefined) { localVarQueryParameter['endTime'] = endTime; } if (statuses) { localVarQueryParameter['statuses'] = statuses; } if (events) { localVarQueryParameter['events'] = events; } if (resourceId !== undefined) { localVarQueryParameter['resourceId'] = resourceId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get the status of a resend by query job * @summary Get resend by query job status * @param {string} webhookId The ID of the webhook * @param {string} jobId The ID of the resend job * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResendByQueryJobStatus: async (webhookId: string, jobId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getResendByQueryJobStatus', 'webhookId', webhookId) assertParamExistsAndNotEmpty('getResendByQueryJobStatus', 'jobId', jobId) const localVarPath = `/webhooks/{webhookId}/notifications/resend_by_query/jobs/{jobId}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))) .replace(`{${"jobId"}}`, encodeURIComponent(String(jobId))); // 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 = 'getResendByQueryJobStatus'; 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, }; }, /** * Get the status of a resend job * @summary Get resend job status * @param {string} webhookId The ID of the webhook * @param {string} jobId The ID of the resend job * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResendJobStatus: async (webhookId: string, jobId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getResendJobStatus', 'webhookId', webhookId) assertParamExistsAndNotEmpty('getResendJobStatus', 'jobId', jobId) const localVarPath = `/webhooks/{webhookId}/notifications/resend_failed/jobs/{jobId}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))) .replace(`{${"jobId"}}`, encodeURIComponent(String(jobId))); // 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 = 'getResendJobStatus'; 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, }; }, /** * Retrieve a webhook by its id * @summary Get webhook by id * @param {string} webhookId The unique identifier of the webhook * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhook: async (webhookId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getWebhook', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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 = 'getWebhook'; 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, }; }, /** * Retrieve one stored mTLS configuration by its id. * @summary Get an mTLS configuration by id * @param {string} webhookMtlsId The unique identifier of the mTLS configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookMtlsConfig: async (webhookMtlsId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getWebhookMtlsConfig', 'webhookMtlsId', webhookMtlsId) const localVarPath = `/webhooks_settings/mtls/{webhookMtlsId}` .replace(`{${"webhookMtlsId"}}`, encodeURIComponent(String(webhookMtlsId))); // 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 = 'getWebhookMtlsConfig'; 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, }; }, /** * Lists the workspace\'s mTLS configurations, newest first. Pass `ids` to ask about particular ones instead — useful for resolving the `webhookMtlsId` values on a set of webhooks in one call. * @summary List the uploaded mTLS configurations * @param {Array} [ids] Return only the configurations with these ids, instead of all of them. Repeat the parameter for each id. An id belonging to another workspace, or to nothing, is left out of the response rather than failing the request. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookMtlsConfigs: async (ids?: Array, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/webhooks_settings/mtls`; // 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 = 'getWebhookMtlsConfigs'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (ids) { localVarQueryParameter['ids'] = ids; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve an OAuth credential set by its id. The client secret is never returned. * @summary Get OAuth credentials by id * @param {string} webhookOauthId The unique identifier of the OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookOauth: async (webhookOauthId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getWebhookOauth', 'webhookOauthId', webhookOauthId) const localVarPath = `/webhooks_settings/oauth/{webhookOauthId}` .replace(`{${"webhookOauthId"}}`, encodeURIComponent(String(webhookOauthId))); // 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 = 'getWebhookOauth'; 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, }; }, /** * Lists every OAuth credential set for the workspace. Client secrets are never returned. * @summary Get all OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookOauths: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/webhooks_settings/oauth`; // 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 = 'getWebhookOauths'; 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, }; }, /** * Get all webhooks (paginated). * @summary Get all webhooks * @param {GetWebhooksOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {string} [pageCursor] Cursor of the required page * @param {number} [pageSize] Maximum number of items in the page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhooks: async (order?: GetWebhooksOrderEnum, pageCursor?: string, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/webhooks`; // 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 = 'getWebhooks'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (order !== undefined) { localVarQueryParameter['order'] = order; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Resend all failed notifications for a webhook in the last 24 hours Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend failed notifications * @param {ResendFailedNotificationsRequest} resendFailedNotificationsRequest * @param {string} webhookId The ID of the webhook * @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} */ resendFailedNotifications: async (resendFailedNotificationsRequest: ResendFailedNotificationsRequest, webhookId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('resendFailedNotifications', 'resendFailedNotificationsRequest', resendFailedNotificationsRequest) assertParamExistsAndNotEmpty('resendFailedNotifications', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}/notifications/resend_failed` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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 = 'resendFailedNotifications'; 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(resendFailedNotificationsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Resend notification by ID Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notification by id * @param {string} webhookId The ID of the webhook * @param {string} notificationId The ID of the notification * @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} */ resendNotificationById: async (webhookId: string, notificationId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('resendNotificationById', 'webhookId', webhookId) assertParamExistsAndNotEmpty('resendNotificationById', 'notificationId', notificationId) const localVarPath = `/webhooks/{webhookId}/notifications/{notificationId}/resend` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))) .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId))); // 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 = 'resendNotificationById'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Resend notifications matching the given query filters (statuses, events, time range, resource ID) Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by query * @param {ResendByQueryRequest} resendByQueryRequest * @param {string} webhookId The ID of the webhook * @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} */ resendNotificationsByQuery: async (resendByQueryRequest: ResendByQueryRequest, webhookId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('resendNotificationsByQuery', 'resendByQueryRequest', resendByQueryRequest) assertParamExistsAndNotEmpty('resendNotificationsByQuery', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}/notifications/resend_by_query` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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 = 'resendNotificationsByQuery'; 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(resendByQueryRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Resend notifications by resource Id Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by resource Id * @param {ResendNotificationsByResourceIdRequest} resendNotificationsByResourceIdRequest * @param {string} webhookId The ID of the webhook * @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} */ resendNotificationsByResourceId: async (resendNotificationsByResourceIdRequest: ResendNotificationsByResourceIdRequest, webhookId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('resendNotificationsByResourceId', 'resendNotificationsByResourceIdRequest', resendNotificationsByResourceIdRequest) assertParamExistsAndNotEmpty('resendNotificationsByResourceId', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}/notifications/resend_by_resource` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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 = 'resendNotificationsByResourceId'; 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(resendNotificationsByResourceIdRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Update webhook * @param {UpdateWebhookRequest} updateWebhookRequest * @param {string} webhookId The unique identifier of the webhook * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhook: async (updateWebhookRequest: UpdateWebhookRequest, webhookId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateWebhook', 'updateWebhookRequest', updateWebhookRequest) assertParamExistsAndNotEmpty('updateWebhook', 'webhookId', webhookId) const localVarPath = `/webhooks/{webhookId}` .replace(`{${"webhookId"}}`, encodeURIComponent(String(webhookId))); // 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 = 'updateWebhook'; 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, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateWebhookRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Renames a configuration, replaces its certificate, or both. Only the fields present in the request are changed; anything omitted is left as it is, and a request with neither field is rejected with a `400`. Replacing `signedCert` switches every webhook and OAuth credentials set using this configuration over to the new certificate in one write, and the private key it was issued for is re-derived from the certificate. A replacement that was not issued for a private key this workspace holds is rejected with a `400`. Sending `name: null` removes the label. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update an mTLS configuration * @param {UpdateWebhookMtlsConfigRequest} updateWebhookMtlsConfigRequest * @param {string} webhookMtlsId The unique identifier of the mTLS configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookMtlsConfig: async (updateWebhookMtlsConfigRequest: UpdateWebhookMtlsConfigRequest, webhookMtlsId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateWebhookMtlsConfig', 'updateWebhookMtlsConfigRequest', updateWebhookMtlsConfigRequest) assertParamExistsAndNotEmpty('updateWebhookMtlsConfig', 'webhookMtlsId', webhookMtlsId) const localVarPath = `/webhooks_settings/mtls/{webhookMtlsId}` .replace(`{${"webhookMtlsId"}}`, encodeURIComponent(String(webhookMtlsId))); // 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 = 'updateWebhookMtlsConfig'; 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, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateWebhookMtlsConfigRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Updates only the fields present in the request; anything omitted is left as it is. Sending `clientSecret` on its own rotates the secret for every webhook using these credentials. `customJwtClaims`, `customBodyParams` and `customHeaders` are all merged key by key rather than replaced, the same way a webhook\'s own `customHeaders` behaves: a key sent with a value is added or overwritten, a key sent with a `null` value is deleted, and a key you omit is left alone. Setting one of the three to `null` as a whole clears that map, which is the quick way to empty it without naming every key. There is no ambiguity between the two uses of `null` — one names an entry to delete, the other names the field. A claim cannot be set to JSON `null`, though, on this endpoint or on create, because `null` is spent on deletion. `webhookMtlsId` is a scalar rather than a map, so `null` there does remove it. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update OAuth credentials * @param {UpdateWebhookOauthRequest} updateWebhookOauthRequest * @param {string} webhookOauthId The unique identifier of the OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookOauth: async (updateWebhookOauthRequest: UpdateWebhookOauthRequest, webhookOauthId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateWebhookOauth', 'updateWebhookOauthRequest', updateWebhookOauthRequest) assertParamExistsAndNotEmpty('updateWebhookOauth', 'webhookOauthId', webhookOauthId) const localVarPath = `/webhooks_settings/oauth/{webhookOauthId}` .replace(`{${"webhookOauthId"}}`, encodeURIComponent(String(webhookOauthId))); // 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 = 'updateWebhookOauth'; 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, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateWebhookOauthRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * WebhooksV2Api - functional programming interface * @export */ export const WebhooksV2ApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = WebhooksV2ApiAxiosParamCreator(configuration) return { /** * Creates a new webhook, which will be triggered on the specified events **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create a new webhook * @param {CreateWebhookRequest} createWebhookRequest * @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 createWebhook(createWebhookRequest: CreateWebhookRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createWebhook(createWebhookRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.createWebhook']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Stores a certificate signed against the CSR from `GET /v1/webhooks_settings/mtls_csr` and returns its id, which is then set as `webhookMtlsId` on a webhook or on OAuth credentials. The private key the certificate was issued for is derived from the certificate, so it is never named by the caller. Re-uploading a certificate already stored returns the existing id rather than creating a second configuration, so several webhooks and OAuth credentials can share one certificate. A certificate that was not issued for a private key this workspace holds is rejected with a `400`. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create an mTLS configuration * @param {CreateWebhookMtlsConfigRequest} createWebhookMtlsConfigRequest * @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 createWebhookMtlsConfig(createWebhookMtlsConfigRequest: CreateWebhookMtlsConfigRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createWebhookMtlsConfig(createWebhookMtlsConfigRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.createWebhookMtlsConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Creates a reusable OAuth client credential set. Attach it to a webhook by passing the returned id as that webhook\'s `webhookOauthId`. Several webhooks may share one credential set, so rotating its client secret covers all of them at once. The client secret is write-only and is never returned. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create OAuth credentials * @param {CreateWebhookOauthRequest} createWebhookOauthRequest * @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 createWebhookOauth(createWebhookOauthRequest: CreateWebhookOauthRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createWebhookOauth(createWebhookOauthRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.createWebhookOauth']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Delete a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Delete webhook * @param {string} webhookId The unique identifier of the webhook * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteWebhook(webhookId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(webhookId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.deleteWebhook']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Deletes an mTLS configuration. By default the delete is refused while the configuration is still in use: if any webhook or OAuth credentials reference it, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of what references it. This protects a shared configuration from being removed out from under the webhooks and token requests that depend on it. Pass `forceDelete=true` to delete anyway. That detaches everything referencing it — it clears `webhookMtlsId` on each webhook and OAuth credentials, it does **not** delete them — then deletes the configuration and returns the deleted resource together with `detachedWebhookIds` and `detachedWebhookOauthIds`. Detached webhooks keep delivering notifications, and detached OAuth credentials keep requesting tokens, but without a client certificate, so an endpoint that requires mTLS will reject them from that point on. When nothing references the configuration the delete succeeds either way, and both lists come back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete an mTLS configuration * @param {string} webhookMtlsId The unique identifier of the mTLS configuration * @param {boolean} [forceDelete] Delete the configuration even while webhooks or OAuth credentials still reference it, detaching them instead of refusing; their ids are returned in `detachedWebhookIds` and `detachedWebhookOauthIds`. Leave it unset, or `false`, to get a `409 Conflict` whenever anything still references the configuration. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteWebhookMtlsConfig(webhookMtlsId: string, forceDelete?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhookMtlsConfig(webhookMtlsId, forceDelete, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.deleteWebhookMtlsConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Deletes an OAuth credential set. By default the delete is refused while the credentials are still in use: if any webhook references them, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of the referencing webhooks. This protects a shared credential set from being removed out from under the webhooks that depend on it, since several webhooks may reference the same one. Pass `forceDelete=true` to delete anyway. That detaches every referencing webhook — it clears each webhook\'s `webhookOauthId`, it does **not** delete the webhook — then deletes the credential set and returns the deleted resource together with `detachedWebhookIds`. The detached webhooks keep delivering notifications, but without an `Authorization` header, so their endpoints will see unauthenticated deliveries from that point on. When nothing references the credentials the delete succeeds either way, and `detachedWebhookIds` comes back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete OAuth credentials * @param {string} webhookOauthId The unique identifier of the OAuth credentials * @param {boolean} [forceDelete] Delete the credentials even while webhooks still reference them, detaching those webhooks instead of refusing. Leave it unset, or `false`, to get a `409 Conflict` whenever anything still references the credentials. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteWebhookOauth(webhookOauthId: string, forceDelete?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhookOauth(webhookOauthId, forceDelete, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.deleteWebhookOauth']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get webhook metrics by webhook id and metric name * @summary Get webhook metrics * @param {string} webhookId * @param {GetMetricsMetricNameEnum} metricName Name of the metric to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMetrics(webhookId: string, metricName: GetMetricsMetricNameEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getMetrics(webhookId, metricName, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getMetrics']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns the Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate. The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Get mTLS CSR * @param {GetMtlsCsrKeyAlgorithmEnum} [keyAlgorithm] Algorithm of the private key the CSR is generated for. ECDSA keys are smaller and quicker to issue, but the certificate authority signing the request has to accept an EC subject key, which some do not by default. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMtlsCsr(keyAlgorithm?: GetMtlsCsrKeyAlgorithmEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getMtlsCsr(keyAlgorithm, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getMtlsCsr']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get notification by id * @summary Get notification by id * @param {string} webhookId The ID of the webhook to fetch * @param {string} notificationId The ID of the notification to fetch * @param {boolean} [includeData] Include the data of the notification * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getNotification(webhookId: string, notificationId: string, includeData?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getNotification(webhookId, notificationId, includeData, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getNotification']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get notification attempts by notification id * @summary Get notification attempts * @param {string} webhookId The ID of the webhook to fetch * @param {string} notificationId The ID of the notification to fetch * @param {string} [pageCursor] Cursor of the required page * @param {number} [pageSize] Maximum number of items in the page * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getNotificationAttempts(webhookId: string, notificationId: string, pageCursor?: string, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getNotificationAttempts(webhookId, notificationId, pageCursor, pageSize, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getNotificationAttempts']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get all notifications by webhook id (paginated) * @summary Get all notifications by webhook id * @param {string} webhookId * @param {GetNotificationsOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {GetNotificationsSortByEnum} [sortBy] Sort by field * @param {string} [pageCursor] Cursor of the required page * @param {number} [pageSize] Maximum number of items in the page * @param {number} [startTime] Start time in milliseconds since epoch to filter by notifications created after this time (default 31 days ago) * @param {number} [endTime] End time in milliseconds since epoch to filter by notifications created before this time (default current time) * @param {Array} [statuses] List of notification statuses to filter by * @param {Array} [events] List of webhook event types to filter by * @param {string} [resourceId] Resource ID to filter by * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getNotifications(webhookId: string, order?: GetNotificationsOrderEnum, sortBy?: GetNotificationsSortByEnum, pageCursor?: string, pageSize?: number, startTime?: number, endTime?: number, statuses?: Array, events?: Array, resourceId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getNotifications(webhookId, order, sortBy, pageCursor, pageSize, startTime, endTime, statuses, events, resourceId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getNotifications']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get the status of a resend by query job * @summary Get resend by query job status * @param {string} webhookId The ID of the webhook * @param {string} jobId The ID of the resend job * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getResendByQueryJobStatus(webhookId: string, jobId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getResendByQueryJobStatus(webhookId, jobId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getResendByQueryJobStatus']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get the status of a resend job * @summary Get resend job status * @param {string} webhookId The ID of the webhook * @param {string} jobId The ID of the resend job * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getResendJobStatus(webhookId: string, jobId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getResendJobStatus(webhookId, jobId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getResendJobStatus']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve a webhook by its id * @summary Get webhook by id * @param {string} webhookId The unique identifier of the webhook * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhook(webhookId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhook(webhookId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getWebhook']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve one stored mTLS configuration by its id. * @summary Get an mTLS configuration by id * @param {string} webhookMtlsId The unique identifier of the mTLS configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhookMtlsConfig(webhookMtlsId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhookMtlsConfig(webhookMtlsId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getWebhookMtlsConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Lists the workspace\'s mTLS configurations, newest first. Pass `ids` to ask about particular ones instead — useful for resolving the `webhookMtlsId` values on a set of webhooks in one call. * @summary List the uploaded mTLS configurations * @param {Array} [ids] Return only the configurations with these ids, instead of all of them. Repeat the parameter for each id. An id belonging to another workspace, or to nothing, is left out of the response rather than failing the request. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhookMtlsConfigs(ids?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhookMtlsConfigs(ids, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getWebhookMtlsConfigs']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve an OAuth credential set by its id. The client secret is never returned. * @summary Get OAuth credentials by id * @param {string} webhookOauthId The unique identifier of the OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhookOauth(webhookOauthId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhookOauth(webhookOauthId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getWebhookOauth']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Lists every OAuth credential set for the workspace. Client secrets are never returned. * @summary Get all OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhookOauths(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhookOauths(options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getWebhookOauths']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Get all webhooks (paginated). * @summary Get all webhooks * @param {GetWebhooksOrderEnum} [order] ASC / DESC ordering (default DESC) * @param {string} [pageCursor] Cursor of the required page * @param {number} [pageSize] Maximum number of items in the page * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhooks(order?: GetWebhooksOrderEnum, pageCursor?: string, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhooks(order, pageCursor, pageSize, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.getWebhooks']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Resend all failed notifications for a webhook in the last 24 hours Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend failed notifications * @param {ResendFailedNotificationsRequest} resendFailedNotificationsRequest * @param {string} webhookId The ID of the webhook * @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 resendFailedNotifications(resendFailedNotificationsRequest: ResendFailedNotificationsRequest, webhookId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendFailedNotifications(resendFailedNotificationsRequest, webhookId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.resendFailedNotifications']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Resend notification by ID Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notification by id * @param {string} webhookId The ID of the webhook * @param {string} notificationId The ID of the notification * @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 resendNotificationById(webhookId: string, notificationId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendNotificationById(webhookId, notificationId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.resendNotificationById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Resend notifications matching the given query filters (statuses, events, time range, resource ID) Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by query * @param {ResendByQueryRequest} resendByQueryRequest * @param {string} webhookId The ID of the webhook * @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 resendNotificationsByQuery(resendByQueryRequest: ResendByQueryRequest, webhookId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendNotificationsByQuery(resendByQueryRequest, webhookId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.resendNotificationsByQuery']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Resend notifications by resource Id Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by resource Id * @param {ResendNotificationsByResourceIdRequest} resendNotificationsByResourceIdRequest * @param {string} webhookId The ID of the webhook * @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 resendNotificationsByResourceId(resendNotificationsByResourceIdRequest: ResendNotificationsByResourceIdRequest, webhookId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendNotificationsByResourceId(resendNotificationsByResourceIdRequest, webhookId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.resendNotificationsByResourceId']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Update a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Update webhook * @param {UpdateWebhookRequest} updateWebhookRequest * @param {string} webhookId The unique identifier of the webhook * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateWebhook(updateWebhookRequest: UpdateWebhookRequest, webhookId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhook(updateWebhookRequest, webhookId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.updateWebhook']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Renames a configuration, replaces its certificate, or both. Only the fields present in the request are changed; anything omitted is left as it is, and a request with neither field is rejected with a `400`. Replacing `signedCert` switches every webhook and OAuth credentials set using this configuration over to the new certificate in one write, and the private key it was issued for is re-derived from the certificate. A replacement that was not issued for a private key this workspace holds is rejected with a `400`. Sending `name: null` removes the label. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update an mTLS configuration * @param {UpdateWebhookMtlsConfigRequest} updateWebhookMtlsConfigRequest * @param {string} webhookMtlsId The unique identifier of the mTLS configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateWebhookMtlsConfig(updateWebhookMtlsConfigRequest: UpdateWebhookMtlsConfigRequest, webhookMtlsId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookMtlsConfig(updateWebhookMtlsConfigRequest, webhookMtlsId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.updateWebhookMtlsConfig']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Updates only the fields present in the request; anything omitted is left as it is. Sending `clientSecret` on its own rotates the secret for every webhook using these credentials. `customJwtClaims`, `customBodyParams` and `customHeaders` are all merged key by key rather than replaced, the same way a webhook\'s own `customHeaders` behaves: a key sent with a value is added or overwritten, a key sent with a `null` value is deleted, and a key you omit is left alone. Setting one of the three to `null` as a whole clears that map, which is the quick way to empty it without naming every key. There is no ambiguity between the two uses of `null` — one names an entry to delete, the other names the field. A claim cannot be set to JSON `null`, though, on this endpoint or on create, because `null` is spent on deletion. `webhookMtlsId` is a scalar rather than a map, so `null` there does remove it. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update OAuth credentials * @param {UpdateWebhookOauthRequest} updateWebhookOauthRequest * @param {string} webhookOauthId The unique identifier of the OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateWebhookOauth(updateWebhookOauthRequest: UpdateWebhookOauthRequest, webhookOauthId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookOauth(updateWebhookOauthRequest, webhookOauthId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksV2Api.updateWebhookOauth']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * WebhooksV2Api - factory interface * @export */ export const WebhooksV2ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = WebhooksV2ApiFp(configuration) return { /** * Creates a new webhook, which will be triggered on the specified events **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create a new webhook * @param {WebhooksV2ApiCreateWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhook(requestParameters: WebhooksV2ApiCreateWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createWebhook(requestParameters.createWebhookRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Stores a certificate signed against the CSR from `GET /v1/webhooks_settings/mtls_csr` and returns its id, which is then set as `webhookMtlsId` on a webhook or on OAuth credentials. The private key the certificate was issued for is derived from the certificate, so it is never named by the caller. Re-uploading a certificate already stored returns the existing id rather than creating a second configuration, so several webhooks and OAuth credentials can share one certificate. A certificate that was not issued for a private key this workspace holds is rejected with a `400`. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create an mTLS configuration * @param {WebhooksV2ApiCreateWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhookMtlsConfig(requestParameters: WebhooksV2ApiCreateWebhookMtlsConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createWebhookMtlsConfig(requestParameters.createWebhookMtlsConfigRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Creates a reusable OAuth client credential set. Attach it to a webhook by passing the returned id as that webhook\'s `webhookOauthId`. Several webhooks may share one credential set, so rotating its client secret covers all of them at once. The client secret is write-only and is never returned. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create OAuth credentials * @param {WebhooksV2ApiCreateWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createWebhookOauth(requestParameters: WebhooksV2ApiCreateWebhookOauthRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createWebhookOauth(requestParameters.createWebhookOauthRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Delete a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Delete webhook * @param {WebhooksV2ApiDeleteWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhook(requestParameters: WebhooksV2ApiDeleteWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteWebhook(requestParameters.webhookId, options).then((request) => request(axios, basePath)); }, /** * Deletes an mTLS configuration. By default the delete is refused while the configuration is still in use: if any webhook or OAuth credentials reference it, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of what references it. This protects a shared configuration from being removed out from under the webhooks and token requests that depend on it. Pass `forceDelete=true` to delete anyway. That detaches everything referencing it — it clears `webhookMtlsId` on each webhook and OAuth credentials, it does **not** delete them — then deletes the configuration and returns the deleted resource together with `detachedWebhookIds` and `detachedWebhookOauthIds`. Detached webhooks keep delivering notifications, and detached OAuth credentials keep requesting tokens, but without a client certificate, so an endpoint that requires mTLS will reject them from that point on. When nothing references the configuration the delete succeeds either way, and both lists come back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete an mTLS configuration * @param {WebhooksV2ApiDeleteWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhookMtlsConfig(requestParameters: WebhooksV2ApiDeleteWebhookMtlsConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteWebhookMtlsConfig(requestParameters.webhookMtlsId, requestParameters.forceDelete, options).then((request) => request(axios, basePath)); }, /** * Deletes an OAuth credential set. By default the delete is refused while the credentials are still in use: if any webhook references them, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of the referencing webhooks. This protects a shared credential set from being removed out from under the webhooks that depend on it, since several webhooks may reference the same one. Pass `forceDelete=true` to delete anyway. That detaches every referencing webhook — it clears each webhook\'s `webhookOauthId`, it does **not** delete the webhook — then deletes the credential set and returns the deleted resource together with `detachedWebhookIds`. The detached webhooks keep delivering notifications, but without an `Authorization` header, so their endpoints will see unauthenticated deliveries from that point on. When nothing references the credentials the delete succeeds either way, and `detachedWebhookIds` comes back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete OAuth credentials * @param {WebhooksV2ApiDeleteWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteWebhookOauth(requestParameters: WebhooksV2ApiDeleteWebhookOauthRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteWebhookOauth(requestParameters.webhookOauthId, requestParameters.forceDelete, options).then((request) => request(axios, basePath)); }, /** * Get webhook metrics by webhook id and metric name * @summary Get webhook metrics * @param {WebhooksV2ApiGetMetricsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetrics(requestParameters: WebhooksV2ApiGetMetricsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getMetrics(requestParameters.webhookId, requestParameters.metricName, options).then((request) => request(axios, basePath)); }, /** * Returns the Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate. The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Get mTLS CSR * @param {WebhooksV2ApiGetMtlsCsrRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMtlsCsr(requestParameters: WebhooksV2ApiGetMtlsCsrRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getMtlsCsr(requestParameters.keyAlgorithm, options).then((request) => request(axios, basePath)); }, /** * Get notification by id * @summary Get notification by id * @param {WebhooksV2ApiGetNotificationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getNotification(requestParameters: WebhooksV2ApiGetNotificationRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getNotification(requestParameters.webhookId, requestParameters.notificationId, requestParameters.includeData, options).then((request) => request(axios, basePath)); }, /** * Get notification attempts by notification id * @summary Get notification attempts * @param {WebhooksV2ApiGetNotificationAttemptsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getNotificationAttempts(requestParameters: WebhooksV2ApiGetNotificationAttemptsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getNotificationAttempts(requestParameters.webhookId, requestParameters.notificationId, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(axios, basePath)); }, /** * Get all notifications by webhook id (paginated) * @summary Get all notifications by webhook id * @param {WebhooksV2ApiGetNotificationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getNotifications(requestParameters: WebhooksV2ApiGetNotificationsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getNotifications(requestParameters.webhookId, requestParameters.order, requestParameters.sortBy, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.startTime, requestParameters.endTime, requestParameters.statuses, requestParameters.events, requestParameters.resourceId, options).then((request) => request(axios, basePath)); }, /** * Get the status of a resend by query job * @summary Get resend by query job status * @param {WebhooksV2ApiGetResendByQueryJobStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResendByQueryJobStatus(requestParameters: WebhooksV2ApiGetResendByQueryJobStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getResendByQueryJobStatus(requestParameters.webhookId, requestParameters.jobId, options).then((request) => request(axios, basePath)); }, /** * Get the status of a resend job * @summary Get resend job status * @param {WebhooksV2ApiGetResendJobStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getResendJobStatus(requestParameters: WebhooksV2ApiGetResendJobStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getResendJobStatus(requestParameters.webhookId, requestParameters.jobId, options).then((request) => request(axios, basePath)); }, /** * Retrieve a webhook by its id * @summary Get webhook by id * @param {WebhooksV2ApiGetWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhook(requestParameters: WebhooksV2ApiGetWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWebhook(requestParameters.webhookId, options).then((request) => request(axios, basePath)); }, /** * Retrieve one stored mTLS configuration by its id. * @summary Get an mTLS configuration by id * @param {WebhooksV2ApiGetWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookMtlsConfig(requestParameters: WebhooksV2ApiGetWebhookMtlsConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWebhookMtlsConfig(requestParameters.webhookMtlsId, options).then((request) => request(axios, basePath)); }, /** * Lists the workspace\'s mTLS configurations, newest first. Pass `ids` to ask about particular ones instead — useful for resolving the `webhookMtlsId` values on a set of webhooks in one call. * @summary List the uploaded mTLS configurations * @param {WebhooksV2ApiGetWebhookMtlsConfigsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookMtlsConfigs(requestParameters: WebhooksV2ApiGetWebhookMtlsConfigsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWebhookMtlsConfigs(requestParameters.ids, options).then((request) => request(axios, basePath)); }, /** * Retrieve an OAuth credential set by its id. The client secret is never returned. * @summary Get OAuth credentials by id * @param {WebhooksV2ApiGetWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookOauth(requestParameters: WebhooksV2ApiGetWebhookOauthRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWebhookOauth(requestParameters.webhookOauthId, options).then((request) => request(axios, basePath)); }, /** * Lists every OAuth credential set for the workspace. Client secrets are never returned. * @summary Get all OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookOauths(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWebhookOauths(options).then((request) => request(axios, basePath)); }, /** * Get all webhooks (paginated). * @summary Get all webhooks * @param {WebhooksV2ApiGetWebhooksRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhooks(requestParameters: WebhooksV2ApiGetWebhooksRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWebhooks(requestParameters.order, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(axios, basePath)); }, /** * Resend all failed notifications for a webhook in the last 24 hours Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend failed notifications * @param {WebhooksV2ApiResendFailedNotificationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendFailedNotifications(requestParameters: WebhooksV2ApiResendFailedNotificationsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.resendFailedNotifications(requestParameters.resendFailedNotificationsRequest, requestParameters.webhookId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Resend notification by ID Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notification by id * @param {WebhooksV2ApiResendNotificationByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendNotificationById(requestParameters: WebhooksV2ApiResendNotificationByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.resendNotificationById(requestParameters.webhookId, requestParameters.notificationId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Resend notifications matching the given query filters (statuses, events, time range, resource ID) Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by query * @param {WebhooksV2ApiResendNotificationsByQueryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendNotificationsByQuery(requestParameters: WebhooksV2ApiResendNotificationsByQueryRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.resendNotificationsByQuery(requestParameters.resendByQueryRequest, requestParameters.webhookId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Resend notifications by resource Id Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by resource Id * @param {WebhooksV2ApiResendNotificationsByResourceIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendNotificationsByResourceId(requestParameters: WebhooksV2ApiResendNotificationsByResourceIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.resendNotificationsByResourceId(requestParameters.resendNotificationsByResourceIdRequest, requestParameters.webhookId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Update a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Update webhook * @param {WebhooksV2ApiUpdateWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhook(requestParameters: WebhooksV2ApiUpdateWebhookRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateWebhook(requestParameters.updateWebhookRequest, requestParameters.webhookId, options).then((request) => request(axios, basePath)); }, /** * Renames a configuration, replaces its certificate, or both. Only the fields present in the request are changed; anything omitted is left as it is, and a request with neither field is rejected with a `400`. Replacing `signedCert` switches every webhook and OAuth credentials set using this configuration over to the new certificate in one write, and the private key it was issued for is re-derived from the certificate. A replacement that was not issued for a private key this workspace holds is rejected with a `400`. Sending `name: null` removes the label. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update an mTLS configuration * @param {WebhooksV2ApiUpdateWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookMtlsConfig(requestParameters: WebhooksV2ApiUpdateWebhookMtlsConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateWebhookMtlsConfig(requestParameters.updateWebhookMtlsConfigRequest, requestParameters.webhookMtlsId, options).then((request) => request(axios, basePath)); }, /** * Updates only the fields present in the request; anything omitted is left as it is. Sending `clientSecret` on its own rotates the secret for every webhook using these credentials. `customJwtClaims`, `customBodyParams` and `customHeaders` are all merged key by key rather than replaced, the same way a webhook\'s own `customHeaders` behaves: a key sent with a value is added or overwritten, a key sent with a `null` value is deleted, and a key you omit is left alone. Setting one of the three to `null` as a whole clears that map, which is the quick way to empty it without naming every key. There is no ambiguity between the two uses of `null` — one names an entry to delete, the other names the field. A claim cannot be set to JSON `null`, though, on this endpoint or on create, because `null` is spent on deletion. `webhookMtlsId` is a scalar rather than a map, so `null` there does remove it. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update OAuth credentials * @param {WebhooksV2ApiUpdateWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWebhookOauth(requestParameters: WebhooksV2ApiUpdateWebhookOauthRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateWebhookOauth(requestParameters.updateWebhookOauthRequest, requestParameters.webhookOauthId, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createWebhook operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiCreateWebhookRequest */ export interface WebhooksV2ApiCreateWebhookRequest { /** * * @type {CreateWebhookRequest} * @memberof WebhooksV2ApiCreateWebhook */ readonly createWebhookRequest: CreateWebhookRequest /** * 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 WebhooksV2ApiCreateWebhook */ readonly idempotencyKey?: string } /** * Request parameters for createWebhookMtlsConfig operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiCreateWebhookMtlsConfigRequest */ export interface WebhooksV2ApiCreateWebhookMtlsConfigRequest { /** * * @type {CreateWebhookMtlsConfigRequest} * @memberof WebhooksV2ApiCreateWebhookMtlsConfig */ readonly createWebhookMtlsConfigRequest: CreateWebhookMtlsConfigRequest /** * 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 WebhooksV2ApiCreateWebhookMtlsConfig */ readonly idempotencyKey?: string } /** * Request parameters for createWebhookOauth operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiCreateWebhookOauthRequest */ export interface WebhooksV2ApiCreateWebhookOauthRequest { /** * * @type {CreateWebhookOauthRequest} * @memberof WebhooksV2ApiCreateWebhookOauth */ readonly createWebhookOauthRequest: CreateWebhookOauthRequest /** * 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 WebhooksV2ApiCreateWebhookOauth */ readonly idempotencyKey?: string } /** * Request parameters for deleteWebhook operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiDeleteWebhookRequest */ export interface WebhooksV2ApiDeleteWebhookRequest { /** * The unique identifier of the webhook * @type {string} * @memberof WebhooksV2ApiDeleteWebhook */ readonly webhookId: string } /** * Request parameters for deleteWebhookMtlsConfig operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiDeleteWebhookMtlsConfigRequest */ export interface WebhooksV2ApiDeleteWebhookMtlsConfigRequest { /** * The unique identifier of the mTLS configuration * @type {string} * @memberof WebhooksV2ApiDeleteWebhookMtlsConfig */ readonly webhookMtlsId: string /** * Delete the configuration even while webhooks or OAuth credentials still reference it, detaching them instead of refusing; their ids are returned in `detachedWebhookIds` and `detachedWebhookOauthIds`. Leave it unset, or `false`, to get a `409 Conflict` whenever anything still references the configuration. * @type {boolean} * @memberof WebhooksV2ApiDeleteWebhookMtlsConfig */ readonly forceDelete?: boolean } /** * Request parameters for deleteWebhookOauth operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiDeleteWebhookOauthRequest */ export interface WebhooksV2ApiDeleteWebhookOauthRequest { /** * The unique identifier of the OAuth credentials * @type {string} * @memberof WebhooksV2ApiDeleteWebhookOauth */ readonly webhookOauthId: string /** * Delete the credentials even while webhooks still reference them, detaching those webhooks instead of refusing. Leave it unset, or `false`, to get a `409 Conflict` whenever anything still references the credentials. * @type {boolean} * @memberof WebhooksV2ApiDeleteWebhookOauth */ readonly forceDelete?: boolean } /** * Request parameters for getMetrics operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetMetricsRequest */ export interface WebhooksV2ApiGetMetricsRequest { /** * * @type {string} * @memberof WebhooksV2ApiGetMetrics */ readonly webhookId: string /** * Name of the metric to retrieve * @type {'LAST_ACTIVE_HOUR_ERROR_RATE'} * @memberof WebhooksV2ApiGetMetrics */ readonly metricName: GetMetricsMetricNameEnum } /** * Request parameters for getMtlsCsr operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetMtlsCsrRequest */ export interface WebhooksV2ApiGetMtlsCsrRequest { /** * Algorithm of the private key the CSR is generated for. ECDSA keys are smaller and quicker to issue, but the certificate authority signing the request has to accept an EC subject key, which some do not by default. * @type {'RSA' | 'ECDSA'} * @memberof WebhooksV2ApiGetMtlsCsr */ readonly keyAlgorithm?: GetMtlsCsrKeyAlgorithmEnum } /** * Request parameters for getNotification operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetNotificationRequest */ export interface WebhooksV2ApiGetNotificationRequest { /** * The ID of the webhook to fetch * @type {string} * @memberof WebhooksV2ApiGetNotification */ readonly webhookId: string /** * The ID of the notification to fetch * @type {string} * @memberof WebhooksV2ApiGetNotification */ readonly notificationId: string /** * Include the data of the notification * @type {boolean} * @memberof WebhooksV2ApiGetNotification */ readonly includeData?: boolean } /** * Request parameters for getNotificationAttempts operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetNotificationAttemptsRequest */ export interface WebhooksV2ApiGetNotificationAttemptsRequest { /** * The ID of the webhook to fetch * @type {string} * @memberof WebhooksV2ApiGetNotificationAttempts */ readonly webhookId: string /** * The ID of the notification to fetch * @type {string} * @memberof WebhooksV2ApiGetNotificationAttempts */ readonly notificationId: string /** * Cursor of the required page * @type {string} * @memberof WebhooksV2ApiGetNotificationAttempts */ readonly pageCursor?: string /** * Maximum number of items in the page * @type {number} * @memberof WebhooksV2ApiGetNotificationAttempts */ readonly pageSize?: number } /** * Request parameters for getNotifications operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetNotificationsRequest */ export interface WebhooksV2ApiGetNotificationsRequest { /** * * @type {string} * @memberof WebhooksV2ApiGetNotifications */ readonly webhookId: string /** * ASC / DESC ordering (default DESC) * @type {'ASC' | 'DESC'} * @memberof WebhooksV2ApiGetNotifications */ readonly order?: GetNotificationsOrderEnum /** * Sort by field * @type {'id' | 'createdAt' | 'updatedAt' | 'status' | 'eventType' | 'resourceId'} * @memberof WebhooksV2ApiGetNotifications */ readonly sortBy?: GetNotificationsSortByEnum /** * Cursor of the required page * @type {string} * @memberof WebhooksV2ApiGetNotifications */ readonly pageCursor?: string /** * Maximum number of items in the page * @type {number} * @memberof WebhooksV2ApiGetNotifications */ readonly pageSize?: number /** * Start time in milliseconds since epoch to filter by notifications created after this time (default 31 days ago) * @type {number} * @memberof WebhooksV2ApiGetNotifications */ readonly startTime?: number /** * End time in milliseconds since epoch to filter by notifications created before this time (default current time) * @type {number} * @memberof WebhooksV2ApiGetNotifications */ readonly endTime?: number /** * List of notification statuses to filter by * @type {Array} * @memberof WebhooksV2ApiGetNotifications */ readonly statuses?: Array /** * List of webhook event types to filter by * @type {Array} * @memberof WebhooksV2ApiGetNotifications */ readonly events?: Array /** * Resource ID to filter by * @type {string} * @memberof WebhooksV2ApiGetNotifications */ readonly resourceId?: string } /** * Request parameters for getResendByQueryJobStatus operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetResendByQueryJobStatusRequest */ export interface WebhooksV2ApiGetResendByQueryJobStatusRequest { /** * The ID of the webhook * @type {string} * @memberof WebhooksV2ApiGetResendByQueryJobStatus */ readonly webhookId: string /** * The ID of the resend job * @type {string} * @memberof WebhooksV2ApiGetResendByQueryJobStatus */ readonly jobId: string } /** * Request parameters for getResendJobStatus operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetResendJobStatusRequest */ export interface WebhooksV2ApiGetResendJobStatusRequest { /** * The ID of the webhook * @type {string} * @memberof WebhooksV2ApiGetResendJobStatus */ readonly webhookId: string /** * The ID of the resend job * @type {string} * @memberof WebhooksV2ApiGetResendJobStatus */ readonly jobId: string } /** * Request parameters for getWebhook operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetWebhookRequest */ export interface WebhooksV2ApiGetWebhookRequest { /** * The unique identifier of the webhook * @type {string} * @memberof WebhooksV2ApiGetWebhook */ readonly webhookId: string } /** * Request parameters for getWebhookMtlsConfig operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetWebhookMtlsConfigRequest */ export interface WebhooksV2ApiGetWebhookMtlsConfigRequest { /** * The unique identifier of the mTLS configuration * @type {string} * @memberof WebhooksV2ApiGetWebhookMtlsConfig */ readonly webhookMtlsId: string } /** * Request parameters for getWebhookMtlsConfigs operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetWebhookMtlsConfigsRequest */ export interface WebhooksV2ApiGetWebhookMtlsConfigsRequest { /** * Return only the configurations with these ids, instead of all of them. Repeat the parameter for each id. An id belonging to another workspace, or to nothing, is left out of the response rather than failing the request. * @type {Array} * @memberof WebhooksV2ApiGetWebhookMtlsConfigs */ readonly ids?: Array } /** * Request parameters for getWebhookOauth operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetWebhookOauthRequest */ export interface WebhooksV2ApiGetWebhookOauthRequest { /** * The unique identifier of the OAuth credentials * @type {string} * @memberof WebhooksV2ApiGetWebhookOauth */ readonly webhookOauthId: string } /** * Request parameters for getWebhooks operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiGetWebhooksRequest */ export interface WebhooksV2ApiGetWebhooksRequest { /** * ASC / DESC ordering (default DESC) * @type {'ASC' | 'DESC'} * @memberof WebhooksV2ApiGetWebhooks */ readonly order?: GetWebhooksOrderEnum /** * Cursor of the required page * @type {string} * @memberof WebhooksV2ApiGetWebhooks */ readonly pageCursor?: string /** * Maximum number of items in the page * @type {number} * @memberof WebhooksV2ApiGetWebhooks */ readonly pageSize?: number } /** * Request parameters for resendFailedNotifications operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiResendFailedNotificationsRequest */ export interface WebhooksV2ApiResendFailedNotificationsRequest { /** * * @type {ResendFailedNotificationsRequest} * @memberof WebhooksV2ApiResendFailedNotifications */ readonly resendFailedNotificationsRequest: ResendFailedNotificationsRequest /** * The ID of the webhook * @type {string} * @memberof WebhooksV2ApiResendFailedNotifications */ readonly webhookId: 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 WebhooksV2ApiResendFailedNotifications */ readonly idempotencyKey?: string } /** * Request parameters for resendNotificationById operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiResendNotificationByIdRequest */ export interface WebhooksV2ApiResendNotificationByIdRequest { /** * The ID of the webhook * @type {string} * @memberof WebhooksV2ApiResendNotificationById */ readonly webhookId: string /** * The ID of the notification * @type {string} * @memberof WebhooksV2ApiResendNotificationById */ readonly notificationId: 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 WebhooksV2ApiResendNotificationById */ readonly idempotencyKey?: string } /** * Request parameters for resendNotificationsByQuery operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiResendNotificationsByQueryRequest */ export interface WebhooksV2ApiResendNotificationsByQueryRequest { /** * * @type {ResendByQueryRequest} * @memberof WebhooksV2ApiResendNotificationsByQuery */ readonly resendByQueryRequest: ResendByQueryRequest /** * The ID of the webhook * @type {string} * @memberof WebhooksV2ApiResendNotificationsByQuery */ readonly webhookId: 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 WebhooksV2ApiResendNotificationsByQuery */ readonly idempotencyKey?: string } /** * Request parameters for resendNotificationsByResourceId operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiResendNotificationsByResourceIdRequest */ export interface WebhooksV2ApiResendNotificationsByResourceIdRequest { /** * * @type {ResendNotificationsByResourceIdRequest} * @memberof WebhooksV2ApiResendNotificationsByResourceId */ readonly resendNotificationsByResourceIdRequest: ResendNotificationsByResourceIdRequest /** * The ID of the webhook * @type {string} * @memberof WebhooksV2ApiResendNotificationsByResourceId */ readonly webhookId: 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 WebhooksV2ApiResendNotificationsByResourceId */ readonly idempotencyKey?: string } /** * Request parameters for updateWebhook operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiUpdateWebhookRequest */ export interface WebhooksV2ApiUpdateWebhookRequest { /** * * @type {UpdateWebhookRequest} * @memberof WebhooksV2ApiUpdateWebhook */ readonly updateWebhookRequest: UpdateWebhookRequest /** * The unique identifier of the webhook * @type {string} * @memberof WebhooksV2ApiUpdateWebhook */ readonly webhookId: string } /** * Request parameters for updateWebhookMtlsConfig operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiUpdateWebhookMtlsConfigRequest */ export interface WebhooksV2ApiUpdateWebhookMtlsConfigRequest { /** * * @type {UpdateWebhookMtlsConfigRequest} * @memberof WebhooksV2ApiUpdateWebhookMtlsConfig */ readonly updateWebhookMtlsConfigRequest: UpdateWebhookMtlsConfigRequest /** * The unique identifier of the mTLS configuration * @type {string} * @memberof WebhooksV2ApiUpdateWebhookMtlsConfig */ readonly webhookMtlsId: string } /** * Request parameters for updateWebhookOauth operation in WebhooksV2Api. * @export * @interface WebhooksV2ApiUpdateWebhookOauthRequest */ export interface WebhooksV2ApiUpdateWebhookOauthRequest { /** * * @type {UpdateWebhookOauthRequest} * @memberof WebhooksV2ApiUpdateWebhookOauth */ readonly updateWebhookOauthRequest: UpdateWebhookOauthRequest /** * The unique identifier of the OAuth credentials * @type {string} * @memberof WebhooksV2ApiUpdateWebhookOauth */ readonly webhookOauthId: string } /** * WebhooksV2Api - object-oriented interface * @export * @class WebhooksV2Api * @extends {BaseAPI} */ export class WebhooksV2Api extends BaseAPI { /** * Creates a new webhook, which will be triggered on the specified events **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create a new webhook * @param {WebhooksV2ApiCreateWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public createWebhook(requestParameters: WebhooksV2ApiCreateWebhookRequest) { return WebhooksV2ApiFp(this.configuration).createWebhook(requestParameters.createWebhookRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Stores a certificate signed against the CSR from `GET /v1/webhooks_settings/mtls_csr` and returns its id, which is then set as `webhookMtlsId` on a webhook or on OAuth credentials. The private key the certificate was issued for is derived from the certificate, so it is never named by the caller. Re-uploading a certificate already stored returns the existing id rather than creating a second configuration, so several webhooks and OAuth credentials can share one certificate. A certificate that was not issued for a private key this workspace holds is rejected with a `400`. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create an mTLS configuration * @param {WebhooksV2ApiCreateWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public createWebhookMtlsConfig(requestParameters: WebhooksV2ApiCreateWebhookMtlsConfigRequest) { return WebhooksV2ApiFp(this.configuration).createWebhookMtlsConfig(requestParameters.createWebhookMtlsConfigRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Creates a reusable OAuth client credential set. Attach it to a webhook by passing the returned id as that webhook\'s `webhookOauthId`. Several webhooks may share one credential set, so rotating its client secret covers all of them at once. The client secret is write-only and is never returned. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Create OAuth credentials * @param {WebhooksV2ApiCreateWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public createWebhookOauth(requestParameters: WebhooksV2ApiCreateWebhookOauthRequest) { return WebhooksV2ApiFp(this.configuration).createWebhookOauth(requestParameters.createWebhookOauthRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Delete a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Delete webhook * @param {WebhooksV2ApiDeleteWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public deleteWebhook(requestParameters: WebhooksV2ApiDeleteWebhookRequest) { return WebhooksV2ApiFp(this.configuration).deleteWebhook(requestParameters.webhookId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Deletes an mTLS configuration. By default the delete is refused while the configuration is still in use: if any webhook or OAuth credentials reference it, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of what references it. This protects a shared configuration from being removed out from under the webhooks and token requests that depend on it. Pass `forceDelete=true` to delete anyway. That detaches everything referencing it — it clears `webhookMtlsId` on each webhook and OAuth credentials, it does **not** delete them — then deletes the configuration and returns the deleted resource together with `detachedWebhookIds` and `detachedWebhookOauthIds`. Detached webhooks keep delivering notifications, and detached OAuth credentials keep requesting tokens, but without a client certificate, so an endpoint that requires mTLS will reject them from that point on. When nothing references the configuration the delete succeeds either way, and both lists come back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete an mTLS configuration * @param {WebhooksV2ApiDeleteWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public deleteWebhookMtlsConfig(requestParameters: WebhooksV2ApiDeleteWebhookMtlsConfigRequest) { return WebhooksV2ApiFp(this.configuration).deleteWebhookMtlsConfig(requestParameters.webhookMtlsId, requestParameters.forceDelete).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Deletes an OAuth credential set. By default the delete is refused while the credentials are still in use: if any webhook references them, nothing is deleted and the request fails with `409 Conflict`, naming the reason and listing the ids of the referencing webhooks. This protects a shared credential set from being removed out from under the webhooks that depend on it, since several webhooks may reference the same one. Pass `forceDelete=true` to delete anyway. That detaches every referencing webhook — it clears each webhook\'s `webhookOauthId`, it does **not** delete the webhook — then deletes the credential set and returns the deleted resource together with `detachedWebhookIds`. The detached webhooks keep delivering notifications, but without an `Authorization` header, so their endpoints will see unauthenticated deliveries from that point on. When nothing references the credentials the delete succeeds either way, and `detachedWebhookIds` comes back empty. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Delete OAuth credentials * @param {WebhooksV2ApiDeleteWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public deleteWebhookOauth(requestParameters: WebhooksV2ApiDeleteWebhookOauthRequest) { return WebhooksV2ApiFp(this.configuration).deleteWebhookOauth(requestParameters.webhookOauthId, requestParameters.forceDelete).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get webhook metrics by webhook id and metric name * @summary Get webhook metrics * @param {WebhooksV2ApiGetMetricsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getMetrics(requestParameters: WebhooksV2ApiGetMetricsRequest) { return WebhooksV2ApiFp(this.configuration).getMetrics(requestParameters.webhookId, requestParameters.metricName).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns the Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate. The private key the CSR is built from is held by Fireblocks and is specific to this workspace. It is created on the first request for a given key type, and the same CSR is returned on subsequent requests for that type. Pass `keyAlgorithm` to choose RSA or ECDSA. A workspace may hold one key of each: the CSR returned is always the one for the type requested, so a certificate signed against it matches the key used at delivery time. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Get mTLS CSR * @param {WebhooksV2ApiGetMtlsCsrRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getMtlsCsr(requestParameters: WebhooksV2ApiGetMtlsCsrRequest = {}) { return WebhooksV2ApiFp(this.configuration).getMtlsCsr(requestParameters.keyAlgorithm).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get notification by id * @summary Get notification by id * @param {WebhooksV2ApiGetNotificationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getNotification(requestParameters: WebhooksV2ApiGetNotificationRequest) { return WebhooksV2ApiFp(this.configuration).getNotification(requestParameters.webhookId, requestParameters.notificationId, requestParameters.includeData).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get notification attempts by notification id * @summary Get notification attempts * @param {WebhooksV2ApiGetNotificationAttemptsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getNotificationAttempts(requestParameters: WebhooksV2ApiGetNotificationAttemptsRequest) { return WebhooksV2ApiFp(this.configuration).getNotificationAttempts(requestParameters.webhookId, requestParameters.notificationId, requestParameters.pageCursor, requestParameters.pageSize).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get all notifications by webhook id (paginated) * @summary Get all notifications by webhook id * @param {WebhooksV2ApiGetNotificationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getNotifications(requestParameters: WebhooksV2ApiGetNotificationsRequest) { return WebhooksV2ApiFp(this.configuration).getNotifications(requestParameters.webhookId, requestParameters.order, requestParameters.sortBy, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.startTime, requestParameters.endTime, requestParameters.statuses, requestParameters.events, requestParameters.resourceId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get the status of a resend by query job * @summary Get resend by query job status * @param {WebhooksV2ApiGetResendByQueryJobStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getResendByQueryJobStatus(requestParameters: WebhooksV2ApiGetResendByQueryJobStatusRequest) { return WebhooksV2ApiFp(this.configuration).getResendByQueryJobStatus(requestParameters.webhookId, requestParameters.jobId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get the status of a resend job * @summary Get resend job status * @param {WebhooksV2ApiGetResendJobStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getResendJobStatus(requestParameters: WebhooksV2ApiGetResendJobStatusRequest) { return WebhooksV2ApiFp(this.configuration).getResendJobStatus(requestParameters.webhookId, requestParameters.jobId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve a webhook by its id * @summary Get webhook by id * @param {WebhooksV2ApiGetWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getWebhook(requestParameters: WebhooksV2ApiGetWebhookRequest) { return WebhooksV2ApiFp(this.configuration).getWebhook(requestParameters.webhookId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve one stored mTLS configuration by its id. * @summary Get an mTLS configuration by id * @param {WebhooksV2ApiGetWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getWebhookMtlsConfig(requestParameters: WebhooksV2ApiGetWebhookMtlsConfigRequest) { return WebhooksV2ApiFp(this.configuration).getWebhookMtlsConfig(requestParameters.webhookMtlsId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Lists the workspace\'s mTLS configurations, newest first. Pass `ids` to ask about particular ones instead — useful for resolving the `webhookMtlsId` values on a set of webhooks in one call. * @summary List the uploaded mTLS configurations * @param {WebhooksV2ApiGetWebhookMtlsConfigsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getWebhookMtlsConfigs(requestParameters: WebhooksV2ApiGetWebhookMtlsConfigsRequest = {}) { return WebhooksV2ApiFp(this.configuration).getWebhookMtlsConfigs(requestParameters.ids).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve an OAuth credential set by its id. The client secret is never returned. * @summary Get OAuth credentials by id * @param {WebhooksV2ApiGetWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getWebhookOauth(requestParameters: WebhooksV2ApiGetWebhookOauthRequest) { return WebhooksV2ApiFp(this.configuration).getWebhookOauth(requestParameters.webhookOauthId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Lists every OAuth credential set for the workspace. Client secrets are never returned. * @summary Get all OAuth credentials * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getWebhookOauths() { return WebhooksV2ApiFp(this.configuration).getWebhookOauths().then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Get all webhooks (paginated). * @summary Get all webhooks * @param {WebhooksV2ApiGetWebhooksRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public getWebhooks(requestParameters: WebhooksV2ApiGetWebhooksRequest = {}) { return WebhooksV2ApiFp(this.configuration).getWebhooks(requestParameters.order, requestParameters.pageCursor, requestParameters.pageSize).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Resend all failed notifications for a webhook in the last 24 hours Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend failed notifications * @param {WebhooksV2ApiResendFailedNotificationsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public resendFailedNotifications(requestParameters: WebhooksV2ApiResendFailedNotificationsRequest) { return WebhooksV2ApiFp(this.configuration).resendFailedNotifications(requestParameters.resendFailedNotificationsRequest, requestParameters.webhookId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Resend notification by ID Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notification by id * @param {WebhooksV2ApiResendNotificationByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public resendNotificationById(requestParameters: WebhooksV2ApiResendNotificationByIdRequest) { return WebhooksV2ApiFp(this.configuration).resendNotificationById(requestParameters.webhookId, requestParameters.notificationId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Resend notifications matching the given query filters (statuses, events, time range, resource ID) Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by query * @param {WebhooksV2ApiResendNotificationsByQueryRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public resendNotificationsByQuery(requestParameters: WebhooksV2ApiResendNotificationsByQueryRequest) { return WebhooksV2ApiFp(this.configuration).resendNotificationsByQuery(requestParameters.resendByQueryRequest, requestParameters.webhookId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Resend notifications by resource Id Endpoint Permission: Owner, Admin, Non-Signing Admin, Editor, Signer. * @summary Resend notifications by resource Id * @param {WebhooksV2ApiResendNotificationsByResourceIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public resendNotificationsByResourceId(requestParameters: WebhooksV2ApiResendNotificationsByResourceIdRequest) { return WebhooksV2ApiFp(this.configuration).resendNotificationsByResourceId(requestParameters.resendNotificationsByResourceIdRequest, requestParameters.webhookId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Update a webhook by its id Endpoint Permission: Owner, Admin, Non-Signing Admin. * @summary Update webhook * @param {WebhooksV2ApiUpdateWebhookRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public updateWebhook(requestParameters: WebhooksV2ApiUpdateWebhookRequest) { return WebhooksV2ApiFp(this.configuration).updateWebhook(requestParameters.updateWebhookRequest, requestParameters.webhookId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Renames a configuration, replaces its certificate, or both. Only the fields present in the request are changed; anything omitted is left as it is, and a request with neither field is rejected with a `400`. Replacing `signedCert` switches every webhook and OAuth credentials set using this configuration over to the new certificate in one write, and the private key it was issued for is re-derived from the certificate. A replacement that was not issued for a private key this workspace holds is rejected with a `400`. Sending `name: null` removes the label. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update an mTLS configuration * @param {WebhooksV2ApiUpdateWebhookMtlsConfigRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public updateWebhookMtlsConfig(requestParameters: WebhooksV2ApiUpdateWebhookMtlsConfigRequest) { return WebhooksV2ApiFp(this.configuration).updateWebhookMtlsConfig(requestParameters.updateWebhookMtlsConfigRequest, requestParameters.webhookMtlsId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Updates only the fields present in the request; anything omitted is left as it is. Sending `clientSecret` on its own rotates the secret for every webhook using these credentials. `customJwtClaims`, `customBodyParams` and `customHeaders` are all merged key by key rather than replaced, the same way a webhook\'s own `customHeaders` behaves: a key sent with a value is added or overwritten, a key sent with a `null` value is deleted, and a key you omit is left alone. Setting one of the three to `null` as a whole clears that map, which is the quick way to empty it without naming every key. There is no ambiguity between the two uses of `null` — one names an entry to delete, the other names the field. A claim cannot be set to JSON `null`, though, on this endpoint or on create, because `null` is spent on deletion. `webhookMtlsId` is a scalar rather than a map, so `null` there does remove it. **Endpoint Permissions:** Owner, Admin, Non-Signing Admin. * @summary Update OAuth credentials * @param {WebhooksV2ApiUpdateWebhookOauthRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksV2Api */ public updateWebhookOauth(requestParameters: WebhooksV2ApiUpdateWebhookOauthRequest) { return WebhooksV2ApiFp(this.configuration).updateWebhookOauth(requestParameters.updateWebhookOauthRequest, requestParameters.webhookOauthId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetMetricsMetricNameEnum = { LastActiveHourErrorRate: 'LAST_ACTIVE_HOUR_ERROR_RATE' } as const; export type GetMetricsMetricNameEnum = typeof GetMetricsMetricNameEnum[keyof typeof GetMetricsMetricNameEnum]; /** * @export */ export const GetMtlsCsrKeyAlgorithmEnum = { Rsa: 'RSA', Ecdsa: 'ECDSA' } as const; export type GetMtlsCsrKeyAlgorithmEnum = typeof GetMtlsCsrKeyAlgorithmEnum[keyof typeof GetMtlsCsrKeyAlgorithmEnum]; /** * @export */ export const GetNotificationsOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetNotificationsOrderEnum = typeof GetNotificationsOrderEnum[keyof typeof GetNotificationsOrderEnum]; /** * @export */ export const GetNotificationsSortByEnum = { Id: 'id', CreatedAt: 'createdAt', UpdatedAt: 'updatedAt', Status: 'status', EventType: 'eventType', ResourceId: 'resourceId' } as const; export type GetNotificationsSortByEnum = typeof GetNotificationsSortByEnum[keyof typeof GetNotificationsSortByEnum]; /** * @export */ export const GetWebhooksOrderEnum = { Asc: 'ASC', Desc: 'DESC' } as const; export type GetWebhooksOrderEnum = typeof GetWebhooksOrderEnum[keyof typeof GetWebhooksOrderEnum];