/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import * as errors from "../models/errors/index.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKError } from "../models/errors/sdkerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { useSDKContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { AgentRunsGetAgentRunQueryData, buildAgentRunsGetAgentRunQuery, prefetchAgentRunsGetAgentRun, queryKeyAgentRunsGetAgentRun, } from "./agentRunsGetAgentRun.core.js"; export { type AgentRunsGetAgentRunQueryData, buildAgentRunsGetAgentRunQuery, prefetchAgentRunsGetAgentRun, queryKeyAgentRunsGetAgentRun, }; export type AgentRunsGetAgentRunQueryError = | errors.ErrorEnvelope | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve an agent run */ export function useAgentRunsGetAgentRun( request: operations.GetAgentRunRequest, options?: QueryHookOptions< AgentRunsGetAgentRunQueryData, AgentRunsGetAgentRunQueryError >, ): UseQueryResult< AgentRunsGetAgentRunQueryData, AgentRunsGetAgentRunQueryError > { const client = useSDKContext(); return useQuery({ ...buildAgentRunsGetAgentRunQuery( client, request, options, ), ...options, }); } /** * Retrieve an agent run */ export function useAgentRunsGetAgentRunSuspense( request: operations.GetAgentRunRequest, options?: SuspenseQueryHookOptions< AgentRunsGetAgentRunQueryData, AgentRunsGetAgentRunQueryError >, ): UseSuspenseQueryResult< AgentRunsGetAgentRunQueryData, AgentRunsGetAgentRunQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildAgentRunsGetAgentRunQuery( client, request, options, ), ...options, }); } export function setAgentRunsGetAgentRunData( client: QueryClient, queryKeyBase: [ agentId: string, runId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: AgentRunsGetAgentRunQueryData, ): AgentRunsGetAgentRunQueryData | undefined { const key = queryKeyAgentRunsGetAgentRun(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateAgentRunsGetAgentRun( client: QueryClient, queryKeyBase: TupleToPrefixes< [ agentId: string, runId: string, parameters: { xOnBehalfOf?: string | undefined }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "Agent Runs", "getAgentRun", ...queryKeyBase], }); } export function invalidateAllAgentRunsGetAgentRun( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "Agent Runs", "getAgentRun"], }); }