/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Institution representing originator or recipient of funds from an Instant Cash Transfer */ export type InstitutionCreate = { /** * Account id at institution */ accountId: string; /** * Name of the institution */ title: string; }; /** @internal */ export const InstitutionCreate$inboundSchema: z.ZodType< InstitutionCreate, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), title: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", }); }); /** @internal */ export type InstitutionCreate$Outbound = { account_id: string; title: string; }; /** @internal */ export const InstitutionCreate$outboundSchema: z.ZodType< InstitutionCreate$Outbound, z.ZodTypeDef, InstitutionCreate > = z.object({ accountId: z.string(), title: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InstitutionCreate$ { /** @deprecated use `InstitutionCreate$inboundSchema` instead. */ export const inboundSchema = InstitutionCreate$inboundSchema; /** @deprecated use `InstitutionCreate$outboundSchema` instead. */ export const outboundSchema = InstitutionCreate$outboundSchema; /** @deprecated use `InstitutionCreate$Outbound` instead. */ export type Outbound = InstitutionCreate$Outbound; } export function institutionCreateToJSON( institutionCreate: InstitutionCreate, ): string { return JSON.stringify( InstitutionCreate$outboundSchema.parse(institutionCreate), ); } export function institutionCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InstitutionCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InstitutionCreate' from JSON`, ); }