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