/* * 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 EmploymentHistoryListEmploymentStatus = { PartTime: "part_time", FullTime: "full_time", PartTimeEligible: "part_time_eligible", Variable: "variable", SeasonalNotSet: "seasonal - not_set", } as const; /** * The employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ export type EmploymentHistoryListEmploymentStatus = ClosedEnum< typeof EmploymentHistoryListEmploymentStatus >; /** * The representation of an employee's individual employements. */ export type EmploymentHistoryList = { /** * The employee's start day of work for an employment. */ hireDate?: string | undefined; /** * The employee's last day of work for an employment. */ terminationDate?: string | null | undefined; /** * The boolean flag indicating whether Gusto will file a new hire report for the employee. */ fileNewHireReport?: boolean | 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 employee's employment status. Supplying an invalid option will set the employment_status to *not_set*. */ employmentStatus?: EmploymentHistoryListEmploymentStatus | undefined; }; /** @internal */ export const EmploymentHistoryListEmploymentStatus$inboundSchema: z.ZodNativeEnum = z.nativeEnum( EmploymentHistoryListEmploymentStatus, ); /** @internal */ export const EmploymentHistoryList$inboundSchema: z.ZodType< EmploymentHistoryList, z.ZodTypeDef, unknown > = z.object({ hire_date: z.string().optional(), termination_date: z.nullable(z.string()).optional(), file_new_hire_report: z.boolean().optional(), two_percent_shareholder: z.boolean().optional(), employment_status: EmploymentHistoryListEmploymentStatus$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "hire_date": "hireDate", "termination_date": "terminationDate", "file_new_hire_report": "fileNewHireReport", "two_percent_shareholder": "twoPercentShareholder", "employment_status": "employmentStatus", }); }); export function employmentHistoryListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmploymentHistoryList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmploymentHistoryList' from JSON`, ); }