/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The employee this entity is linked to. */ export type LinkedEmployee = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The display ID of the employee. For best performance, send this field (the employee number) instead of the GUID in the id field. */ displayId?: string | null | undefined; /** * The display name of the employee. */ displayName?: string | null | undefined; }; /** @internal */ export const LinkedEmployee$inboundSchema: z.ZodType< LinkedEmployee, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), display_id: z.nullable(types.string()).optional(), display_name: z.nullable(types.string()).optional(), }).transform((v) => { return remap$(v, { "display_id": "displayId", "display_name": "displayName", }); }) ); /** @internal */ export type LinkedEmployee$Outbound = { id?: string | undefined; display_id?: string | null | undefined; display_name?: string | null | undefined; }; /** @internal */ export const LinkedEmployee$outboundSchema: z.ZodType< LinkedEmployee$Outbound, z.ZodTypeDef, LinkedEmployee > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string().optional(), displayId: z.nullable(z.string()).optional(), displayName: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { displayId: "display_id", displayName: "display_name", }); }) ); export function linkedEmployeeToJSON(linkedEmployee: LinkedEmployee): string { return JSON.stringify(LinkedEmployee$outboundSchema.parse(linkedEmployee)); } export function linkedEmployeeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedEmployee$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedEmployee' from JSON`, ); }