/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PhoneNumber, PhoneNumber$inboundSchema, PhoneNumber$Outbound, PhoneNumber$outboundSchema, } from "./phonenumber.js"; /** * Describes a guest account profile. */ export type GuestProfile = { /** * The name associated with the guest account. * * @remarks * This will default to "Guest {accountIDfirst8}" if no other name is provided. */ name: string; phone?: PhoneNumber | undefined; email?: string | undefined; }; /** @internal */ export const GuestProfile$inboundSchema: z.ZodType< GuestProfile, z.ZodTypeDef, unknown > = z.object({ name: z.string(), phone: PhoneNumber$inboundSchema.optional(), email: z.string().optional(), }); /** @internal */ export type GuestProfile$Outbound = { name: string; phone?: PhoneNumber$Outbound | undefined; email?: string | undefined; }; /** @internal */ export const GuestProfile$outboundSchema: z.ZodType< GuestProfile$Outbound, z.ZodTypeDef, GuestProfile > = z.object({ name: z.string(), phone: PhoneNumber$outboundSchema.optional(), email: z.string().optional(), }); export function guestProfileToJSON(guestProfile: GuestProfile): string { return JSON.stringify(GuestProfile$outboundSchema.parse(guestProfile)); } export function guestProfileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GuestProfile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GuestProfile' from JSON`, ); }