/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { HostTimelineEventAsset, HostTimelineEventAsset$inboundSchema, } from "./hosttimelineeventasset.js"; export type HostTimeline = { events: Array | null; scannedTo: Date; }; /** @internal */ export const HostTimeline$inboundSchema: z.ZodType< HostTimeline, z.ZodTypeDef, unknown > = z.object({ events: z.nullable(z.array(HostTimelineEventAsset$inboundSchema)), scanned_to: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "scanned_to": "scannedTo", }); }); export function hostTimelineFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HostTimeline$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HostTimeline' from JSON`, ); }