/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; import { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ResendTransactionWebhooksRequest } from '../models'; // @ts-ignore import { ResendWebhooksByTransactionIdResponse } from '../models'; // @ts-ignore import { ResendWebhooksResponse } from '../models'; /** * WebhooksApi - axios parameter creator * @export */ export const WebhooksApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Resends webhook notifications for a transaction by its unique identifier. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend webhooks for a transaction by ID * @param {ResendTransactionWebhooksRequest} resendTransactionWebhooksRequest * @param {string} txId The ID of the transaction for webhooks * @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} */ resendTransactionWebhooks: async (resendTransactionWebhooksRequest: ResendTransactionWebhooksRequest, txId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('resendTransactionWebhooks', 'resendTransactionWebhooksRequest', resendTransactionWebhooksRequest) assertParamExistsAndNotEmpty('resendTransactionWebhooks', 'txId', txId) const localVarPath = `/webhooks/resend/{txId}` .replace(`{${"txId"}}`, encodeURIComponent(String(txId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'resendTransactionWebhooks'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(resendTransactionWebhooksRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Resends all failed webhook notifications. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend failed webhooks * @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} */ resendWebhooks: async (idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/webhooks/resend`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'resendWebhooks'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * WebhooksApi - functional programming interface * @export */ export const WebhooksApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = WebhooksApiAxiosParamCreator(configuration) return { /** * Resends webhook notifications for a transaction by its unique identifier. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend webhooks for a transaction by ID * @param {ResendTransactionWebhooksRequest} resendTransactionWebhooksRequest * @param {string} txId The ID of the transaction for webhooks * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async resendTransactionWebhooks(resendTransactionWebhooksRequest: ResendTransactionWebhooksRequest, txId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendTransactionWebhooks(resendTransactionWebhooksRequest, txId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksApi.resendTransactionWebhooks']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Resends all failed webhook notifications. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend failed webhooks * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async resendWebhooks(idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendWebhooks(idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['WebhooksApi.resendWebhooks']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * WebhooksApi - factory interface * @export */ export const WebhooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = WebhooksApiFp(configuration) return { /** * Resends webhook notifications for a transaction by its unique identifier. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend webhooks for a transaction by ID * @param {WebhooksApiResendTransactionWebhooksRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendTransactionWebhooks(requestParameters: WebhooksApiResendTransactionWebhooksRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.resendTransactionWebhooks(requestParameters.resendTransactionWebhooksRequest, requestParameters.txId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Resends all failed webhook notifications. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend failed webhooks * @param {WebhooksApiResendWebhooksRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendWebhooks(requestParameters: WebhooksApiResendWebhooksRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.resendWebhooks(requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for resendTransactionWebhooks operation in WebhooksApi. * @export * @interface WebhooksApiResendTransactionWebhooksRequest */ export interface WebhooksApiResendTransactionWebhooksRequest { /** * * @type {ResendTransactionWebhooksRequest} * @memberof WebhooksApiResendTransactionWebhooks */ readonly resendTransactionWebhooksRequest: ResendTransactionWebhooksRequest /** * The ID of the transaction for webhooks * @type {string} * @memberof WebhooksApiResendTransactionWebhooks */ readonly txId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof WebhooksApiResendTransactionWebhooks */ readonly idempotencyKey?: string } /** * Request parameters for resendWebhooks operation in WebhooksApi. * @export * @interface WebhooksApiResendWebhooksRequest */ export interface WebhooksApiResendWebhooksRequest { /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof WebhooksApiResendWebhooks */ readonly idempotencyKey?: string } /** * WebhooksApi - object-oriented interface * @export * @class WebhooksApi * @extends {BaseAPI} */ export class WebhooksApi extends BaseAPI { /** * Resends webhook notifications for a transaction by its unique identifier. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). **Endpoint Permissions:** Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend webhooks for a transaction by ID * @param {WebhooksApiResendTransactionWebhooksRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksApi */ public resendTransactionWebhooks(requestParameters: WebhooksApiResendTransactionWebhooksRequest) { return WebhooksApiFp(this.configuration).resendTransactionWebhooks(requestParameters.resendTransactionWebhooksRequest, requestParameters.txId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Resends all failed webhook notifications. Learn more about Fireblocks Webhooks in the following [guide](https://developers.fireblocks.com/docs/configure-webhooks). Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor. * @summary Resend failed webhooks * @param {WebhooksApiResendWebhooksRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhooksApi */ public resendWebhooks(requestParameters: WebhooksApiResendWebhooksRequest = {}) { return WebhooksApiFp(this.configuration).resendWebhooks(requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }