/* * 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 { GetV1CompaniesCompanyUuidTaxRequirementsStateHeaderXGustoAPIVersion, GetV1CompaniesCompanyUuidTaxRequirementsStateRequest, } from "../models/operations/getv1companiescompanyuuidtaxrequirementsstate.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildTaxRequirementsGetQuery, prefetchTaxRequirementsGet, queryKeyTaxRequirementsGet, TaxRequirementsGetQueryData, } from "./taxRequirementsGet.core.js"; export { buildTaxRequirementsGetQuery, prefetchTaxRequirementsGet, queryKeyTaxRequirementsGet, type TaxRequirementsGetQueryData, }; export type TaxRequirementsGetQueryError = | NotFoundErrorObject | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Get tax requirements for a state * * @remarks * Retrieves the detailed tax requirements for a specific state. The response includes requirement sets grouped by * category (e.g., registrations, tax rates, deposit schedules), each containing individual requirements with their * current values, labels, and metadata describing the expected input format. * * Use this to build dynamic UIs for tax setup or to read the current tax configuration for a state. * * scope: `company_tax_requirements:read` */ export function useTaxRequirementsGet( request: GetV1CompaniesCompanyUuidTaxRequirementsStateRequest, options?: QueryHookOptions< TaxRequirementsGetQueryData, TaxRequirementsGetQueryError >, ): UseQueryResult { const client = useGustoEmbeddedContext(); return useQuery({ ...buildTaxRequirementsGetQuery( client, request, options, ), ...options, }); } /** * Get tax requirements for a state * * @remarks * Retrieves the detailed tax requirements for a specific state. The response includes requirement sets grouped by * category (e.g., registrations, tax rates, deposit schedules), each containing individual requirements with their * current values, labels, and metadata describing the expected input format. * * Use this to build dynamic UIs for tax setup or to read the current tax configuration for a state. * * scope: `company_tax_requirements:read` */ export function useTaxRequirementsGetSuspense( request: GetV1CompaniesCompanyUuidTaxRequirementsStateRequest, options?: SuspenseQueryHookOptions< TaxRequirementsGetQueryData, TaxRequirementsGetQueryError >, ): UseSuspenseQueryResult< TaxRequirementsGetQueryData, TaxRequirementsGetQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildTaxRequirementsGetQuery( client, request, options, ), ...options, }); } export function setTaxRequirementsGetData( client: QueryClient, queryKeyBase: [ companyUuid: string, state: string, parameters: { xGustoAPIVersion?: | GetV1CompaniesCompanyUuidTaxRequirementsStateHeaderXGustoAPIVersion | undefined; scheduling?: boolean | undefined; }, ], data: TaxRequirementsGetQueryData, ): TaxRequirementsGetQueryData | undefined { const key = queryKeyTaxRequirementsGet(...queryKeyBase); return client.setQueryData(key, data); } export function invalidateTaxRequirementsGet( client: QueryClient, queryKeyBase: TupleToPrefixes< [ companyUuid: string, state: string, parameters: { xGustoAPIVersion?: | GetV1CompaniesCompanyUuidTaxRequirementsStateHeaderXGustoAPIVersion | undefined; scheduling?: boolean | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "taxRequirements", "get", ...queryKeyBase, ], }); } export function invalidateAllTaxRequirementsGet( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: ["@gusto/embedded-api", "taxRequirements", "get"], }); }