/* * 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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { UnprocessableEntityError } from "../models/errors/unprocessableentityerror.js"; import { GetV1SalaryEstimatesOccupationsHeaderXGustoAPIVersion, GetV1SalaryEstimatesOccupationsRequest, GetV1SalaryEstimatesOccupationsSecurity, } from "../models/operations/getv1salaryestimatesoccupations.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildSalaryEstimatesGetV1SalaryEstimatesOccupationsQuery, prefetchSalaryEstimatesGetV1SalaryEstimatesOccupations, queryKeySalaryEstimatesGetV1SalaryEstimatesOccupations, SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, } from "./salaryEstimatesGetV1SalaryEstimatesOccupations.core.js"; export { buildSalaryEstimatesGetV1SalaryEstimatesOccupationsQuery, prefetchSalaryEstimatesGetV1SalaryEstimatesOccupations, queryKeySalaryEstimatesGetV1SalaryEstimatesOccupations, type SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, }; export type SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryError = | UnprocessableEntityError | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Search for BLS occupations * * @remarks * Search for Bureau of Labor Statistics (BLS) occupations by name or keyword. This endpoint helps users find the appropriate occupation codes to use when creating or updating salary estimates. * * Returns a list of matching occupations with their codes, titles, and descriptions. * * 📘 System Access Authentication * * This endpoint uses the [Bearer Auth scheme with the system-level access token in the HTTP Authorization header](https://docs.gusto.com/embedded-payroll/docs/system-access) * * scope: `salary_estimates:read` */ export function useSalaryEstimatesGetV1SalaryEstimatesOccupations( security: GetV1SalaryEstimatesOccupationsSecurity, request: GetV1SalaryEstimatesOccupationsRequest, options?: QueryHookOptions< SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryError >, ): UseQueryResult< SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildSalaryEstimatesGetV1SalaryEstimatesOccupationsQuery( client, security, request, options, ), ...options, }); } /** * Search for BLS occupations * * @remarks * Search for Bureau of Labor Statistics (BLS) occupations by name or keyword. This endpoint helps users find the appropriate occupation codes to use when creating or updating salary estimates. * * Returns a list of matching occupations with their codes, titles, and descriptions. * * 📘 System Access Authentication * * This endpoint uses the [Bearer Auth scheme with the system-level access token in the HTTP Authorization header](https://docs.gusto.com/embedded-payroll/docs/system-access) * * scope: `salary_estimates:read` */ export function useSalaryEstimatesGetV1SalaryEstimatesOccupationsSuspense( security: GetV1SalaryEstimatesOccupationsSecurity, request: GetV1SalaryEstimatesOccupationsRequest, options?: SuspenseQueryHookOptions< SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryError >, ): UseSuspenseQueryResult< SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildSalaryEstimatesGetV1SalaryEstimatesOccupationsQuery( client, security, request, options, ), ...options, }); } export function setSalaryEstimatesGetV1SalaryEstimatesOccupationsData( client: QueryClient, queryKeyBase: [ parameters: { xGustoAPIVersion?: | GetV1SalaryEstimatesOccupationsHeaderXGustoAPIVersion | undefined; search: string; }, ], data: SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData, ): SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData | undefined { const key = queryKeySalaryEstimatesGetV1SalaryEstimatesOccupations( ...queryKeyBase, ); return client.setQueryData< SalaryEstimatesGetV1SalaryEstimatesOccupationsQueryData >(key, data); } export function invalidateSalaryEstimatesGetV1SalaryEstimatesOccupations( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { xGustoAPIVersion?: | GetV1SalaryEstimatesOccupationsHeaderXGustoAPIVersion | undefined; search: string; }] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "Salary Estimates", "getV1SalaryEstimatesOccupations", ...queryKeyBase, ], }); } export function invalidateAllSalaryEstimatesGetV1SalaryEstimatesOccupations( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "Salary Estimates", "getV1SalaryEstimatesOccupations", ], }); }