"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.useQueryConversationsMutation = useQueryConversationsMutation;
exports.mutationKeyQueryConversations = mutationKeyQueryConversations;
exports.buildQueryConversationsMutation = buildQueryConversationsMutation;
const react_query_1 = require("@tanstack/react-query");
const queryConversations_js_1 = require("../funcs/queryConversations.js");
const primitives_js_1 = require("../lib/primitives.js");
const fp_js_1 = require("../types/fp.js");
const _context_js_1 = require("./_context.js");
/**
 * Query Conversations
 */
function useQueryConversationsMutation(options) {
    const client = (0, _context_js_1.useInkeepAnalyticsContext)();
    return (0, react_query_1.useMutation)({
        ...buildQueryConversationsMutation(client, options),
        ...options,
    });
}
function mutationKeyQueryConversations() {
    return ["@inkeep/inkeep-analytics", "Query", "conversations"];
}
function buildQueryConversationsMutation(client$, hookOptions) {
    return {
        mutationKey: mutationKeyQueryConversations(),
        mutationFn: function queryConversationsMutationFn({ request, options, }) {
            const mergedOptions = {
                ...hookOptions,
                ...options,
                fetchOptions: {
                    ...hookOptions?.fetchOptions,
                    ...options?.fetchOptions,
                    signal: (0, primitives_js_1.combineSignals)(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
                },
            };
            return (0, fp_js_1.unwrapAsync)((0, queryConversations_js_1.queryConversations)(client$, request, mergedOptions));
        },
    };
}
//# sourceMappingURL=queryConversations.js.map