/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Cash transfer mechanism to search constraints for */ export enum Mechanism { Ach = "ACH", Ict = "ICT", } /** * Cash transfer mechanism to search constraints for */ export type MechanismOpen = OpenEnum; /** * Request to retrieve retirement contribution constraints */ export type RetrieveContributionConstraintsRequestCreate = { /** * Cash transfer mechanism to search constraints for */ mechanism: MechanismOpen; /** * Name of the account being queried, for retirement contribution constraints Format: accounts/{account} */ name: string; }; /** @internal */ export const Mechanism$inboundSchema: z.ZodType< MechanismOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(Mechanism), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const Mechanism$outboundSchema: z.ZodType< MechanismOpen, z.ZodTypeDef, MechanismOpen > = z.union([ z.nativeEnum(Mechanism), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Mechanism$ { /** @deprecated use `Mechanism$inboundSchema` instead. */ export const inboundSchema = Mechanism$inboundSchema; /** @deprecated use `Mechanism$outboundSchema` instead. */ export const outboundSchema = Mechanism$outboundSchema; } /** @internal */ export const RetrieveContributionConstraintsRequestCreate$inboundSchema: z.ZodType< RetrieveContributionConstraintsRequestCreate, z.ZodTypeDef, unknown > = z.object({ mechanism: Mechanism$inboundSchema, name: z.string(), }); /** @internal */ export type RetrieveContributionConstraintsRequestCreate$Outbound = { mechanism: string; name: string; }; /** @internal */ export const RetrieveContributionConstraintsRequestCreate$outboundSchema: z.ZodType< RetrieveContributionConstraintsRequestCreate$Outbound, z.ZodTypeDef, RetrieveContributionConstraintsRequestCreate > = z.object({ mechanism: Mechanism$outboundSchema, name: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RetrieveContributionConstraintsRequestCreate$ { /** @deprecated use `RetrieveContributionConstraintsRequestCreate$inboundSchema` instead. */ export const inboundSchema = RetrieveContributionConstraintsRequestCreate$inboundSchema; /** @deprecated use `RetrieveContributionConstraintsRequestCreate$outboundSchema` instead. */ export const outboundSchema = RetrieveContributionConstraintsRequestCreate$outboundSchema; /** @deprecated use `RetrieveContributionConstraintsRequestCreate$Outbound` instead. */ export type Outbound = RetrieveContributionConstraintsRequestCreate$Outbound; } export function retrieveContributionConstraintsRequestCreateToJSON( retrieveContributionConstraintsRequestCreate: RetrieveContributionConstraintsRequestCreate, ): string { return JSON.stringify( RetrieveContributionConstraintsRequestCreate$outboundSchema.parse( retrieveContributionConstraintsRequestCreate, ), ); } export function retrieveContributionConstraintsRequestCreateFromJSON( jsonString: string, ): SafeParseResult< RetrieveContributionConstraintsRequestCreate, SDKValidationError > { return safeParse( jsonString, (x) => RetrieveContributionConstraintsRequestCreate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RetrieveContributionConstraintsRequestCreate' from JSON`, ); }