/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { GustoEmbeddedCore } from "../core.js"; import { reportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWage } from "../funcs/reportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWage.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; 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 { UnprocessableEntityError } from "../models/errors/unprocessableentityerror.js"; import { PostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageRequest, PostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageResponse, } from "../models/operations/postv1companiescompanyidreportsemployeesannualficawage.js"; import { unwrapAsync } from "../types/fp.js"; import { useGustoEmbeddedContext } from "./_context.js"; import { MutationHookOptions } from "./_types.js"; export type ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationVariables = { request: PostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageRequest; options?: RequestOptions; }; export type ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationData = PostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageResponse; export type ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationError = | NotFoundErrorObject | UnprocessableEntityError | GustoEmbeddedError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Create an employees annual FICA wage report * * @remarks * Generates a report containing annual FICA (Federal Insurance Contributions Act) wage data for all employees in a company over a specified year range. * * This report provides detailed wage information subject to Social Security and Medicare taxes, useful for benefits integrations that need to verify employee earnings for compliance and benefit calculations. * * The report is generated asynchronously. After making this request, you will receive a `request_uuid` which can be used to poll the [Get a report](ref:get-v1-reports-request_uuid) endpoint to check the status and retrieve the report when complete. * * scope: `company_reports:write` */ export function useReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutation( options?: MutationHookOptions< ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationData, ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationError, ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationVariables >, ): UseMutationResult< ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationData, ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationError, ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationVariables > { const client = useGustoEmbeddedContext(); return useMutation({ ...buildReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutation( client, options, ), ...options, }); } export function mutationKeyReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWage(): MutationKey { return [ "@gusto/embedded-api", "Reports", "postV1CompaniesCompanyIdReportsEmployeesAnnualFicaWage", ]; } export function buildReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutation( client$: GustoEmbeddedCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationVariables, ) => Promise< ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationData >; } { return { mutationKey: mutationKeyReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWage(), mutationFn: function reportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationFn( { request, options, }, ): Promise< ReportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWageMutationData > { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync( reportsPostV1CompaniesCompanyIdReportsEmployeesAnnualFicaWage( client$, request, mergedOptions, ), ); }, }; }