/* * 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 { AgentSchedulesGetAgentScheduleQueryData, buildAgentSchedulesGetAgentScheduleQuery, prefetchAgentSchedulesGetAgentSchedule, queryKeyAgentSchedulesGetAgentSchedule, } from "./agentSchedulesGetAgentSchedule.core.js"; export { type AgentSchedulesGetAgentScheduleQueryData, buildAgentSchedulesGetAgentScheduleQuery, prefetchAgentSchedulesGetAgentSchedule, queryKeyAgentSchedulesGetAgentSchedule, }; export type AgentSchedulesGetAgentScheduleQueryError = | errors.ErrorEnvelope | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve an agent schedule */ export function useAgentSchedulesGetAgentSchedule( request: operations.GetAgentScheduleRequest, options?: QueryHookOptions< AgentSchedulesGetAgentScheduleQueryData, AgentSchedulesGetAgentScheduleQueryError >, ): UseQueryResult< AgentSchedulesGetAgentScheduleQueryData, AgentSchedulesGetAgentScheduleQueryError > { const client = useSDKContext(); return useQuery({ ...buildAgentSchedulesGetAgentScheduleQuery( client, request, options, ), ...options, }); } /** * Retrieve an agent schedule */ export function useAgentSchedulesGetAgentScheduleSuspense( request: operations.GetAgentScheduleRequest, options?: SuspenseQueryHookOptions< AgentSchedulesGetAgentScheduleQueryData, AgentSchedulesGetAgentScheduleQueryError >, ): UseSuspenseQueryResult< AgentSchedulesGetAgentScheduleQueryData, AgentSchedulesGetAgentScheduleQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildAgentSchedulesGetAgentScheduleQuery( client, request, options, ), ...options, }); } export function setAgentSchedulesGetAgentScheduleData( client: QueryClient, queryKeyBase: [ agentId: string, scheduleId: string, parameters: { xOnBehalfOf?: string | undefined }, ], data: AgentSchedulesGetAgentScheduleQueryData, ): AgentSchedulesGetAgentScheduleQueryData | undefined { const key = queryKeyAgentSchedulesGetAgentSchedule(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateAgentSchedulesGetAgentSchedule( client: QueryClient, queryKeyBase: TupleToPrefixes< [ agentId: string, scheduleId: string, parameters: { xOnBehalfOf?: string | undefined }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "Agent Schedules", "getAgentSchedule", ...queryKeyBase, ], }); } export function invalidateAllAgentSchedulesGetAgentSchedule( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "Agent Schedules", "getAgentSchedule"], }); }