/* * 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 PhoneNumberError = { number?: string | undefined; countryCode?: string | undefined; }; /** @internal */ export const PhoneNumberError$inboundSchema: z.ZodType< PhoneNumberError, z.ZodTypeDef, unknown > = z.object({ number: z.string().optional(), countryCode: z.string().optional(), }); /** @internal */ export type PhoneNumberError$Outbound = { number?: string | undefined; countryCode?: string | undefined; }; /** @internal */ export const PhoneNumberError$outboundSchema: z.ZodType< PhoneNumberError$Outbound, z.ZodTypeDef, PhoneNumberError > = z.object({ number: z.string().optional(), countryCode: z.string().optional(), }); export function phoneNumberErrorToJSON( phoneNumberError: PhoneNumberError, ): string { return JSON.stringify( PhoneNumberError$outboundSchema.parse(phoneNumberError), ); } export function phoneNumberErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PhoneNumberError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PhoneNumberError' from JSON`, ); }