/* * 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"; import { InstitutionCreate, InstitutionCreate$inboundSchema, InstitutionCreate$Outbound, InstitutionCreate$outboundSchema, } from "./institutioncreate.js"; /** * The travel rules associated with an ICT withdrawal */ export type IctWithdrawalTravelRuleCreate = { /** * Institution representing originator or recipient of funds from an Instant Cash Transfer */ recipientInstitution: InstitutionCreate; }; /** @internal */ export const IctWithdrawalTravelRuleCreate$inboundSchema: z.ZodType< IctWithdrawalTravelRuleCreate, z.ZodTypeDef, unknown > = z.object({ recipient_institution: InstitutionCreate$inboundSchema, }).transform((v) => { return remap$(v, { "recipient_institution": "recipientInstitution", }); }); /** @internal */ export type IctWithdrawalTravelRuleCreate$Outbound = { recipient_institution: InstitutionCreate$Outbound; }; /** @internal */ export const IctWithdrawalTravelRuleCreate$outboundSchema: z.ZodType< IctWithdrawalTravelRuleCreate$Outbound, z.ZodTypeDef, IctWithdrawalTravelRuleCreate > = z.object({ recipientInstitution: InstitutionCreate$outboundSchema, }).transform((v) => { return remap$(v, { recipientInstitution: "recipient_institution", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IctWithdrawalTravelRuleCreate$ { /** @deprecated use `IctWithdrawalTravelRuleCreate$inboundSchema` instead. */ export const inboundSchema = IctWithdrawalTravelRuleCreate$inboundSchema; /** @deprecated use `IctWithdrawalTravelRuleCreate$outboundSchema` instead. */ export const outboundSchema = IctWithdrawalTravelRuleCreate$outboundSchema; /** @deprecated use `IctWithdrawalTravelRuleCreate$Outbound` instead. */ export type Outbound = IctWithdrawalTravelRuleCreate$Outbound; } export function ictWithdrawalTravelRuleCreateToJSON( ictWithdrawalTravelRuleCreate: IctWithdrawalTravelRuleCreate, ): string { return JSON.stringify( IctWithdrawalTravelRuleCreate$outboundSchema.parse( ictWithdrawalTravelRuleCreate, ), ); } export function ictWithdrawalTravelRuleCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IctWithdrawalTravelRuleCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IctWithdrawalTravelRuleCreate' from JSON`, ); }