/* * 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 { ACHInstitution, ACHInstitution$inboundSchema, ACHInstitution$Outbound, ACHInstitution$outboundSchema, } from "./achinstitution.js"; import { FedNowInstitution, FedNowInstitution$inboundSchema, FedNowInstitution$Outbound, FedNowInstitution$outboundSchema, } from "./fednowinstitution.js"; import { RTPInstitution, RTPInstitution$inboundSchema, RTPInstitution$Outbound, RTPInstitution$outboundSchema, } from "./rtpinstitution.js"; import { WireInstitution, WireInstitution$inboundSchema, WireInstitution$Outbound, WireInstitution$outboundSchema, } from "./wireinstitution.js"; export type InstitutionsSearchResponse = { ach: Array | null; rtp: Array | null; wire: Array | null; fednow: Array | null; }; /** @internal */ export const InstitutionsSearchResponse$inboundSchema: z.ZodType< InstitutionsSearchResponse, z.ZodTypeDef, unknown > = z.object({ ach: z.nullable(z.array(ACHInstitution$inboundSchema)), rtp: z.nullable(z.array(RTPInstitution$inboundSchema)), wire: z.nullable(z.array(WireInstitution$inboundSchema)), fednow: z.nullable(z.array(FedNowInstitution$inboundSchema)), }); /** @internal */ export type InstitutionsSearchResponse$Outbound = { ach: Array | null; rtp: Array | null; wire: Array | null; fednow: Array | null; }; /** @internal */ export const InstitutionsSearchResponse$outboundSchema: z.ZodType< InstitutionsSearchResponse$Outbound, z.ZodTypeDef, InstitutionsSearchResponse > = z.object({ ach: z.nullable(z.array(ACHInstitution$outboundSchema)), rtp: z.nullable(z.array(RTPInstitution$outboundSchema)), wire: z.nullable(z.array(WireInstitution$outboundSchema)), fednow: z.nullable(z.array(FedNowInstitution$outboundSchema)), }); export function institutionsSearchResponseToJSON( institutionsSearchResponse: InstitutionsSearchResponse, ): string { return JSON.stringify( InstitutionsSearchResponse$outboundSchema.parse(institutionsSearchResponse), ); } export function institutionsSearchResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InstitutionsSearchResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InstitutionsSearchResponse' from JSON`, ); }