// (C) 2025-2026 GoodData Corporation
const toPathString = (url) => `${url.pathname}${url.search}${url.hash}`;
const buildUrlWithParams = (path, query) => {
    const url = new URL(path, "https://dummy-base.invalid");
    Object.entries(query).forEach(([key, value]) => {
        if (value === undefined || value === null) {
            return;
        }
        if (Array.isArray(value)) {
            value.forEach((item) => {
                url.searchParams.append(key, `${item}`);
            });
            return;
        }
        url.searchParams.set(key, `${value}`);
    });
    return toPathString(url);
};
export function AacApi_GetAnalyticsModelAac(axios, basePath, requestParameters, options = {}) {
    const path = `/api/v1/aac/workspaces/${encodeURIComponent(requestParameters.workspaceId)}/analyticsModel`;
    const url = `${basePath}${buildUrlWithParams(path, { exclude: requestParameters.exclude })}`;
    return axios.request({ ...options, method: "GET", url });
}
export function AacApi_SetAnalyticsModelAac(axios, basePath, requestParameters, options = {}) {
    const path = `/api/v1/aac/workspaces/${encodeURIComponent(requestParameters.workspaceId)}/analyticsModel`;
    const url = `${basePath}${path}`;
    return axios.request({
        ...options,
        method: "PUT",
        url,
        data: requestParameters.aacAnalyticsModel,
        headers: {
            "Content-Type": "application/json",
            // oxlint-disable-next-line typescript-eslint/no-misused-spread
            ...(options.headers ?? {}),
        },
    });
}
export function AacApi_GetLogicalModelAac(axios, basePath, requestParameters, options = {}) {
    const path = `/api/v1/aac/workspaces/${encodeURIComponent(requestParameters.workspaceId)}/logicalModel`;
    const url = `${basePath}${buildUrlWithParams(path, { includeParents: requestParameters.includeParents })}`;
    return axios.request({ ...options, method: "GET", url });
}
export function AacApi_SetLogicalModelAac(axios, basePath, requestParameters, options = {}) {
    const path = `/api/v1/aac/workspaces/${encodeURIComponent(requestParameters.workspaceId)}/logicalModel`;
    const url = `${basePath}${path}`;
    return axios.request({
        ...options,
        method: "PUT",
        url,
        data: requestParameters.aacLogicalModel,
        headers: {
            "Content-Type": "application/json",
            // oxlint-disable-next-line typescript-eslint/no-misused-spread
            ...(options.headers ?? {}),
        },
    });
}
//# sourceMappingURL=index.js.map