/* * 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 AchLocation = { address: string; city: string; postalCode: string; postalCodeExtension: string; state: string; }; /** @internal */ export const AchLocation$inboundSchema: z.ZodType< AchLocation, z.ZodTypeDef, unknown > = z.object({ address: z.string(), city: z.string(), postalCode: z.string(), postalCodeExtension: z.string(), state: z.string(), }); /** @internal */ export type AchLocation$Outbound = { address: string; city: string; postalCode: string; postalCodeExtension: string; state: string; }; /** @internal */ export const AchLocation$outboundSchema: z.ZodType< AchLocation$Outbound, z.ZodTypeDef, AchLocation > = z.object({ address: z.string(), city: z.string(), postalCode: z.string(), postalCodeExtension: z.string(), state: z.string(), }); export function achLocationToJSON(achLocation: AchLocation): string { return JSON.stringify(AchLocation$outboundSchema.parse(achLocation)); } export function achLocationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AchLocation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AchLocation' from JSON`, ); }