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