/* * 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"; /** * 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). */ export type E2EETokenUpdate = { /** * An [RFC](https://datatracker.ietf.org/doc/html/rfc7516) compact-serialized JSON Web Encryption (JWE) token. */ token?: string | undefined; }; /** @internal */ export const E2EETokenUpdate$inboundSchema: z.ZodType< E2EETokenUpdate, z.ZodTypeDef, unknown > = z.object({ token: z.string().optional(), }); /** @internal */ export type E2EETokenUpdate$Outbound = { token?: string | undefined; }; /** @internal */ export const E2EETokenUpdate$outboundSchema: z.ZodType< E2EETokenUpdate$Outbound, z.ZodTypeDef, E2EETokenUpdate > = z.object({ token: z.string().optional(), }); export function e2EETokenUpdateToJSON( e2EETokenUpdate: E2EETokenUpdate, ): string { return JSON.stringify(E2EETokenUpdate$outboundSchema.parse(e2EETokenUpdate)); } export function e2EETokenUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => E2EETokenUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'E2EETokenUpdate' from JSON`, ); }