/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; import * as components from "../models/components/index.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.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 { buildComputeServicesListServicesQuery, ComputeServicesListServicesQueryData, prefetchComputeServicesListServices, queryKeyComputeServicesListServices, } from "./computeServicesListServices.core.js"; export { buildComputeServicesListServicesQuery, type ComputeServicesListServicesQueryData, prefetchComputeServicesListServices, queryKeyComputeServicesListServices, }; export type ComputeServicesListServicesQueryError = | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List services */ export function useComputeServicesListServices( request: operations.ListServicesRequest, options?: QueryHookOptions< ComputeServicesListServicesQueryData, ComputeServicesListServicesQueryError >, ): UseQueryResult< ComputeServicesListServicesQueryData, ComputeServicesListServicesQueryError > { const client = useSDKContext(); return useQuery({ ...buildComputeServicesListServicesQuery( client, request, options, ), ...options, }); } /** * List services */ export function useComputeServicesListServicesSuspense( request: operations.ListServicesRequest, options?: SuspenseQueryHookOptions< ComputeServicesListServicesQueryData, ComputeServicesListServicesQueryError >, ): UseSuspenseQueryResult< ComputeServicesListServicesQueryData, ComputeServicesListServicesQueryError > { const client = useSDKContext(); return useSuspenseQuery({ ...buildComputeServicesListServicesQuery( client, request, options, ), ...options, }); } export function setComputeServicesListServicesData( client: QueryClient, queryKeyBase: [ parameters: { state?: components.ComputeResourceState | undefined; cursor?: string | undefined; limit?: number | undefined; xOnBehalfOf?: string | undefined; }, ], data: ComputeServicesListServicesQueryData, ): ComputeServicesListServicesQueryData | undefined { const key = queryKeyComputeServicesListServices(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateComputeServicesListServices( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { state?: components.ComputeResourceState | undefined; cursor?: string | undefined; limit?: number | undefined; xOnBehalfOf?: string | undefined; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@meetkai/mka1", "Compute Services", "listServices", ...queryKeyBase, ], }); } export function invalidateAllComputeServicesListServices( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@meetkai/mka1", "Compute Services", "listServices"], }); }