/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; import { GustoEmbeddedError } from "../models/errors/gustoembeddederror.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import { NotFoundErrorObject } from "../models/errors/notfounderrorobject.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { GetV1ContractorsContractorUuidMemberPortalInvitationsHeaderXGustoAPIVersion, GetV1ContractorsContractorUuidMemberPortalInvitationsRequest, } from "../models/operations/getv1contractorscontractoruuidmemberportalinvitations.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQuery, MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, prefetchMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations, queryKeyMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations, } from "./memberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations.core.js"; export { buildMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQuery, type MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, prefetchMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations, queryKeyMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations, }; export type MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryError = | NotFoundErrorObject | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get a contractor member portal invitation * * @remarks * Returns the current status of a contractor's member portal invitation (`pending`, `sent`, `verified`, `complete`, or `cancelled`) along with an `expired` flag indicating whether the invitation can still be acted on by the contractor. * * scope: `member_portal_invitation:read` */ export function useMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations( request: GetV1ContractorsContractorUuidMemberPortalInvitationsRequest, options?: QueryHookOptions< MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryError >, ): UseQueryResult< MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQuery( client, request, options, ), ...options, }); } /** * Get a contractor member portal invitation * * @remarks * Returns the current status of a contractor's member portal invitation (`pending`, `sent`, `verified`, `complete`, or `cancelled`) along with an `expired` flag indicating whether the invitation can still be acted on by the contractor. * * scope: `member_portal_invitation:read` */ export function useMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsSuspense( request: GetV1ContractorsContractorUuidMemberPortalInvitationsRequest, options?: SuspenseQueryHookOptions< MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryError >, ): UseSuspenseQueryResult< MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQuery( client, request, options, ), ...options, }); } export function setMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsData( client: QueryClient, queryKeyBase: [ contractorUuid: string, parameters: { xGustoAPIVersion?: | GetV1ContractorsContractorUuidMemberPortalInvitationsHeaderXGustoAPIVersion | undefined; }, ], data: MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData, ): | MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData | undefined { const key = queryKeyMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations( ...queryKeyBase, ); return client.setQueryData< MemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitationsQueryData >(key, data); } export function invalidateMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations( client: QueryClient, queryKeyBase: TupleToPrefixes< [ contractorUuid: string, parameters: { xGustoAPIVersion?: | GetV1ContractorsContractorUuidMemberPortalInvitationsHeaderXGustoAPIVersion | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api-v-2026-06-15", "Member Portal Invitations", "getV1ContractorsContractorUuidMemberPortalInvitations", ...queryKeyBase, ], }); } export function invalidateAllMemberPortalInvitationsGetV1ContractorsContractorUuidMemberPortalInvitations( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api-v-2026-06-15", "Member Portal Invitations", "getV1ContractorsContractorUuidMemberPortalInvitations", ], }); }