/* * 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 { GetV1EmployeesEmployeeIdBankAccountsHeaderXGustoAPIVersion, GetV1EmployeesEmployeeIdBankAccountsRequest, } from "../models/operations/getv1employeesemployeeidbankaccounts.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildEmployeePaymentMethodsGetBankAccountsQuery, EmployeePaymentMethodsGetBankAccountsQueryData, prefetchEmployeePaymentMethodsGetBankAccounts, queryKeyEmployeePaymentMethodsGetBankAccounts, } from "./employeePaymentMethodsGetBankAccounts.core.js"; export { buildEmployeePaymentMethodsGetBankAccountsQuery, type EmployeePaymentMethodsGetBankAccountsQueryData, prefetchEmployeePaymentMethodsGetBankAccounts, queryKeyEmployeePaymentMethodsGetBankAccounts, }; export type EmployeePaymentMethodsGetBankAccountsQueryError = | NotFoundErrorObject | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List employee bank accounts * * @remarks * Returns all employee bank accounts. * * scope: `employee_payment_methods:read` */ export function useEmployeePaymentMethodsGetBankAccounts( request: GetV1EmployeesEmployeeIdBankAccountsRequest, options?: QueryHookOptions< EmployeePaymentMethodsGetBankAccountsQueryData, EmployeePaymentMethodsGetBankAccountsQueryError >, ): UseQueryResult< EmployeePaymentMethodsGetBankAccountsQueryData, EmployeePaymentMethodsGetBankAccountsQueryError > { const client = useGustoEmbeddedContext(); return useQuery({ ...buildEmployeePaymentMethodsGetBankAccountsQuery( client, request, options, ), ...options, }); } /** * List employee bank accounts * * @remarks * Returns all employee bank accounts. * * scope: `employee_payment_methods:read` */ export function useEmployeePaymentMethodsGetBankAccountsSuspense( request: GetV1EmployeesEmployeeIdBankAccountsRequest, options?: SuspenseQueryHookOptions< EmployeePaymentMethodsGetBankAccountsQueryData, EmployeePaymentMethodsGetBankAccountsQueryError >, ): UseSuspenseQueryResult< EmployeePaymentMethodsGetBankAccountsQueryData, EmployeePaymentMethodsGetBankAccountsQueryError > { const client = useGustoEmbeddedContext(); return useSuspenseQuery({ ...buildEmployeePaymentMethodsGetBankAccountsQuery( client, request, options, ), ...options, }); } export function setEmployeePaymentMethodsGetBankAccountsData( client: QueryClient, queryKeyBase: [ employeeId: string, parameters: { xGustoAPIVersion?: | GetV1EmployeesEmployeeIdBankAccountsHeaderXGustoAPIVersion | undefined; page?: number | undefined; per?: number | undefined; }, ], data: EmployeePaymentMethodsGetBankAccountsQueryData, ): EmployeePaymentMethodsGetBankAccountsQueryData | undefined { const key = queryKeyEmployeePaymentMethodsGetBankAccounts(...queryKeyBase); return client.setQueryData( key, data, ); } export function invalidateEmployeePaymentMethodsGetBankAccounts( client: QueryClient, queryKeyBase: TupleToPrefixes< [ employeeId: string, parameters: { xGustoAPIVersion?: | GetV1EmployeesEmployeeIdBankAccountsHeaderXGustoAPIVersion | undefined; page?: number | undefined; per?: number | undefined; }, ] >, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "employeePaymentMethods", "getBankAccounts", ...queryKeyBase, ], }); } export function invalidateAllEmployeePaymentMethodsGetBankAccounts( client: QueryClient, filters?: Omit, ): Promise { return client.invalidateQueries({ ...filters, queryKey: [ "@gusto/embedded-api", "employeePaymentMethods", "getBankAccounts", ], }); }