/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: d90b2e05add9 */ 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 { Summary, Summary$inboundSchema } from "./summary.js"; export type ErrorT = { message?: string | undefined; }; export type SummarizeResponse = { error?: ErrorT | undefined; summary?: Summary | undefined; /** * An opaque token that represents this summary in this particular query. To be used for /feedback reporting. */ trackingToken?: string | undefined; }; /** @internal */ export const ErrorT$inboundSchema: z.ZodType = z .object({ message: z.string().optional(), }); export function errorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ErrorT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorT' from JSON`, ); } /** @internal */ export const SummarizeResponse$inboundSchema: z.ZodType< SummarizeResponse, z.ZodTypeDef, unknown > = z.object({ error: z.lazy(() => ErrorT$inboundSchema).optional(), summary: Summary$inboundSchema.optional(), trackingToken: z.string().optional(), }); export function summarizeResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SummarizeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SummarizeResponse' from JSON`, ); }