/* * 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"; import { E2EETokenUpdate, E2EETokenUpdate$inboundSchema, E2EETokenUpdate$Outbound, E2EETokenUpdate$outboundSchema, } from "./e2eetokenupdate.js"; import { UpdateCardAddress, UpdateCardAddress$inboundSchema, UpdateCardAddress$Outbound, UpdateCardAddress$outboundSchema, } from "./updatecardaddress.js"; import { UpdateCardExpiration, UpdateCardExpiration$inboundSchema, UpdateCardExpiration$Outbound, UpdateCardExpiration$outboundSchema, } from "./updatecardexpiration.js"; export type UpdateCard = { /** * Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries. * * @remarks * This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our * [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go). */ e2ee?: E2EETokenUpdate | undefined; billingAddress?: UpdateCardAddress | undefined; expiration?: UpdateCardExpiration | undefined; cardCvv?: string | undefined; cardOnFile?: boolean | undefined; merchantAccountID?: string | undefined; verifyName?: boolean | undefined; holderName?: string | undefined; }; /** @internal */ export const UpdateCard$inboundSchema: z.ZodType< UpdateCard, z.ZodTypeDef, unknown > = z.object({ e2ee: E2EETokenUpdate$inboundSchema.optional(), billingAddress: UpdateCardAddress$inboundSchema.optional(), expiration: UpdateCardExpiration$inboundSchema.optional(), cardCvv: z.string().optional(), cardOnFile: z.boolean().optional(), merchantAccountID: z.string().optional(), verifyName: z.boolean().optional(), holderName: z.string().optional(), }); /** @internal */ export type UpdateCard$Outbound = { e2ee?: E2EETokenUpdate$Outbound | undefined; billingAddress?: UpdateCardAddress$Outbound | undefined; expiration?: UpdateCardExpiration$Outbound | undefined; cardCvv?: string | undefined; cardOnFile?: boolean | undefined; merchantAccountID?: string | undefined; verifyName?: boolean | undefined; holderName?: string | undefined; }; /** @internal */ export const UpdateCard$outboundSchema: z.ZodType< UpdateCard$Outbound, z.ZodTypeDef, UpdateCard > = z.object({ e2ee: E2EETokenUpdate$outboundSchema.optional(), billingAddress: UpdateCardAddress$outboundSchema.optional(), expiration: UpdateCardExpiration$outboundSchema.optional(), cardCvv: z.string().optional(), cardOnFile: z.boolean().optional(), merchantAccountID: z.string().optional(), verifyName: z.boolean().optional(), holderName: z.string().optional(), }); export function updateCardToJSON(updateCard: UpdateCard): string { return JSON.stringify(UpdateCard$outboundSchema.parse(updateCard)); } export function updateCardFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateCard$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateCard' from JSON`, ); }