// (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, COLLECTION_FORMATS, BaseAPI } from './base.js';
/**
 * Date granularity for date filters.
 */
export const AiDateGranularity = {
    DAY: 'DAY',
    WEEK: 'WEEK',
    MONTH: 'MONTH',
    QUARTER: 'QUARTER',
    YEAR: 'YEAR'
};
export const AiObjectType = {
    UNIDENTIFIED: 'unidentified',
    WORKSPACE: 'workspace',
    DATASET: 'dataset',
    DATE: 'date',
    FACT: 'fact',
    METRIC: 'metric',
    ATTRIBUTE: 'attribute',
    DATE_ATTRIBUTE: 'date_attribute',
    LABEL: 'label',
    VISUALIZATION: 'visualization',
    DASHBOARD: 'dashboard',
    FILTER_CONTEXT: 'filter_context'
};
// ConversationsAi FP - ConversationsAiAxiosParamCreator
/**
 *
 * @summary Delete Conversation
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAiAxiosParamCreator_DeleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete(workspaceId, conversationId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('deleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('deleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete', 'conversationId', conversationId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
    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,
    };
}
// ConversationsAi FP - ConversationsAiAxiosParamCreator
/**
 *
 * @summary Get Conversation
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAiAxiosParamCreator_GetConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet(workspaceId, conversationId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('getConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('getConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet', 'conversationId', conversationId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)));
    // 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 = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ConversationsAi FP - ConversationsAiAxiosParamCreator
/**
 *
 * @summary Get Conversations
 * @param {string} workspaceId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAiAxiosParamCreator_GetConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGet(workspaceId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('getConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGet', 'workspaceId', workspaceId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations`
        .replace(`{${"workspace_id"}}`, 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: 'GET', ...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,
    };
}
// ConversationsAi FP - ConversationsAiAxiosParamCreator
/**
 *
 * @summary Post Conversations
 * @param {string} workspaceId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAiAxiosParamCreator_PostConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPost(workspaceId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('postConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPost', 'workspaceId', workspaceId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations`
        .replace(`{${"workspace_id"}}`, 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 = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ConversationsAi Api FP
/**
 *
 * @summary Delete Conversation
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ConversationsAiDeleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDeleteRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAi_DeleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ConversationsAiAxiosParamCreator_DeleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete(requestParameters.workspaceId, requestParameters.conversationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ConversationsAi Api FP
/**
 *
 * @summary Get Conversation
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ConversationsAiGetConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGetRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAi_GetConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ConversationsAiAxiosParamCreator_GetConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet(requestParameters.workspaceId, requestParameters.conversationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ConversationsAi Api FP
/**
 *
 * @summary Get Conversations
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ConversationsAiGetConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGetRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAi_GetConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGet(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ConversationsAiAxiosParamCreator_GetConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGet(requestParameters.workspaceId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ConversationsAi Api FP
/**
 *
 * @summary Post Conversations
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ConversationsAiPostConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPostRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ConversationsAi_PostConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPost(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ConversationsAiAxiosParamCreator_PostConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPost(requestParameters.workspaceId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * ConversationsAi - object-oriented interface
 * @export
 * @class ConversationsAi
 * @extends {BaseAPI}
 */
export class ConversationsAi extends BaseAPI {
    /**
     *
     * @summary Delete Conversation
     * @param {ConversationsAiDeleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDeleteRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConversationsAi
     */
    deleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete(requestParameters, options) {
        return ConversationsAi_DeleteConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdDelete(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     *
     * @summary Get Conversation
     * @param {ConversationsAiGetConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConversationsAi
     */
    getConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet(requestParameters, options) {
        return ConversationsAi_GetConversationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdGet(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     *
     * @summary Get Conversations
     * @param {ConversationsAiGetConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConversationsAi
     */
    getConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGet(requestParameters, options) {
        return ConversationsAi_GetConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsGet(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     *
     * @summary Post Conversations
     * @param {ConversationsAiPostConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPostRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ConversationsAi
     */
    postConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPost(requestParameters, options) {
        return ConversationsAi_PostConversationsApiV1AiWorkspacesWorkspaceIdChatConversationsPost(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// ItemsAi FP - ItemsAiAxiosParamCreator
/**
 *
 * @summary Get Conversation Items
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ItemsAiAxiosParamCreator_GetConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet(workspaceId, conversationId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('getConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('getConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet', 'conversationId', conversationId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/items`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)));
    // 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 = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ItemsAi Api FP
/**
 *
 * @summary Get Conversation Items
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ItemsAiGetConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGetRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ItemsAi_GetConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ItemsAiAxiosParamCreator_GetConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet(requestParameters.workspaceId, requestParameters.conversationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * ItemsAi - object-oriented interface
 * @export
 * @class ItemsAi
 * @extends {BaseAPI}
 */
export class ItemsAi extends BaseAPI {
    /**
     *
     * @summary Get Conversation Items
     * @param {ItemsAiGetConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ItemsAi
     */
    getConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet(requestParameters, options) {
        return ItemsAi_GetConversationItemsApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdItemsGet(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Upload a new knowledge document. Returns 409 if filename already exists.
 * @summary Upload Document
 * @param {string} workspaceId
 * @param {File} file
 * @param {string} [title]
 * @param {Array<string>} [scopes]
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_CreateDocument(workspaceId, file, title, scopes, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('createDocument', 'workspaceId', workspaceId);
    // verify required parameter 'file' is not null or undefined
    assertParamExists('createDocument', 'file', file);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents`
        .replace(`{${"workspace_id"}}`, 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 localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
    if (file !== undefined) {
        localVarFormParams.append('file', file);
    }
    if (title !== undefined) {
        localVarFormParams.append('title', title);
    }
    if (scopes) {
        localVarFormParams.append('scopes', scopes.join(COLLECTION_FORMATS.csv));
    }
    localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    localVarRequestOptions.data = localVarFormParams;
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Delete a knowledge document and all its chunks.
 * @summary Delete Document
 * @param {string} workspaceId
 * @param {string} documentId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_DeleteDocument(workspaceId, documentId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('deleteDocument', 'workspaceId', workspaceId);
    // verify required parameter 'documentId' is not null or undefined
    assertParamExists('deleteDocument', 'documentId', documentId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents/{document_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"document_id"}}`, encodeURIComponent(String(documentId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
    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,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Download a knowledge document\'s raw file.
 * @summary Download Document
 * @param {string} workspaceId
 * @param {string} documentId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_DownloadDocument(workspaceId, documentId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('downloadDocument', 'workspaceId', workspaceId);
    // verify required parameter 'documentId' is not null or undefined
    assertParamExists('downloadDocument', 'documentId', documentId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents/{document_id}/download`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"document_id"}}`, encodeURIComponent(String(documentId)));
    // 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 = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Get a single knowledge document\'s metadata.
 * @summary Get Document
 * @param {string} workspaceId
 * @param {string} documentId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_GetDocument(workspaceId, documentId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('getDocument', 'workspaceId', workspaceId);
    // verify required parameter 'documentId' is not null or undefined
    assertParamExists('getDocument', 'documentId', documentId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents/{document_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"document_id"}}`, encodeURIComponent(String(documentId)));
    // 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 = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * List knowledge documents accessible from the workspace.
 * @summary List Documents
 * @param {string} workspaceId
 * @param {Array<string>} [scopes]
 * @param {number} [size]
 * @param {string} [pageToken]
 * @param {string} [metaInclude]
 * @param {'enabled' | 'disabled'} [state]
 * @param {string} [query]
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_ListDocuments(workspaceId, scopes, size, pageToken, metaInclude, state, query, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('listDocuments', 'workspaceId', workspaceId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents`
        .replace(`{${"workspace_id"}}`, 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: 'GET', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    if (scopes) {
        localVarQueryParameter['scopes'] = scopes;
    }
    if (size !== undefined) {
        localVarQueryParameter['size'] = size;
    }
    if (pageToken !== undefined) {
        localVarQueryParameter['pageToken'] = pageToken;
    }
    if (metaInclude !== undefined) {
        localVarQueryParameter['metaInclude'] = metaInclude;
    }
    if (state !== undefined) {
        localVarQueryParameter['state'] = state;
    }
    if (query !== undefined) {
        localVarQueryParameter['query'] = query;
    }
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Patch a knowledge document\'s metadata without re-uploading content.
 * @summary Patch Document
 * @param {string} workspaceId
 * @param {string} documentId
 * @param {AiPatchDocumentRequest} aiPatchDocumentRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_PatchDocument(workspaceId, documentId, aiPatchDocumentRequest, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('patchDocument', 'workspaceId', workspaceId);
    // verify required parameter 'documentId' is not null or undefined
    assertParamExists('patchDocument', 'documentId', documentId);
    // verify required parameter 'aiPatchDocumentRequest' is not null or undefined
    assertParamExists('patchDocument', 'aiPatchDocumentRequest', aiPatchDocumentRequest);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents/{document_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"document_id"}}`, encodeURIComponent(String(documentId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options };
    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 aiPatchDocumentRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(aiPatchDocumentRequest !== undefined ? aiPatchDocumentRequest : {})
        : aiPatchDocumentRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Search the knowledge base using semantic similarity.
 * @summary Search Documents
 * @param {string} workspaceId
 * @param {string} query
 * @param {number} [limit]
 * @param {number} [minScore]
 * @param {Array<string>} [scopes]
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_SearchKnowledge(workspaceId, query, limit, minScore, scopes, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('searchKnowledge', 'workspaceId', workspaceId);
    // verify required parameter 'query' is not null or undefined
    assertParamExists('searchKnowledge', 'query', query);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/search`
        .replace(`{${"workspace_id"}}`, 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: 'GET', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    if (query !== undefined) {
        localVarQueryParameter['query'] = query;
    }
    if (limit !== undefined) {
        localVarQueryParameter['limit'] = limit;
    }
    if (minScore !== undefined) {
        localVarQueryParameter['minScore'] = minScore;
    }
    if (scopes) {
        localVarQueryParameter['scopes'] = scopes;
    }
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi FP - KnowledgeAiAxiosParamCreator
/**
 * Upload or replace a knowledge document.
 * @summary Upsert Document
 * @param {string} workspaceId
 * @param {File} file
 * @param {string} [title]
 * @param {Array<string>} [scopes]
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAiAxiosParamCreator_UpsertDocument(workspaceId, file, title, scopes, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('upsertDocument', 'workspaceId', workspaceId);
    // verify required parameter 'file' is not null or undefined
    assertParamExists('upsertDocument', 'file', file);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/knowledge/documents`
        .replace(`{${"workspace_id"}}`, 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: 'PUT', ...baseOptions, ...options };
    const localVarHeaderParameter = {};
    const localVarQueryParameter = {};
    const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
    if (file !== undefined) {
        localVarFormParams.append('file', file);
    }
    if (title !== undefined) {
        localVarFormParams.append('title', title);
    }
    if (scopes) {
        localVarFormParams.append('scopes', scopes.join(COLLECTION_FORMATS.csv));
    }
    localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    localVarRequestOptions.data = localVarFormParams;
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// KnowledgeAi Api FP
/**
 * Upload a new knowledge document. Returns 409 if filename already exists.
 * @summary Upload Document
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiCreateDocumentRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_CreateDocument(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_CreateDocument(requestParameters.workspaceId, requestParameters.file, requestParameters.title, requestParameters.scopes, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * Delete a knowledge document and all its chunks.
 * @summary Delete Document
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiDeleteDocumentRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_DeleteDocument(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_DeleteDocument(requestParameters.workspaceId, requestParameters.documentId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * Download a knowledge document\'s raw file.
 * @summary Download Document
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiDownloadDocumentRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_DownloadDocument(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_DownloadDocument(requestParameters.workspaceId, requestParameters.documentId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * Get a single knowledge document\'s metadata.
 * @summary Get Document
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiGetDocumentRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_GetDocument(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_GetDocument(requestParameters.workspaceId, requestParameters.documentId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * List knowledge documents accessible from the workspace.
 * @summary List Documents
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiListDocumentsRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_ListDocuments(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_ListDocuments(requestParameters.workspaceId, requestParameters.scopes, requestParameters.size, requestParameters.pageToken, requestParameters.metaInclude, requestParameters.state, requestParameters.query, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * Patch a knowledge document\'s metadata without re-uploading content.
 * @summary Patch Document
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiPatchDocumentRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_PatchDocument(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_PatchDocument(requestParameters.workspaceId, requestParameters.documentId, requestParameters.aiPatchDocumentRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * Search the knowledge base using semantic similarity.
 * @summary Search Documents
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiSearchKnowledgeRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_SearchKnowledge(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_SearchKnowledge(requestParameters.workspaceId, requestParameters.query, requestParameters.limit, requestParameters.minScore, requestParameters.scopes, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// KnowledgeAi Api FP
/**
 * Upload or replace a knowledge document.
 * @summary Upsert Document
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {KnowledgeAiUpsertDocumentRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function KnowledgeAi_UpsertDocument(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await KnowledgeAiAxiosParamCreator_UpsertDocument(requestParameters.workspaceId, requestParameters.file, requestParameters.title, requestParameters.scopes, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * KnowledgeAi - object-oriented interface
 * @export
 * @class KnowledgeAi
 * @extends {BaseAPI}
 */
export class KnowledgeAi extends BaseAPI {
    /**
     * Upload a new knowledge document. Returns 409 if filename already exists.
     * @summary Upload Document
     * @param {KnowledgeAiCreateDocumentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    createDocument(requestParameters, options) {
        return KnowledgeAi_CreateDocument(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Delete a knowledge document and all its chunks.
     * @summary Delete Document
     * @param {KnowledgeAiDeleteDocumentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    deleteDocument(requestParameters, options) {
        return KnowledgeAi_DeleteDocument(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Download a knowledge document\'s raw file.
     * @summary Download Document
     * @param {KnowledgeAiDownloadDocumentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    downloadDocument(requestParameters, options) {
        return KnowledgeAi_DownloadDocument(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Get a single knowledge document\'s metadata.
     * @summary Get Document
     * @param {KnowledgeAiGetDocumentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    getDocument(requestParameters, options) {
        return KnowledgeAi_GetDocument(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * List knowledge documents accessible from the workspace.
     * @summary List Documents
     * @param {KnowledgeAiListDocumentsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    listDocuments(requestParameters, options) {
        return KnowledgeAi_ListDocuments(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Patch a knowledge document\'s metadata without re-uploading content.
     * @summary Patch Document
     * @param {KnowledgeAiPatchDocumentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    patchDocument(requestParameters, options) {
        return KnowledgeAi_PatchDocument(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Search the knowledge base using semantic similarity.
     * @summary Search Documents
     * @param {KnowledgeAiSearchKnowledgeRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    searchKnowledge(requestParameters, options) {
        return KnowledgeAi_SearchKnowledge(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     * Upload or replace a knowledge document.
     * @summary Upsert Document
     * @param {KnowledgeAiUpsertDocumentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof KnowledgeAi
     */
    upsertDocument(requestParameters, options) {
        return KnowledgeAi_UpsertDocument(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// MessagesAi FP - MessagesAiAxiosParamCreator
/**
 *
 * @summary Post Messages
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {AiSendMessageRequest} aiSendMessageRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function MessagesAiAxiosParamCreator_PostMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost(workspaceId, conversationId, aiSendMessageRequest, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('postMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('postMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost', 'conversationId', conversationId);
    // verify required parameter 'aiSendMessageRequest' is not null or undefined
    assertParamExists('postMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost', 'aiSendMessageRequest', aiSendMessageRequest);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/messages`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)));
    // 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 aiSendMessageRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(aiSendMessageRequest !== undefined ? aiSendMessageRequest : {})
        : aiSendMessageRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// MessagesAi Api FP
/**
 *
 * @summary Post Messages
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {MessagesAiPostMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPostRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function MessagesAi_PostMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await MessagesAiAxiosParamCreator_PostMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost(requestParameters.workspaceId, requestParameters.conversationId, requestParameters.aiSendMessageRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * MessagesAi - object-oriented interface
 * @export
 * @class MessagesAi
 * @extends {BaseAPI}
 */
export class MessagesAi extends BaseAPI {
    /**
     *
     * @summary Post Messages
     * @param {MessagesAiPostMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPostRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesAi
     */
    postMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost(requestParameters, options) {
        return MessagesAi_PostMessagesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdMessagesPost(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// ResponsesAi FP - ResponsesAiAxiosParamCreator
/**
 *
 * @summary Get Conversation Responses
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ResponsesAiAxiosParamCreator_GetConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet(workspaceId, conversationId, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('getConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('getConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet', 'conversationId', conversationId);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/responses`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)));
    // 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 = {};
    setSearchParams(localVarUrlObj, localVarQueryParameter);
    const headersFromBaseOptions = baseOptions?.headers ? baseOptions.headers : {};
    localVarRequestOptions.headers = {
        ...localVarHeaderParameter,
        ...headersFromBaseOptions,
        ...options.headers,
    };
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ResponsesAi FP - ResponsesAiAxiosParamCreator
/**
 *
 * @summary Patch Response
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {string} responseId
 * @param {AiResponseFeedbackRequest} aiResponseFeedbackRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ResponsesAiAxiosParamCreator_PatchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch(workspaceId, conversationId, responseId, aiResponseFeedbackRequest, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('patchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('patchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch', 'conversationId', conversationId);
    // verify required parameter 'responseId' is not null or undefined
    assertParamExists('patchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch', 'responseId', responseId);
    // verify required parameter 'aiResponseFeedbackRequest' is not null or undefined
    assertParamExists('patchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch', 'aiResponseFeedbackRequest', aiResponseFeedbackRequest);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/responses/{response_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)))
        .replace(`{${"response_id"}}`, encodeURIComponent(String(responseId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options };
    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 aiResponseFeedbackRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(aiResponseFeedbackRequest !== undefined ? aiResponseFeedbackRequest : {})
        : aiResponseFeedbackRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// ResponsesAi Api FP
/**
 *
 * @summary Get Conversation Responses
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ResponsesAiGetConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGetRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ResponsesAi_GetConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ResponsesAiAxiosParamCreator_GetConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet(requestParameters.workspaceId, requestParameters.conversationId, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
// ResponsesAi Api FP
/**
 *
 * @summary Patch Response
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {ResponsesAiPatchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatchRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function ResponsesAi_PatchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await ResponsesAiAxiosParamCreator_PatchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch(requestParameters.workspaceId, requestParameters.conversationId, requestParameters.responseId, requestParameters.aiResponseFeedbackRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * ResponsesAi - object-oriented interface
 * @export
 * @class ResponsesAi
 * @extends {BaseAPI}
 */
export class ResponsesAi extends BaseAPI {
    /**
     *
     * @summary Get Conversation Responses
     * @param {ResponsesAiGetConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ResponsesAi
     */
    getConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet(requestParameters, options) {
        return ResponsesAi_GetConversationResponsesApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesGet(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
    /**
     *
     * @summary Patch Response
     * @param {ResponsesAiPatchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatchRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ResponsesAi
     */
    patchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch(requestParameters, options) {
        return ResponsesAi_PatchResponseApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdResponsesResponseIdPatch(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
// VisualizationsAi FP - VisualizationsAiAxiosParamCreator
/**
 *
 * @summary Patch Visualization
 * @param {string} workspaceId
 * @param {string} conversationId
 * @param {string} visualizationId
 * @param {AiVisualizationIdUpdateRequest} aiVisualizationIdUpdateRequest
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function VisualizationsAiAxiosParamCreator_PatchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch(workspaceId, conversationId, visualizationId, aiVisualizationIdUpdateRequest, options = {}, configuration) {
    // verify required parameter 'workspaceId' is not null or undefined
    assertParamExists('patchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch', 'workspaceId', workspaceId);
    // verify required parameter 'conversationId' is not null or undefined
    assertParamExists('patchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch', 'conversationId', conversationId);
    // verify required parameter 'visualizationId' is not null or undefined
    assertParamExists('patchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch', 'visualizationId', visualizationId);
    // verify required parameter 'aiVisualizationIdUpdateRequest' is not null or undefined
    assertParamExists('patchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch', 'aiVisualizationIdUpdateRequest', aiVisualizationIdUpdateRequest);
    const localVarPath = `/api/v1/ai/workspaces/{workspace_id}/chat/conversations/{conversation_id}/visualizations/{visualization_id}`
        .replace(`{${"workspace_id"}}`, encodeURIComponent(String(workspaceId)))
        .replace(`{${"conversation_id"}}`, encodeURIComponent(String(conversationId)))
        .replace(`{${"visualization_id"}}`, encodeURIComponent(String(visualizationId)));
    // use dummy base URL string because the URL constructor only accepts absolute URLs.
    const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
    let baseOptions;
    if (configuration) {
        baseOptions = configuration.baseOptions;
    }
    const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options };
    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 aiVisualizationIdUpdateRequest !== "string" ||
        localVarRequestOptions.headers["Content-Type"] === "application/json";
    localVarRequestOptions.data = needsSerialization
        ? JSON.stringify(aiVisualizationIdUpdateRequest !== undefined ? aiVisualizationIdUpdateRequest : {})
        : aiVisualizationIdUpdateRequest || "";
    return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
    };
}
// VisualizationsAi Api FP
/**
 *
 * @summary Patch Visualization
 * @param {AxiosInstance} axios Axios instance.
 * @param {string} basePath Base path.
 * @param {VisualizationsAiPatchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatchRequest} requestParameters Request parameters.
 * @param {*} [options] Override http request option.
 * @param {Configuration} [configuration] Optional configuration.
 * @throws {RequiredError}
 */
export async function VisualizationsAi_PatchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch(axios, basePath, requestParameters, options, configuration) {
    const localVarAxiosArgs = await VisualizationsAiAxiosParamCreator_PatchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch(requestParameters.workspaceId, requestParameters.conversationId, requestParameters.visualizationId, requestParameters.aiVisualizationIdUpdateRequest, options || {}, configuration);
    return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, basePath);
}
/**
 * VisualizationsAi - object-oriented interface
 * @export
 * @class VisualizationsAi
 * @extends {BaseAPI}
 */
export class VisualizationsAi extends BaseAPI {
    /**
     *
     * @summary Patch Visualization
     * @param {VisualizationsAiPatchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatchRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof VisualizationsAi
     */
    patchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch(requestParameters, options) {
        return VisualizationsAi_PatchVisualizationApiV1AiWorkspacesWorkspaceIdChatConversationsConversationIdVisualizationsVisualizationIdPatch(this.axios, this.basePath, requestParameters, options, this.configuration);
    }
}
//# sourceMappingURL=api.js.map