/* * 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 { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; import { WireServices, WireServices$inboundSchema, WireServices$Outbound, WireServices$outboundSchema, } from "./wireservices.js"; export type WireInstitution = { /** * Name of the financial institution. */ name: string; routingNumber: string; address?: Address | undefined; services: WireServices; }; /** @internal */ export const WireInstitution$inboundSchema: z.ZodType< WireInstitution, z.ZodTypeDef, unknown > = z.object({ name: z.string(), routingNumber: z.string(), address: Address$inboundSchema.optional(), services: WireServices$inboundSchema, }); /** @internal */ export type WireInstitution$Outbound = { name: string; routingNumber: string; address?: Address$Outbound | undefined; services: WireServices$Outbound; }; /** @internal */ export const WireInstitution$outboundSchema: z.ZodType< WireInstitution$Outbound, z.ZodTypeDef, WireInstitution > = z.object({ name: z.string(), routingNumber: z.string(), address: Address$outboundSchema.optional(), services: WireServices$outboundSchema, }); export function wireInstitutionToJSON( wireInstitution: WireInstitution, ): string { return JSON.stringify(WireInstitution$outboundSchema.parse(wireInstitution)); } export function wireInstitutionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WireInstitution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WireInstitution' from JSON`, ); }