/* * 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"; export type TicketContact = { email: string; name?: string | undefined; }; /** @internal */ export const TicketContact$inboundSchema: z.ZodType< TicketContact, z.ZodTypeDef, unknown > = z.object({ email: z.string(), name: z.string().optional(), }); /** @internal */ export type TicketContact$Outbound = { email: string; name?: string | undefined; }; /** @internal */ export const TicketContact$outboundSchema: z.ZodType< TicketContact$Outbound, z.ZodTypeDef, TicketContact > = z.object({ email: z.string(), name: z.string().optional(), }); export function ticketContactToJSON(ticketContact: TicketContact): string { return JSON.stringify(TicketContact$outboundSchema.parse(ticketContact)); } export function ticketContactFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TicketContact$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketContact' from JSON`, ); }