/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
import { feedbackList } from "../funcs/feedbackList.js";
import { combineSignals } from "../lib/primitives.js";
import { unwrapAsync } from "../types/fp.js";
import { useInkeepAnalyticsContext } from "./_context.js";
/**
 * Get All Feedback
 */
export function useFeedbackList(options) {
    const client = useInkeepAnalyticsContext();
    return useQuery({
        ...buildFeedbackListQuery(client, options),
        ...options,
    });
}
/**
 * Get All Feedback
 */
export function useFeedbackListSuspense(options) {
    const client = useInkeepAnalyticsContext();
    return useSuspenseQuery({
        ...buildFeedbackListQuery(client, options),
        ...options,
    });
}
export function prefetchFeedbackList(queryClient, client$) {
    return queryClient.prefetchQuery({
        ...buildFeedbackListQuery(client$),
    });
}
export function setFeedbackListData(client, data) {
    const key = queryKeyFeedbackList();
    return client.setQueryData(key, data);
}
export function invalidateAllFeedbackList(client, filters) {
    return client.invalidateQueries({
        ...filters,
        queryKey: ["@inkeep/inkeep-analytics", "feedback", "list"],
    });
}
export function buildFeedbackListQuery(client$, options) {
    return {
        queryKey: queryKeyFeedbackList(),
        queryFn: async function feedbackListQueryFn(ctx) {
            const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
            const mergedOptions = {
                ...options,
                fetchOptions: { ...options?.fetchOptions, signal: sig },
            };
            return unwrapAsync(feedbackList(client$, mergedOptions));
        },
    };
}
export function queryKeyFeedbackList() {
    return ["@inkeep/inkeep-analytics", "feedback", "list"];
}
//# sourceMappingURL=feedbackList.js.map