/* * 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 { FedNowServices, FedNowServices$inboundSchema, FedNowServices$Outbound, FedNowServices$outboundSchema, } from "./fednowservices.js"; export type FedNowInstitution = { /** * Name of the financial institution. */ name: string; routingNumber: string; services: FedNowServices; }; /** @internal */ export const FedNowInstitution$inboundSchema: z.ZodType< FedNowInstitution, z.ZodTypeDef, unknown > = z.object({ name: z.string(), routingNumber: z.string(), services: FedNowServices$inboundSchema, }); /** @internal */ export type FedNowInstitution$Outbound = { name: string; routingNumber: string; services: FedNowServices$Outbound; }; /** @internal */ export const FedNowInstitution$outboundSchema: z.ZodType< FedNowInstitution$Outbound, z.ZodTypeDef, FedNowInstitution > = z.object({ name: z.string(), routingNumber: z.string(), services: FedNowServices$outboundSchema, }); export function fedNowInstitutionToJSON( fedNowInstitution: FedNowInstitution, ): string { return JSON.stringify( FedNowInstitution$outboundSchema.parse(fedNowInstitution), ); } export function fedNowInstitutionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FedNowInstitution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FedNowInstitution' from JSON`, ); }