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