/* * 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"; /** * Bank account type */ export const EmployeeBankAccountAccountType = { Checking: "Checking", Savings: "Savings", } as const; /** * Bank account type */ export type EmployeeBankAccountAccountType = ClosedEnum< typeof EmployeeBankAccountAccountType >; export type EmployeeBankAccount = { /** * UUID of the bank account */ uuid: string; /** * UUID of the employee */ employeeUuid?: string | undefined; /** * Bank account type */ accountType?: EmployeeBankAccountAccountType | undefined; /** * Name for the bank account */ name?: string | undefined; /** * The bank account's routing number */ routingNumber?: string | undefined; /** * Masked bank account number */ hiddenAccountNumber?: string | undefined; }; /** @internal */ export const EmployeeBankAccountAccountType$inboundSchema: z.ZodNativeEnum< typeof EmployeeBankAccountAccountType > = z.nativeEnum(EmployeeBankAccountAccountType); /** @internal */ export const EmployeeBankAccount$inboundSchema: z.ZodType< EmployeeBankAccount, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), employee_uuid: z.string().optional(), account_type: EmployeeBankAccountAccountType$inboundSchema.optional(), name: z.string().optional(), routing_number: z.string().optional(), hidden_account_number: z.string().optional(), }).transform((v) => { return remap$(v, { "employee_uuid": "employeeUuid", "account_type": "accountType", "routing_number": "routingNumber", "hidden_account_number": "hiddenAccountNumber", }); }); export function employeeBankAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeBankAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeBankAccount' from JSON`, ); }