/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; /** * The employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ export const RehireUpdateRequestBodyEmploymentStatus = { PartTime: "part_time", FullTime: "full_time", PartTimeEligible: "part_time_eligible", Variable: "variable", Seasonal: "seasonal", NotSet: "not_set", } as const; /** * The employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ export type RehireUpdateRequestBodyEmploymentStatus = ClosedEnum< typeof RehireUpdateRequestBodyEmploymentStatus >; /** * Request body for updating an employee rehire. */ export type RehireUpdateRequestBody = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. */ version: string; /** * The day when the employee returns to work. */ effectiveDate: string; /** * The boolean flag indicating whether Gusto will file a new hire report for the employee. */ fileNewHireReport: boolean; /** * The uuid of the employee's work location. */ workLocationUuid: string; /** * The employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ employmentStatus?: RehireUpdateRequestBodyEmploymentStatus | undefined; /** * Whether the employee is a two percent shareholder of the company. This field only applies to companies with an S-Corp entity type. */ twoPercentShareholder?: boolean | undefined; }; /** @internal */ export const RehireUpdateRequestBodyEmploymentStatus$outboundSchema: z.ZodNativeEnum = z .nativeEnum(RehireUpdateRequestBodyEmploymentStatus); /** @internal */ export type RehireUpdateRequestBody$Outbound = { version: string; effective_date: string; file_new_hire_report: boolean; work_location_uuid: string; employment_status?: string | undefined; two_percent_shareholder?: boolean | undefined; }; /** @internal */ export const RehireUpdateRequestBody$outboundSchema: z.ZodType< RehireUpdateRequestBody$Outbound, z.ZodTypeDef, RehireUpdateRequestBody > = z.object({ version: z.string(), effectiveDate: z.string(), fileNewHireReport: z.boolean(), workLocationUuid: z.string(), employmentStatus: RehireUpdateRequestBodyEmploymentStatus$outboundSchema .optional(), twoPercentShareholder: z.boolean().optional(), }).transform((v) => { return remap$(v, { effectiveDate: "effective_date", fileNewHireReport: "file_new_hire_report", workLocationUuid: "work_location_uuid", employmentStatus: "employment_status", twoPercentShareholder: "two_percent_shareholder", }); }); export function rehireUpdateRequestBodyToJSON( rehireUpdateRequestBody: RehireUpdateRequestBody, ): string { return JSON.stringify( RehireUpdateRequestBody$outboundSchema.parse(rehireUpdateRequestBody), ); }