/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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 TimeRangeDto = { /** * Start time */ start: string; /** * End time */ end: string; }; /** @internal */ export const TimeRangeDto$inboundSchema: z.ZodType< TimeRangeDto, z.ZodTypeDef, unknown > = z.object({ start: z.string(), end: z.string(), }); /** @internal */ export type TimeRangeDto$Outbound = { start: string; end: string; }; /** @internal */ export const TimeRangeDto$outboundSchema: z.ZodType< TimeRangeDto$Outbound, z.ZodTypeDef, TimeRangeDto > = z.object({ start: z.string(), end: z.string(), }); export function timeRangeDtoToJSON(timeRangeDto: TimeRangeDto): string { return JSON.stringify(TimeRangeDto$outboundSchema.parse(timeRangeDto)); } export function timeRangeDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TimeRangeDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TimeRangeDto' from JSON`, ); }