/* * 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 { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ export const EmploymentStatus = { 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 EmploymentStatus = ClosedEnum; export type Rehire = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/versioning#object-layer) for information on how to use this field. */ version?: string | undefined; /** * The day when the employee returns to work. */ effectiveDate?: string | undefined; /** * The boolean flag indicating whether Gusto will file a new hire report for the employee. */ fileNewHireReport?: boolean | undefined; /** * The uuid of the employee's work location. */ workLocationUuid?: string | undefined; /** * The employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ employmentStatus?: EmploymentStatus | 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; /** * The UUID of the employee. */ employeeUuid?: string | undefined; /** * Whether the employee's rehire has gone into effect. */ active?: boolean | undefined; }; /** @internal */ export const EmploymentStatus$inboundSchema: z.ZodNativeEnum< typeof EmploymentStatus > = z.nativeEnum(EmploymentStatus); /** @internal */ export const Rehire$inboundSchema: z.ZodType = z .object({ version: z.string().optional(), effective_date: z.string().optional(), file_new_hire_report: z.boolean().optional(), work_location_uuid: z.string().optional(), employment_status: EmploymentStatus$inboundSchema.optional(), two_percent_shareholder: z.boolean().optional(), employee_uuid: z.string().optional(), active: z.boolean().optional(), }).transform((v) => { return remap$(v, { "effective_date": "effectiveDate", "file_new_hire_report": "fileNewHireReport", "work_location_uuid": "workLocationUuid", "employment_status": "employmentStatus", "two_percent_shareholder": "twoPercentShareholder", "employee_uuid": "employeeUuid", }); }); export function rehireFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Rehire$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Rehire' from JSON`, ); }