/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../../lib/schemas.js"; import { Decimal as Decimal$ } from "../../types/decimal.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type TargetAccountOption = { /** * Id of the target account. */ id?: string | undefined; /** * Name of the target account. */ name?: string | null | undefined; /** * The balance of the account. */ balance?: Decimal$ | number | null | undefined; /** * The sort code of the account. */ sortCode?: string | null | undefined; /** * The account number of the account. */ accountNumber?: string | null | undefined; }; /** @internal */ export const TargetAccountOption$inboundSchema: z.ZodType< TargetAccountOption, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.nullable(z.string()).optional(), balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), sortCode: z.nullable(z.string()).optional(), accountNumber: z.nullable(z.string()).optional(), }); export function targetAccountOptionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TargetAccountOption$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TargetAccountOption' from JSON`, ); }