/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f8f0e81b15cf */ 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 TimeInterval = { /** * The RFC3339 timestamp formatted start time of this event. */ start: string; /** * The RFC3339 timestamp formatted end time of this event. */ end: string; }; /** @internal */ export const TimeInterval$inboundSchema: z.ZodType< TimeInterval, z.ZodTypeDef, unknown > = z.object({ start: z.string(), end: z.string(), }); /** @internal */ export type TimeInterval$Outbound = { start: string; end: string; }; /** @internal */ export const TimeInterval$outboundSchema: z.ZodType< TimeInterval$Outbound, z.ZodTypeDef, TimeInterval > = z.object({ start: z.string(), end: z.string(), }); export function timeIntervalToJSON(timeInterval: TimeInterval): string { return JSON.stringify(TimeInterval$outboundSchema.parse(timeInterval)); } export function timeIntervalFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TimeInterval$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeInterval' from JSON`, ); }