/* * 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 { PayoutRecipientError, PayoutRecipientError$inboundSchema, PayoutRecipientError$Outbound, PayoutRecipientError$outboundSchema, } from "./payoutrecipienterror.js"; export type PayoutDetailsError = { allowedMethods?: string | undefined; recipient?: PayoutRecipientError | undefined; metadata?: string | undefined; }; /** @internal */ export const PayoutDetailsError$inboundSchema: z.ZodType< PayoutDetailsError, z.ZodTypeDef, unknown > = z.object({ allowedMethods: z.string().optional(), recipient: PayoutRecipientError$inboundSchema.optional(), metadata: z.string().optional(), }); /** @internal */ export type PayoutDetailsError$Outbound = { allowedMethods?: string | undefined; recipient?: PayoutRecipientError$Outbound | undefined; metadata?: string | undefined; }; /** @internal */ export const PayoutDetailsError$outboundSchema: z.ZodType< PayoutDetailsError$Outbound, z.ZodTypeDef, PayoutDetailsError > = z.object({ allowedMethods: z.string().optional(), recipient: PayoutRecipientError$outboundSchema.optional(), metadata: z.string().optional(), }); export function payoutDetailsErrorToJSON( payoutDetailsError: PayoutDetailsError, ): string { return JSON.stringify( PayoutDetailsError$outboundSchema.parse(payoutDetailsError), ); } export function payoutDetailsErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PayoutDetailsError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PayoutDetailsError' from JSON`, ); }