/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: eb768c6c8369 */ 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"; export type TimePoint = { /** * Epoch seconds. Has precedence over daysFromNow. */ epochSeconds?: number | undefined; /** * Number of days in the past, relative to the current date. */ daysFromNow?: number | undefined; }; /** @internal */ export const TimePoint$inboundSchema: z.ZodType< TimePoint, z.ZodTypeDef, unknown > = z.object({ epochSeconds: z.number().int().optional(), daysFromNow: z.number().int().optional(), }); /** @internal */ export type TimePoint$Outbound = { epochSeconds?: number | undefined; daysFromNow?: number | undefined; }; /** @internal */ export const TimePoint$outboundSchema: z.ZodType< TimePoint$Outbound, z.ZodTypeDef, TimePoint > = z.object({ epochSeconds: z.number().int().optional(), daysFromNow: z.number().int().optional(), }); export function timePointToJSON(timePoint: TimePoint): string { return JSON.stringify(TimePoint$outboundSchema.parse(timePoint)); } export function timePointFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TimePoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimePoint' from JSON`, ); }