// (C) 2024-2026 GoodData Corporation
import globalAxios from 'axios';
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setSearchParams, toPathString, createRequestFunction } from './common.js';
// @ts-ignore
import { BASE_PATH, BaseAPI } from './base.js';
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Get latest in-platform notifications for the current user.
 * @summary Get latest notifications.
 * @param {string} [workspaceId] Workspace ID to filter notifications by.
 * @param {boolean} [isRead] Filter notifications by read status.
 * @param {string} [page] Zero-based page index (0..N)
 * @param {string} [size] The size of the page to be returned.
 * @param {Array<'total' | 'ALL'>} [metaInclude] Additional meta information to include in the response.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_GetNotifications(workspaceId, isRead, page, size, metaInclude, options = {}, configuration) {
    const localVarPath = `/api/v1/actions/notifications`;
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    if (workspaceId !== undefined) {
        localVarQueryParameter['workspaceId'] = workspaceId;
    }
    if (isRead !== undefined) {
        localVarQueryParameter['isRead'] = isRead;
    }
    if (page !== undefined) {
        localVarQueryParameter['page'] = page;
    }
    if (size !== undefined) {
        localVarQueryParameter['size'] = size;
    }
    if (metaInclude) {
        localVarQueryParameter['metaInclude'] = Array.from(metaInclude);
    }
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Mark in-platform notification by its ID as read.
 * @summary Mark notification as read.
 * @param {string} notificationId Notification ID to mark as read.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_MarkAsReadNotification(notificationId, options = {}, configuration) {
    // verify required parameter 'notificationId' is not null or undefined
    assertParamExists('markAsReadNotification', 'notificationId', notificationId);
    const localVarPath = `/api/v1/actions/notifications/{notificationId}/markAsRead`
        .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Mark all user in-platform notifications as read.
 * @summary Mark all notifications as read.
 * @param {string} [workspaceId] Workspace ID where to mark notifications as read.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_MarkAsReadNotificationAll(workspaceId, options = {}, configuration) {
    const localVarPath = `/api/v1/actions/notifications/markAsRead`;
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    if (workspaceId !== undefined) {
        localVarQueryParameter['workspaceId'] = workspaceId;
    }
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Tests the existing notification channel by sending a test notification.
 * @summary Test existing notification channel.
 * @param {string} notificationChannelId
 * @param {AutomationTestDestinationRequest} [automationTestDestinationRequest]
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_TestExistingNotificationChannel(notificationChannelId, automationTestDestinationRequest, options = {}, configuration) {
    // verify required parameter 'notificationChannelId' is not null or undefined
    assertParamExists('testExistingNotificationChannel', 'notificationChannelId', notificationChannelId);
    const localVarPath = `/api/v1/actions/notificationChannels/{notificationChannelId}/test`
        .replace(`{${"notificationChannelId"}}`, encodeURIComponent(String(notificationChannelId)));
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const consumes = [
        'application/json'
    ];
    // use application/json if present, otherwise fallback to the first one
    localVarHeaderParameter['Content-Type'] = consumes.includes('application/json')
        ? 'application/json'
        : consumes[0];
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    const needsSerialization = typeof automationTestDestinationRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(automationTestDestinationRequest !== undefined ? automationTestDestinationRequest : {})
        : automationTestDestinationRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Tests the notification channel by sending a test notification.
 * @summary Test notification channel.
 * @param {AutomationTestDestinationRequest} automationTestDestinationRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_TestNotificationChannel(automationTestDestinationRequest, options = {}, configuration) {
    // verify required parameter 'automationTestDestinationRequest' is not null or undefined
    assertParamExists('testNotificationChannel', 'automationTestDestinationRequest', automationTestDestinationRequest);
    const localVarPath = `/api/v1/actions/notificationChannels/test`;
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const consumes = [
        'application/json'
    ];
    // use application/json if present, otherwise fallback to the first one
    localVarHeaderParameter['Content-Type'] = consumes.includes('application/json')
        ? 'application/json'
        : consumes[0];
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    const needsSerialization = typeof automationTestDestinationRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(automationTestDestinationRequest !== undefined ? automationTestDestinationRequest : {})
        : automationTestDestinationRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Trigger the automation in the request.
 * @summary Trigger automation.
 * @param {string} workspaceId
 * @param {AutomationTriggerAutomationRequest} automationTriggerAutomationRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_TriggerAutomation(workspaceId, automationTriggerAutomationRequest, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('triggerAutomation', 'workspaceId', workspaceId);
    // verify required parameter 'automationTriggerAutomationRequest' is not null or undefined
    assertParamExists('triggerAutomation', 'automationTriggerAutomationRequest', automationTriggerAutomationRequest);
    const localVarPath = `/api/v1/actions/workspaces/{workspaceId}/automations/trigger`
        .replace(`{${"workspaceId"}}`, encodeURIComponent(String(workspaceId)));
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const consumes = [
        'application/json'
    ];
    // use application/json if present, otherwise fallback to the first one
    localVarHeaderParameter['Content-Type'] = consumes.includes('application/json')
        ? 'application/json'
        : consumes[0];
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    const needsSerialization = typeof automationTriggerAutomationRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(automationTriggerAutomationRequest !== undefined ? automationTriggerAutomationRequest : {})
        : automationTriggerAutomationRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation FP - ActionsAutomationAxiosParamCreator
/**
 * Trigger the existing automation to execute immediately.
 * @summary Trigger existing automation.
 * @param {string} workspaceId
 * @param {string} automationId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomationAxiosParamCreator_TriggerExistingAutomation(workspaceId, automationId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('triggerExistingAutomation', 'workspaceId', workspaceId);
    // verify required parameter 'automationId' is not null or undefined
    assertParamExists('triggerExistingAutomation', 'automationId', automationId);
    const localVarPath = `/api/v1/actions/workspaces/{workspaceId}/automations/{automationId}/trigger`
        .replace(`{${"workspaceId"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"automationId"}}`, encodeURIComponent(String(automationId)));
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ActionsAutomation Api FP
/**
 * Get latest in-platform notifications for the current user.
 * @summary Get latest notifications.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationGetNotificationsRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_GetNotifications(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_GetNotifications(requestParameters.workspaceId, requestParameters.isRead, requestParameters.page, requestParameters.size, requestParameters.metaInclude, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ActionsAutomation Api FP
/**
 * Mark in-platform notification by its ID as read.
 * @summary Mark notification as read.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationMarkAsReadNotificationRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_MarkAsReadNotification(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_MarkAsReadNotification(requestParameters.notificationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ActionsAutomation Api FP
/**
 * Mark all user in-platform notifications as read.
 * @summary Mark all notifications as read.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationMarkAsReadNotificationAllRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_MarkAsReadNotificationAll(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_MarkAsReadNotificationAll(requestParameters.workspaceId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ActionsAutomation Api FP
/**
 * Tests the existing notification channel by sending a test notification.
 * @summary Test existing notification channel.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationTestExistingNotificationChannelRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_TestExistingNotificationChannel(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_TestExistingNotificationChannel(requestParameters.notificationChannelId, requestParameters.automationTestDestinationRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ActionsAutomation Api FP
/**
 * Tests the notification channel by sending a test notification.
 * @summary Test notification channel.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationTestNotificationChannelRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_TestNotificationChannel(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_TestNotificationChannel(requestParameters.automationTestDestinationRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ActionsAutomation Api FP
/**
 * Trigger the automation in the request.
 * @summary Trigger automation.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationTriggerAutomationRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_TriggerAutomation(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_TriggerAutomation(requestParameters.workspaceId, requestParameters.automationTriggerAutomationRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ActionsAutomation Api FP
/**
 * Trigger the existing automation to execute immediately.
 * @summary Trigger existing automation.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ActionsAutomationTriggerExistingAutomationRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ActionsAutomation_TriggerExistingAutomation(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ActionsAutomationAxiosParamCreator_TriggerExistingAutomation(requestParameters.workspaceId, requestParameters.automationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * ActionsAutomation - object-oriented interface
 * @export
 * @class ActionsAutomation
 * @extends {BaseAPI}
 */
export class ActionsAutomation extends BaseAPI {
    /**
     * Get latest in-platform notifications for the current user.
     * @summary Get latest notifications.
     * @param {ActionsAutomationGetNotificationsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    getNotifications(requestParameters = {}, options) {
        return ActionsAutomation_GetNotifications(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Mark in-platform notification by its ID as read.
     * @summary Mark notification as read.
     * @param {ActionsAutomationMarkAsReadNotificationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    markAsReadNotification(requestParameters, options) {
        return ActionsAutomation_MarkAsReadNotification(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Mark all user in-platform notifications as read.
     * @summary Mark all notifications as read.
     * @param {ActionsAutomationMarkAsReadNotificationAllRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    markAsReadNotificationAll(requestParameters = {}, options) {
        return ActionsAutomation_MarkAsReadNotificationAll(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Tests the existing notification channel by sending a test notification.
     * @summary Test existing notification channel.
     * @param {ActionsAutomationTestExistingNotificationChannelRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    testExistingNotificationChannel(requestParameters, options) {
        return ActionsAutomation_TestExistingNotificationChannel(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Tests the notification channel by sending a test notification.
     * @summary Test notification channel.
     * @param {ActionsAutomationTestNotificationChannelRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    testNotificationChannel(requestParameters, options) {
        return ActionsAutomation_TestNotificationChannel(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Trigger the automation in the request.
     * @summary Trigger automation.
     * @param {ActionsAutomationTriggerAutomationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    triggerAutomation(requestParameters, options) {
        return ActionsAutomation_TriggerAutomation(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Trigger the existing automation to execute immediately.
     * @summary Trigger existing automation.
     * @param {ActionsAutomationTriggerExistingAutomationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ActionsAutomation
     */
    triggerExistingAutomation(requestParameters, options) {
        return ActionsAutomation_TriggerExistingAutomation(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// AutomationsAutomation FP - AutomationsAutomationAxiosParamCreator
/**
 * Trigger the automation in the request.
 * @summary Trigger automation.
 * @param {string} workspaceId
 * @param {AutomationTriggerAutomationRequest} automationTriggerAutomationRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function AutomationsAutomationAxiosParamCreator_TriggerAutomation(workspaceId, automationTriggerAutomationRequest, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('triggerAutomation', 'workspaceId', workspaceId);
    // verify required parameter 'automationTriggerAutomationRequest' is not null or undefined
    assertParamExists('triggerAutomation', 'automationTriggerAutomationRequest', automationTriggerAutomationRequest);
    const localVarPath = `/api/v1/actions/workspaces/{workspaceId}/automations/trigger`
        .replace(`{${"workspaceId"}}`, encodeURIComponent(String(workspaceId)));
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const consumes = [
        'application/json'
    ];
    // use application/json if present, otherwise fallback to the first one
    localVarHeaderParameter['Content-Type'] = consumes.includes('application/json')
        ? 'application/json'
        : consumes[0];
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    const needsSerialization = typeof automationTriggerAutomationRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(automationTriggerAutomationRequest !== undefined ? automationTriggerAutomationRequest : {})
        : automationTriggerAutomationRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// AutomationsAutomation FP - AutomationsAutomationAxiosParamCreator
/**
 * Trigger the existing automation to execute immediately.
 * @summary Trigger existing automation.
 * @param {string} workspaceId
 * @param {string} automationId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function AutomationsAutomationAxiosParamCreator_TriggerExistingAutomation(workspaceId, automationId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('triggerExistingAutomation', 'workspaceId', workspaceId);
    // verify required parameter 'automationId' is not null or undefined
    assertParamExists('triggerExistingAutomation', 'automationId', automationId);
    const localVarPath = `/api/v1/actions/workspaces/{workspaceId}/automations/{automationId}/trigger`
        .replace(`{${"workspaceId"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"automationId"}}`, encodeURIComponent(String(automationId)));
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// AutomationsAutomation Api FP
/**
 * Trigger the automation in the request.
 * @summary Trigger automation.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {AutomationsAutomationTriggerAutomationRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function AutomationsAutomation_TriggerAutomation(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await AutomationsAutomationAxiosParamCreator_TriggerAutomation(requestParameters.workspaceId, requestParameters.automationTriggerAutomationRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// AutomationsAutomation Api FP
/**
 * Trigger the existing automation to execute immediately.
 * @summary Trigger existing automation.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {AutomationsAutomationTriggerExistingAutomationRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function AutomationsAutomation_TriggerExistingAutomation(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await AutomationsAutomationAxiosParamCreator_TriggerExistingAutomation(requestParameters.workspaceId, requestParameters.automationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * AutomationsAutomation - object-oriented interface
 * @export
 * @class AutomationsAutomation
 * @extends {BaseAPI}
 */
export class AutomationsAutomation extends BaseAPI {
    /**
     * Trigger the automation in the request.
     * @summary Trigger automation.
     * @param {AutomationsAutomationTriggerAutomationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AutomationsAutomation
     */
    triggerAutomation(requestParameters, options) {
        return AutomationsAutomation_TriggerAutomation(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Trigger the existing automation to execute immediately.
     * @summary Trigger existing automation.
     * @param {AutomationsAutomationTriggerExistingAutomationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AutomationsAutomation
     */
    triggerExistingAutomation(requestParameters, options) {
        return AutomationsAutomation_TriggerExistingAutomation(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// NotificationChannelsAutomation FP - NotificationChannelsAutomationAxiosParamCreator
/**
 * Get latest in-platform notifications for the current user.
 * @summary Get latest notifications.
 * @param {string} [workspaceId] Workspace ID to filter notifications by.
 * @param {boolean} [isRead] Filter notifications by read status.
 * @param {string} [page] Zero-based page index (0..N)
 * @param {string} [size] The size of the page to be returned.
 * @param {Array<'total' | 'ALL'>} [metaInclude] Additional meta information to include in the response.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomationAxiosParamCreator_GetNotifications(workspaceId, isRead, page, size, metaInclude, options = {}, configuration) {
    const localVarPath = `/api/v1/actions/notifications`;
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    if (workspaceId !== undefined) {
        localVarQueryParameter['workspaceId'] = workspaceId;
    }
    if (isRead !== undefined) {
        localVarQueryParameter['isRead'] = isRead;
    }
    if (page !== undefined) {
        localVarQueryParameter['page'] = page;
    }
    if (size !== undefined) {
        localVarQueryParameter['size'] = size;
    }
    if (metaInclude) {
        localVarQueryParameter['metaInclude'] = Array.from(metaInclude);
    }
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// NotificationChannelsAutomation FP - NotificationChannelsAutomationAxiosParamCreator
/**
 * Mark in-platform notification by its ID as read.
 * @summary Mark notification as read.
 * @param {string} notificationId Notification ID to mark as read.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomationAxiosParamCreator_MarkAsReadNotification(notificationId, options = {}, configuration) {
    // verify required parameter 'notificationId' is not null or undefined
    assertParamExists('markAsReadNotification', 'notificationId', notificationId);
    const localVarPath = `/api/v1/actions/notifications/{notificationId}/markAsRead`
        .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// NotificationChannelsAutomation FP - NotificationChannelsAutomationAxiosParamCreator
/**
 * Mark all user in-platform notifications as read.
 * @summary Mark all notifications as read.
 * @param {string} [workspaceId] Workspace ID where to mark notifications as read.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomationAxiosParamCreator_MarkAsReadNotificationAll(workspaceId, options = {}, configuration) {
    const localVarPath = `/api/v1/actions/notifications/markAsRead`;
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    if (workspaceId !== undefined) {
        localVarQueryParameter['workspaceId'] = workspaceId;
    }
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// NotificationChannelsAutomation FP - NotificationChannelsAutomationAxiosParamCreator
/**
 * Tests the existing notification channel by sending a test notification.
 * @summary Test existing notification channel.
 * @param {string} notificationChannelId
 * @param {AutomationTestDestinationRequest} [automationTestDestinationRequest]
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomationAxiosParamCreator_TestExistingNotificationChannel(notificationChannelId, automationTestDestinationRequest, options = {}, configuration) {
    // verify required parameter 'notificationChannelId' is not null or undefined
    assertParamExists('testExistingNotificationChannel', 'notificationChannelId', notificationChannelId);
    const localVarPath = `/api/v1/actions/notificationChannels/{notificationChannelId}/test`
        .replace(`{${"notificationChannelId"}}`, encodeURIComponent(String(notificationChannelId)));
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const consumes = [
        'application/json'
    ];
    // use application/json if present, otherwise fallback to the first one
    localVarHeaderParameter['Content-Type'] = consumes.includes('application/json')
        ? 'application/json'
        : consumes[0];
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    const needsSerialization = typeof automationTestDestinationRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(automationTestDestinationRequest !== undefined ? automationTestDestinationRequest : {})
        : automationTestDestinationRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// NotificationChannelsAutomation FP - NotificationChannelsAutomationAxiosParamCreator
/**
 * Tests the notification channel by sending a test notification.
 * @summary Test notification channel.
 * @param {AutomationTestDestinationRequest} automationTestDestinationRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomationAxiosParamCreator_TestNotificationChannel(automationTestDestinationRequest, options = {}, configuration) {
    // verify required parameter 'automationTestDestinationRequest' is not null or undefined
    assertParamExists('testNotificationChannel', 'automationTestDestinationRequest', automationTestDestinationRequest);
    const localVarPath = `/api/v1/actions/notificationChannels/test`;
    // 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 };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const consumes = [
        'application/json'
    ];
    // use application/json if present, otherwise fallback to the first one
    localVarHeaderParameter['Content-Type'] = consumes.includes('application/json')
        ? 'application/json'
        : consumes[0];
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    const needsSerialization = typeof automationTestDestinationRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(automationTestDestinationRequest !== undefined ? automationTestDestinationRequest : {})
        : automationTestDestinationRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// NotificationChannelsAutomation Api FP
/**
 * Get latest in-platform notifications for the current user.
 * @summary Get latest notifications.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {NotificationChannelsAutomationGetNotificationsRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomation_GetNotifications(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await NotificationChannelsAutomationAxiosParamCreator_GetNotifications(requestParameters.workspaceId, requestParameters.isRead, requestParameters.page, requestParameters.size, requestParameters.metaInclude, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// NotificationChannelsAutomation Api FP
/**
 * Mark in-platform notification by its ID as read.
 * @summary Mark notification as read.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {NotificationChannelsAutomationMarkAsReadNotificationRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomation_MarkAsReadNotification(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await NotificationChannelsAutomationAxiosParamCreator_MarkAsReadNotification(requestParameters.notificationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// NotificationChannelsAutomation Api FP
/**
 * Mark all user in-platform notifications as read.
 * @summary Mark all notifications as read.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {NotificationChannelsAutomationMarkAsReadNotificationAllRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomation_MarkAsReadNotificationAll(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await NotificationChannelsAutomationAxiosParamCreator_MarkAsReadNotificationAll(requestParameters.workspaceId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// NotificationChannelsAutomation Api FP
/**
 * Tests the existing notification channel by sending a test notification.
 * @summary Test existing notification channel.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {NotificationChannelsAutomationTestExistingNotificationChannelRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomation_TestExistingNotificationChannel(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await NotificationChannelsAutomationAxiosParamCreator_TestExistingNotificationChannel(requestParameters.notificationChannelId, requestParameters.automationTestDestinationRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// NotificationChannelsAutomation Api FP
/**
 * Tests the notification channel by sending a test notification.
 * @summary Test notification channel.
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {NotificationChannelsAutomationTestNotificationChannelRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function NotificationChannelsAutomation_TestNotificationChannel(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await NotificationChannelsAutomationAxiosParamCreator_TestNotificationChannel(requestParameters.automationTestDestinationRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * NotificationChannelsAutomation - object-oriented interface
 * @export
 * @class NotificationChannelsAutomation
 * @extends {BaseAPI}
 */
export class NotificationChannelsAutomation extends BaseAPI {
    /**
     * Get latest in-platform notifications for the current user.
     * @summary Get latest notifications.
     * @param {NotificationChannelsAutomationGetNotificationsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NotificationChannelsAutomation
     */
    getNotifications(requestParameters = {}, options) {
        return NotificationChannelsAutomation_GetNotifications(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Mark in-platform notification by its ID as read.
     * @summary Mark notification as read.
     * @param {NotificationChannelsAutomationMarkAsReadNotificationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NotificationChannelsAutomation
     */
    markAsReadNotification(requestParameters, options) {
        return NotificationChannelsAutomation_MarkAsReadNotification(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Mark all user in-platform notifications as read.
     * @summary Mark all notifications as read.
     * @param {NotificationChannelsAutomationMarkAsReadNotificationAllRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NotificationChannelsAutomation
     */
    markAsReadNotificationAll(requestParameters = {}, options) {
        return NotificationChannelsAutomation_MarkAsReadNotificationAll(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Tests the existing notification channel by sending a test notification.
     * @summary Test existing notification channel.
     * @param {NotificationChannelsAutomationTestExistingNotificationChannelRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NotificationChannelsAutomation
     */
    testExistingNotificationChannel(requestParameters, options) {
        return NotificationChannelsAutomation_TestExistingNotificationChannel(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Tests the notification channel by sending a test notification.
     * @summary Test notification channel.
     * @param {NotificationChannelsAutomationTestNotificationChannelRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NotificationChannelsAutomation
     */
    testNotificationChannel(requestParameters, options) {
        return NotificationChannelsAutomation_TestNotificationChannel(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
//# sourceMappingURL=api.js.map