/* * 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 { GetV1CompaniesCompanyUuidTaxRequirementsHeaderXGustoAPIVersion, GetV1CompaniesCompanyUuidTaxRequirementsRequest, } from "../models/operations/getv1companiescompanyuuidtaxrequirements.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildTaxRequirementsGetAllQuery, prefetchTaxRequirementsGetAll, queryKeyTaxRequirementsGetAll, TaxRequirementsGetAllQueryData, } from "./taxRequirementsGetAll.core.js"; export { buildTaxRequirementsGetAllQuery, prefetchTaxRequirementsGetAll, queryKeyTaxRequirementsGetAll, type TaxRequirementsGetAllQueryData, }; export type TaxRequirementsGetAllQueryError = | NotFoundErrorObject | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get all tax requirements for a company * * @remarks * Retrieves all states for which a company has tax requirements, along with a boolean indicating whether tax setup * is complete for each state. Use this to determine which states still need tax setup during company onboarding. * * scope: `company_tax_requirements:read` */ export function useTaxRequirementsGetAll( request: GetV1CompaniesCompanyUuidTaxRequirementsRequest, options?: QueryHookOptions< TaxRequirementsGetAllQueryData, TaxRequirementsGetAllQueryError >, ): UseQueryResult< TaxRequirementsGetAllQueryData, TaxRequirementsGetAllQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildTaxRequirementsGetAllQuery( client, request, options, ), ...options, }); } /** * Get all tax requirements for a company * * @remarks * Retrieves all states for which a company has tax requirements, along with a boolean indicating whether tax setup * is complete for each state. Use this to determine which states still need tax setup during company onboarding. * * scope: `company_tax_requirements:read` */ export function useTaxRequirementsGetAllSuspense( request: GetV1CompaniesCompanyUuidTaxRequirementsRequest, options?: SuspenseQueryHookOptions< TaxRequirementsGetAllQueryData, TaxRequirementsGetAllQueryError >, ): UseSuspenseQueryResult< TaxRequirementsGetAllQueryData, TaxRequirementsGetAllQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildTaxRequirementsGetAllQuery( client, request, options, ), ...options, }); } export function setTaxRequirementsGetAllData( client: QueryClient, queryKeyBase: [ companyUuid: string, parameters: { xGustoAPIVersion?: | GetV1CompaniesCompanyUuidTaxRequirementsHeaderXGustoAPIVersion | undefined; }, ], data: TaxRequirementsGetAllQueryData, ): TaxRequirementsGetAllQueryData | undefined { const key = queryKeyTaxRequirementsGetAll(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateTaxRequirementsGetAll( client: QueryClient, queryKeyBase: TupleToPrefixes< [ companyUuid: string, parameters: { xGustoAPIVersion?: | GetV1CompaniesCompanyUuidTaxRequirementsHeaderXGustoAPIVersion | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "taxRequirements", "getAll", ...queryKeyBase, ], }); } export function invalidateAllTaxRequirementsGetAll( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@gusto/embedded-api", "taxRequirements", "getAll"], }); }