/* * 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 UpdateCardAddress = { addressLine1?: string | undefined; addressLine2?: string | undefined; city?: string | undefined; stateOrProvince?: string | undefined; postalCode?: string | undefined; country?: string | undefined; }; /** @internal */ export const UpdateCardAddress$inboundSchema: z.ZodType< UpdateCardAddress, z.ZodTypeDef, unknown > = z.object({ addressLine1: z.string().optional(), addressLine2: z.string().optional(), city: z.string().optional(), stateOrProvince: z.string().optional(), postalCode: z.string().optional(), country: z.string().optional(), }); /** @internal */ export type UpdateCardAddress$Outbound = { addressLine1?: string | undefined; addressLine2?: string | undefined; city?: string | undefined; stateOrProvince?: string | undefined; postalCode?: string | undefined; country?: string | undefined; }; /** @internal */ export const UpdateCardAddress$outboundSchema: z.ZodType< UpdateCardAddress$Outbound, z.ZodTypeDef, UpdateCardAddress > = z.object({ addressLine1: z.string().optional(), addressLine2: z.string().optional(), city: z.string().optional(), stateOrProvince: z.string().optional(), postalCode: z.string().optional(), country: z.string().optional(), }); export function updateCardAddressToJSON( updateCardAddress: UpdateCardAddress, ): string { return JSON.stringify( UpdateCardAddress$outboundSchema.parse(updateCardAddress), ); } export function updateCardAddressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateCardAddress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateCardAddress' from JSON`, ); }