/* * 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 { GetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion, GetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest, } from "../models/operations/getv1partnermanagedcompaniescompanyuuidtermsofservice.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQuery, CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, prefetchCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService, queryKeyCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService, } from "./companiesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService.core.js"; export { buildCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQuery, type CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, prefetchCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService, queryKeyCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService, }; export type CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryError = | NotFoundErrorObject | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get the terms of service status for a company * * @remarks * Check if any company payroll admin has accepted the Gusto Embedded Payroll's [Terms of Service](https://flows.gusto.com/terms). * * This is useful for partners with multiple payroll admins who need to check TOS status at the company level rather than for a specific user. * * scope: `terms_of_services:read` */ export function useCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService( request: GetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest, options?: QueryHookOptions< CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryError >, ): UseQueryResult< CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQuery( client, request, options, ), ...options, }); } /** * Get the terms of service status for a company * * @remarks * Check if any company payroll admin has accepted the Gusto Embedded Payroll's [Terms of Service](https://flows.gusto.com/terms). * * This is useful for partners with multiple payroll admins who need to check TOS status at the company level rather than for a specific user. * * scope: `terms_of_services:read` */ export function useCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceSuspense( request: GetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceRequest, options?: SuspenseQueryHookOptions< CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryError >, ): UseSuspenseQueryResult< CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQuery( client, request, options, ), ...options, }); } export function setCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceData( client: QueryClient, queryKeyBase: [ companyUuid: string, parameters: { xGustoAPIVersion?: | GetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion | undefined; }, ], data: CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData, ): | CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData | undefined { const key = queryKeyCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService( ...queryKeyBase, ); return client.setQueryData< CompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceQueryData >(key, data); } export function invalidateCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService( client: QueryClient, queryKeyBase: TupleToPrefixes< [ companyUuid: string, parameters: { xGustoAPIVersion?: | GetV1PartnerManagedCompaniesCompanyUuidTermsOfServiceHeaderXGustoAPIVersion | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api-v-2026-06-15", "Companies", "getV1PartnerManagedCompaniesCompanyUuidTermsOfService", ...queryKeyBase, ], }); } export function invalidateAllCompaniesGetV1PartnerManagedCompaniesCompanyUuidTermsOfService( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api-v-2026-06-15", "Companies", "getV1PartnerManagedCompaniesCompanyUuidTermsOfService", ], }); }