/* * 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 PhoneEndpointDto = { /** * Phone number in E.164 format */ phoneNumber: string; }; /** @internal */ export const PhoneEndpointDto$inboundSchema: z.ZodType< PhoneEndpointDto, z.ZodTypeDef, unknown > = z.object({ phoneNumber: z.string(), }); /** @internal */ export type PhoneEndpointDto$Outbound = { phoneNumber: string; }; /** @internal */ export const PhoneEndpointDto$outboundSchema: z.ZodType< PhoneEndpointDto$Outbound, z.ZodTypeDef, PhoneEndpointDto > = z.object({ phoneNumber: z.string(), }); export function phoneEndpointDtoToJSON( phoneEndpointDto: PhoneEndpointDto, ): string { return JSON.stringify( PhoneEndpointDto$outboundSchema.parse(phoneEndpointDto), ); } export function phoneEndpointDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PhoneEndpointDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PhoneEndpointDto' from JSON`, ); }