/* * 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 payment method for the pay stub. */ export const EmployeePayStubsListPaymentMethod = { DirectDeposit: "Direct Deposit", Check: "Check", } as const; /** * The payment method for the pay stub. */ export type EmployeePayStubsListPaymentMethod = ClosedEnum< typeof EmployeePayStubsListPaymentMethod >; /** * The representation of an employee pay stub information. */ export type EmployeePayStubsList = { /** * The UUID of the employee pay stub. */ uuid: string; /** * The check date of the pay stub. */ checkDate?: string | undefined; /** * The gross pay amount for the pay stub. */ grossPay?: string | undefined; /** * The net pay amount for the pay stub. */ netPay?: string | undefined; /** * A unique identifier of the payroll to which the pay stub belongs. */ payrollUuid?: string | undefined; /** * The check amount for the pay stub. */ checkAmount?: string | undefined; /** * The payment method for the pay stub. */ paymentMethod?: EmployeePayStubsListPaymentMethod | undefined; }; /** @internal */ export const EmployeePayStubsListPaymentMethod$inboundSchema: z.ZodNativeEnum< typeof EmployeePayStubsListPaymentMethod > = z.nativeEnum(EmployeePayStubsListPaymentMethod); /** @internal */ export const EmployeePayStubsList$inboundSchema: z.ZodType< EmployeePayStubsList, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), check_date: z.string().optional(), gross_pay: z.string().optional(), net_pay: z.string().optional(), payroll_uuid: z.string().optional(), check_amount: z.string().optional(), payment_method: EmployeePayStubsListPaymentMethod$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "check_date": "checkDate", "gross_pay": "grossPay", "net_pay": "netPay", "payroll_uuid": "payrollUuid", "check_amount": "checkAmount", "payment_method": "paymentMethod", }); }); export function employeePayStubsListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeePayStubsList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeePayStubsList' from JSON`, ); }