/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The representation of an admin user in Gusto. */ export type Admin = { /** * The unique id of the admin. */ uuid: string; /** * The email of the admin for Gusto's system. */ email?: string | undefined; /** * The first name of the admin. */ firstName?: string | undefined; /** * The last name of the admin. */ lastName?: string | undefined; /** * The phone number of the admin. */ phone?: string | null | undefined; }; /** @internal */ export const Admin$inboundSchema: z.ZodType = z .object({ uuid: z.string(), email: z.string().optional(), first_name: z.string().optional(), last_name: z.string().optional(), phone: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", }); }); export function adminFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Admin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Admin' from JSON`, ); }