"use strict";
/* 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.
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetWebhooksOrderEnum = exports.GetNotificationsSortByEnum = exports.GetNotificationsOrderEnum = exports.GetMetricsMetricNameEnum = exports.WebhooksV2Api = exports.WebhooksV2ApiFactory = exports.WebhooksV2ApiFp = exports.WebhooksV2ApiAxiosParamCreator = void 0;
var axios_1 = __importDefault(require("axios"));
var fireblocksResponse_1 = require("../response/fireblocksResponse");
// URLSearchParams not necessarily used
// @ts-ignore
var url_1 = require("url");
// Some imports not used depending on template conditions
// @ts-ignore
var common_1 = require("../common");
var validation_utils_1 = require("../utils/validation_utils");
// @ts-ignore
var base_1 = require("../base");
/**
 * WebhooksV2Api - axios parameter creator
 * @export
 */
var WebhooksV2ApiAxiosParamCreator = function (configuration) {
    var _this = this;
    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: function (createWebhookRequest, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('createWebhook', 'createWebhookRequest', createWebhookRequest);
                    localVarPath = "/webhooks";
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createWebhookRequest, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('deleteWebhook', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, metricName, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getMetrics', 'webhookId', webhookId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getMetrics', 'metricName', metricName);
                    localVarPath = "/webhooks/{webhookId}/metrics/{metricName}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)))
                        .replace("{".concat("metricName", "}"), encodeURIComponent(String(metricName)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.toPathString)(localVarUrlObj),
                            options: localVarRequestOptions,
                        }];
                });
            });
        },
        /**
         * Returns the Fireblocks Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate.
         * @summary Get mTLS CSR
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMtlsCsr: function (options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    localVarPath = "/webhooks/mtls/csr";
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, notificationId, includeData, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getNotification', 'webhookId', webhookId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getNotification', 'notificationId', notificationId);
                    localVarPath = "/webhooks/{webhookId}/notifications/{notificationId}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)))
                        .replace("{".concat("notificationId", "}"), encodeURIComponent(String(notificationId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (includeData !== undefined) {
                        localVarQueryParameter['includeData'] = includeData;
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, notificationId, pageCursor, pageSize, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getNotificationAttempts', 'webhookId', webhookId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getNotificationAttempts', 'notificationId', notificationId);
                    localVarPath = "/webhooks/{webhookId}/notifications/{notificationId}/attempts"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)))
                        .replace("{".concat("notificationId", "}"), encodeURIComponent(String(notificationId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (pageCursor !== undefined) {
                        localVarQueryParameter['pageCursor'] = pageCursor;
                    }
                    if (pageSize !== undefined) {
                        localVarQueryParameter['pageSize'] = pageSize;
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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<NotificationStatus>} [statuses] List of notification statuses to filter by
         * @param {Array<WebhookEvent>} [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: function (webhookId, order, sortBy, pageCursor, pageSize, startTime, endTime, statuses, events, resourceId, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getNotifications', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}/notifications"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    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;
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, jobId, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getResendByQueryJobStatus', 'webhookId', webhookId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getResendByQueryJobStatus', 'jobId', jobId);
                    localVarPath = "/webhooks/{webhookId}/notifications/resend_by_query/jobs/{jobId}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)))
                        .replace("{".concat("jobId", "}"), encodeURIComponent(String(jobId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, jobId, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getResendJobStatus', 'webhookId', webhookId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getResendJobStatus', 'jobId', jobId);
                    localVarPath = "/webhooks/{webhookId}/notifications/resend_failed/jobs/{jobId}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)))
                        .replace("{".concat("jobId", "}"), encodeURIComponent(String(jobId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getWebhook', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (order, pageCursor, pageSize, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    localVarPath = "/webhooks";
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (order !== undefined) {
                        localVarQueryParameter['order'] = order;
                    }
                    if (pageCursor !== undefined) {
                        localVarQueryParameter['pageCursor'] = pageCursor;
                    }
                    if (pageSize !== undefined) {
                        localVarQueryParameter['pageSize'] = pageSize;
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (resendFailedNotificationsRequest, webhookId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('resendFailedNotifications', 'resendFailedNotificationsRequest', resendFailedNotificationsRequest);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('resendFailedNotifications', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}/notifications/resend_failed"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resendFailedNotificationsRequest, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (webhookId, notificationId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('resendNotificationById', 'webhookId', webhookId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('resendNotificationById', 'notificationId', notificationId);
                    localVarPath = "/webhooks/{webhookId}/notifications/{notificationId}/resend"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)))
                        .replace("{".concat("notificationId", "}"), encodeURIComponent(String(notificationId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (resendByQueryRequest, webhookId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('resendNotificationsByQuery', 'resendByQueryRequest', resendByQueryRequest);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('resendNotificationsByQuery', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}/notifications/resend_by_query"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resendByQueryRequest, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (resendNotificationsByResourceIdRequest, webhookId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('resendNotificationsByResourceId', 'resendNotificationsByResourceIdRequest', resendNotificationsByResourceIdRequest);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('resendNotificationsByResourceId', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}/notifications/resend_by_resource"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resendNotificationsByResourceIdRequest, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (updateWebhookRequest, webhookId, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('updateWebhook', 'updateWebhookRequest', updateWebhookRequest);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('updateWebhook', 'webhookId', webhookId);
                    localVarPath = "/webhooks/{webhookId}"
                        .replace("{".concat("webhookId", "}"), encodeURIComponent(String(webhookId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'PATCH' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateWebhookRequest, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.toPathString)(localVarUrlObj),
                            options: localVarRequestOptions,
                        }];
                });
            });
        },
    };
};
exports.WebhooksV2ApiAxiosParamCreator = WebhooksV2ApiAxiosParamCreator;
/**
 * WebhooksV2Api - functional programming interface
 * @export
 */
var WebhooksV2ApiFp = function (configuration) {
    var localVarAxiosParamCreator = (0, exports.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}
         */
        createWebhook: function (createWebhookRequest, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.createWebhook(createWebhookRequest, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.createWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        deleteWebhook: function (webhookId, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteWebhook(webhookId, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.deleteWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getMetrics: function (webhookId, metricName, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getMetrics(webhookId, metricName, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getMetrics']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath); }];
                    }
                });
            });
        },
        /**
         * Returns the Fireblocks Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate.
         * @summary Get mTLS CSR
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMtlsCsr: function (options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getMtlsCsr(options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getMtlsCsr']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getNotification: function (webhookId, notificationId, includeData, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getNotification(webhookId, notificationId, includeData, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getNotification']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getNotificationAttempts: function (webhookId, notificationId, pageCursor, pageSize, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getNotificationAttempts(webhookId, notificationId, pageCursor, pageSize, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getNotificationAttempts']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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<NotificationStatus>} [statuses] List of notification statuses to filter by
         * @param {Array<WebhookEvent>} [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: function (webhookId, order, sortBy, pageCursor, pageSize, startTime, endTime, statuses, events, resourceId, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getNotifications(webhookId, order, sortBy, pageCursor, pageSize, startTime, endTime, statuses, events, resourceId, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getNotifications']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getResendByQueryJobStatus: function (webhookId, jobId, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getResendByQueryJobStatus(webhookId, jobId, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getResendByQueryJobStatus']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getResendJobStatus: function (webhookId, jobId, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getResendJobStatus(webhookId, jobId, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getResendJobStatus']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getWebhook: function (webhookId, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getWebhook(webhookId, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getWebhooks: function (order, pageCursor, pageSize, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getWebhooks(order, pageCursor, pageSize, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.getWebhooks']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        resendFailedNotifications: function (resendFailedNotificationsRequest, webhookId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.resendFailedNotifications(resendFailedNotificationsRequest, webhookId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.resendFailedNotifications']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        resendNotificationById: function (webhookId, notificationId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.resendNotificationById(webhookId, notificationId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.resendNotificationById']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        resendNotificationsByQuery: function (resendByQueryRequest, webhookId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.resendNotificationsByQuery(resendByQueryRequest, webhookId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.resendNotificationsByQuery']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        resendNotificationsByResourceId: function (resendNotificationsByResourceIdRequest, webhookId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.resendNotificationsByResourceId(resendNotificationsByResourceIdRequest, webhookId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.resendNotificationsByResourceId']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        updateWebhook: function (updateWebhookRequest, webhookId, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateWebhook(updateWebhookRequest, webhookId, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['WebhooksV2Api.updateWebhook']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath); }];
                    }
                });
            });
        },
    };
};
exports.WebhooksV2ApiFp = WebhooksV2ApiFp;
/**
 * WebhooksV2Api - factory interface
 * @export
 */
var WebhooksV2ApiFactory = function (configuration, basePath, axios) {
    var localVarFp = (0, exports.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: function (requestParameters, options) {
            return localVarFp.createWebhook(requestParameters.createWebhookRequest, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.deleteWebhook(requestParameters.webhookId, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getMetrics(requestParameters.webhookId, requestParameters.metricName, options).then(function (request) { return request(axios, basePath); });
        },
        /**
         * Returns the Fireblocks Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate.
         * @summary Get mTLS CSR
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMtlsCsr: function (options) {
            return localVarFp.getMtlsCsr(options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getNotification(requestParameters.webhookId, requestParameters.notificationId, requestParameters.includeData, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getNotificationAttempts(requestParameters.webhookId, requestParameters.notificationId, requestParameters.pageCursor, requestParameters.pageSize, options).then(function (request) { return 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: function (requestParameters, options) {
            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(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getResendByQueryJobStatus(requestParameters.webhookId, requestParameters.jobId, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getResendJobStatus(requestParameters.webhookId, requestParameters.jobId, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getWebhook(requestParameters.webhookId, options).then(function (request) { return 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: function (requestParameters, options) {
            if (requestParameters === void 0) { requestParameters = {}; }
            return localVarFp.getWebhooks(requestParameters.order, requestParameters.pageCursor, requestParameters.pageSize, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.resendFailedNotifications(requestParameters.resendFailedNotificationsRequest, requestParameters.webhookId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.resendNotificationById(requestParameters.webhookId, requestParameters.notificationId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.resendNotificationsByQuery(requestParameters.resendByQueryRequest, requestParameters.webhookId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.resendNotificationsByResourceId(requestParameters.resendNotificationsByResourceIdRequest, requestParameters.webhookId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.updateWebhook(requestParameters.updateWebhookRequest, requestParameters.webhookId, options).then(function (request) { return request(axios, basePath); });
        },
    };
};
exports.WebhooksV2ApiFactory = WebhooksV2ApiFactory;
/**
 * WebhooksV2Api - object-oriented interface
 * @export
 * @class WebhooksV2Api
 * @extends {BaseAPI}
 */
var WebhooksV2Api = /** @class */ (function (_super) {
    __extends(WebhooksV2Api, _super);
    function WebhooksV2Api() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * 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
     */
    WebhooksV2Api.prototype.createWebhook = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).createWebhook(requestParameters.createWebhookRequest, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.deleteWebhook = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).deleteWebhook(requestParameters.webhookId).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getMetrics = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getMetrics(requestParameters.webhookId, requestParameters.metricName).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.convertToFireblocksResponse);
    };
    /**
     * Returns the Fireblocks Certificate Signing Request (CSR) PEM that customers use to generate their signed client certificate.
     * @summary Get mTLS CSR
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WebhooksV2Api
     */
    WebhooksV2Api.prototype.getMtlsCsr = function () {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getMtlsCsr().then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getNotification = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getNotification(requestParameters.webhookId, requestParameters.notificationId, requestParameters.includeData).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getNotificationAttempts = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getNotificationAttempts(requestParameters.webhookId, requestParameters.notificationId, requestParameters.pageCursor, requestParameters.pageSize).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getNotifications = function (requestParameters) {
        var _this = this;
        return (0, exports.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(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getResendByQueryJobStatus = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getResendByQueryJobStatus(requestParameters.webhookId, requestParameters.jobId).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getResendJobStatus = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getResendJobStatus(requestParameters.webhookId, requestParameters.jobId).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.getWebhook = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getWebhook(requestParameters.webhookId).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.convertToFireblocksResponse);
    };
    /**
     * Get all webhooks (paginated).
     * @summary Get all webhooks
     * @param {WebhooksV2ApiGetWebhooksRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WebhooksV2Api
     */
    WebhooksV2Api.prototype.getWebhooks = function (requestParameters) {
        var _this = this;
        if (requestParameters === void 0) { requestParameters = {}; }
        return (0, exports.WebhooksV2ApiFp)(this.configuration).getWebhooks(requestParameters.order, requestParameters.pageCursor, requestParameters.pageSize).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.resendFailedNotifications = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).resendFailedNotifications(requestParameters.resendFailedNotificationsRequest, requestParameters.webhookId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.resendNotificationById = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).resendNotificationById(requestParameters.webhookId, requestParameters.notificationId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.resendNotificationsByQuery = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).resendNotificationsByQuery(requestParameters.resendByQueryRequest, requestParameters.webhookId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.resendNotificationsByResourceId = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).resendNotificationsByResourceId(requestParameters.resendNotificationsByResourceIdRequest, requestParameters.webhookId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    WebhooksV2Api.prototype.updateWebhook = function (requestParameters) {
        var _this = this;
        return (0, exports.WebhooksV2ApiFp)(this.configuration).updateWebhook(requestParameters.updateWebhookRequest, requestParameters.webhookId).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.convertToFireblocksResponse);
    };
    return WebhooksV2Api;
}(base_1.BaseAPI));
exports.WebhooksV2Api = WebhooksV2Api;
/**
 * @export
 */
exports.GetMetricsMetricNameEnum = {
    LastActiveHourErrorRate: 'LAST_ACTIVE_HOUR_ERROR_RATE'
};
/**
 * @export
 */
exports.GetNotificationsOrderEnum = {
    Asc: 'ASC',
    Desc: 'DESC'
};
/**
 * @export
 */
exports.GetNotificationsSortByEnum = {
    Id: 'id',
    CreatedAt: 'createdAt',
    UpdatedAt: 'updatedAt',
    Status: 'status',
    EventType: 'eventType',
    ResourceId: 'resourceId'
};
/**
 * @export
 */
exports.GetWebhooksOrderEnum = {
    Asc: 'ASC',
    Desc: 'DESC'
};
//# sourceMappingURL=webhooks-v2-api.js.map