/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 64f8e77d9d62 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { VerificationMetadata, VerificationMetadata$inboundSchema, VerificationMetadata$Outbound, VerificationMetadata$outboundSchema, } from "./verificationmetadata.js"; /** * The verification state for the document. */ export const State = { Unverified: "UNVERIFIED", Verified: "VERIFIED", Deprecated: "DEPRECATED", } as const; /** * The verification state for the document. */ export type State = OpenEnum; export type Verification = { /** * The verification state for the document. */ state: State; metadata?: VerificationMetadata | undefined; }; /** @internal */ export const State$inboundSchema: z.ZodType = openEnums.inboundSchema(State); /** @internal */ export const State$outboundSchema: z.ZodType = openEnums.outboundSchema(State); /** @internal */ export const Verification$inboundSchema: z.ZodType< Verification, z.ZodTypeDef, unknown > = z.object({ state: State$inboundSchema, metadata: z.lazy(() => VerificationMetadata$inboundSchema).optional(), }); /** @internal */ export type Verification$Outbound = { state: string; metadata?: VerificationMetadata$Outbound | undefined; }; /** @internal */ export const Verification$outboundSchema: z.ZodType< Verification$Outbound, z.ZodTypeDef, Verification > = z.object({ state: State$outboundSchema, metadata: z.lazy(() => VerificationMetadata$outboundSchema).optional(), }); export function verificationToJSON(verification: Verification): string { return JSON.stringify(Verification$outboundSchema.parse(verification)); } export function verificationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Verification$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Verification' from JSON`, ); }