/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: bf311e898142 */ 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 { Person, Person$inboundSchema, Person$Outbound, Person$outboundSchema, } from "./person.js"; export type Reminder = { assignee: Person; requestor?: Person | undefined; /** * Unix timestamp for when the reminder should trigger (in seconds since epoch UTC). */ remindAt: number; /** * Unix timestamp for when the reminder was first created (in seconds since epoch UTC). */ createdAt?: number | undefined; /** * An optional free-text reason for the reminder. This is particularly useful when a reminder is used to ask for verification from another user (for example, "Duplicate", "Incomplete", "Incorrect"). */ reason?: string | undefined; }; /** @internal */ export const Reminder$inboundSchema: z.ZodType< Reminder, z.ZodTypeDef, unknown > = z.object({ assignee: z.lazy(() => Person$inboundSchema), requestor: z.lazy(() => Person$inboundSchema).optional(), remindAt: z.number().int(), createdAt: z.number().int().optional(), reason: z.string().optional(), }); /** @internal */ export type Reminder$Outbound = { assignee: Person$Outbound; requestor?: Person$Outbound | undefined; remindAt: number; createdAt?: number | undefined; reason?: string | undefined; }; /** @internal */ export const Reminder$outboundSchema: z.ZodType< Reminder$Outbound, z.ZodTypeDef, Reminder > = z.object({ assignee: z.lazy(() => Person$outboundSchema), requestor: z.lazy(() => Person$outboundSchema).optional(), remindAt: z.number().int(), createdAt: z.number().int().optional(), reason: z.string().optional(), }); export function reminderToJSON(reminder: Reminder): string { return JSON.stringify(Reminder$outboundSchema.parse(reminder)); } export function reminderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Reminder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Reminder' from JSON`, ); }