/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 5fdf458b6349 */ 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 { DigestSection, DigestSection$inboundSchema } from "./digestsection.js"; export type Digest = { /** * Identifier for the podcast file generated from this digest content. */ podcastFileId?: string | undefined; /** * Duration of the podcast file in seconds. */ podcastDuration?: number | undefined; /** * The date this digest covers, in YYYY-MM-DD format. Represents the specific day for which the digest content and updates were compiled. This can be empty if the digest is not yet available. */ digestDate?: string | undefined; /** * Array of digest sections from which the podcast was created. */ sections?: Array | undefined; }; /** @internal */ export const Digest$inboundSchema: z.ZodType = z .object({ podcastFileId: z.string().optional(), podcastDuration: z.number().optional(), digestDate: z.string().optional(), sections: z.array(DigestSection$inboundSchema).optional(), }); export function digestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Digest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Digest' from JSON`, ); }