/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: cc05774c2124 */ 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 { CountInfo, CountInfo$inboundSchema, CountInfo$Outbound, CountInfo$outboundSchema, } from "./countinfo.js"; import { Document, Document$inboundSchema, Document$Outbound, Document$outboundSchema, } from "./document.js"; import { Person, Person$inboundSchema, Person$Outbound, Person$outboundSchema, } from "./person.js"; import { Reminder, Reminder$inboundSchema, Reminder$Outbound, Reminder$outboundSchema, } from "./reminder.js"; export type VerificationMetadata = { lastVerifier?: Person | undefined; /** * The unix timestamp of the verification (in seconds since epoch UTC). */ lastVerificationTs?: number | undefined; /** * The unix timestamp of the verification expiration if applicable (in seconds since epoch UTC). */ expirationTs?: number | undefined; document?: Document | undefined; /** * Info about all outstanding verification reminders for the document if exists. */ reminders?: Array | undefined; lastReminder?: Reminder | undefined; /** * Number of visitors to the document during included time periods. */ visitorCount?: Array | undefined; /** * List of potential verifiers for the document e.g. old verifiers and/or users with view/edit permissions. */ candidateVerifiers?: Array | undefined; }; /** @internal */ export const VerificationMetadata$inboundSchema: z.ZodType< VerificationMetadata, z.ZodTypeDef, unknown > = z.object({ lastVerifier: z.lazy(() => Person$inboundSchema).optional(), lastVerificationTs: z.number().int().optional(), expirationTs: z.number().int().optional(), document: z.lazy(() => Document$inboundSchema).optional(), reminders: z.array(z.lazy(() => Reminder$inboundSchema)).optional(), lastReminder: z.lazy(() => Reminder$inboundSchema).optional(), visitorCount: z.array(CountInfo$inboundSchema).optional(), candidateVerifiers: z.array(z.lazy(() => Person$inboundSchema)).optional(), }); /** @internal */ export type VerificationMetadata$Outbound = { lastVerifier?: Person$Outbound | undefined; lastVerificationTs?: number | undefined; expirationTs?: number | undefined; document?: Document$Outbound | undefined; reminders?: Array | undefined; lastReminder?: Reminder$Outbound | undefined; visitorCount?: Array | undefined; candidateVerifiers?: Array | undefined; }; /** @internal */ export const VerificationMetadata$outboundSchema: z.ZodType< VerificationMetadata$Outbound, z.ZodTypeDef, VerificationMetadata > = z.object({ lastVerifier: z.lazy(() => Person$outboundSchema).optional(), lastVerificationTs: z.number().int().optional(), expirationTs: z.number().int().optional(), document: z.lazy(() => Document$outboundSchema).optional(), reminders: z.array(z.lazy(() => Reminder$outboundSchema)).optional(), lastReminder: z.lazy(() => Reminder$outboundSchema).optional(), visitorCount: z.array(CountInfo$outboundSchema).optional(), candidateVerifiers: z.array(z.lazy(() => Person$outboundSchema)).optional(), }); export function verificationMetadataToJSON( verificationMetadata: VerificationMetadata, ): string { return JSON.stringify( VerificationMetadata$outboundSchema.parse(verificationMetadata), ); } export function verificationMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VerificationMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VerificationMetadata' from JSON`, ); }