/* * 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"; export type FedNowServices = { /** * Indicates if the institution can receive instant payments. */ receivePayments: boolean; /** * Indicates if the institution can send instant payments. */ sendPayments: boolean; /** * Indicates if the institution can process request for payment messages. */ requestForPayment: boolean; }; /** @internal */ export const FedNowServices$inboundSchema: z.ZodType< FedNowServices, z.ZodTypeDef, unknown > = z.object({ receivePayments: z.boolean(), sendPayments: z.boolean(), requestForPayment: z.boolean(), }); /** @internal */ export type FedNowServices$Outbound = { receivePayments: boolean; sendPayments: boolean; requestForPayment: boolean; }; /** @internal */ export const FedNowServices$outboundSchema: z.ZodType< FedNowServices$Outbound, z.ZodTypeDef, FedNowServices > = z.object({ receivePayments: z.boolean(), sendPayments: z.boolean(), requestForPayment: z.boolean(), }); export function fedNowServicesToJSON(fedNowServices: FedNowServices): string { return JSON.stringify(FedNowServices$outboundSchema.parse(fedNowServices)); } export function fedNowServicesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FedNowServices$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FedNowServices' from JSON`, ); }