/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b5f3f9188ad9 */ 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 { AnswerResult, AnswerResult$inboundSchema } from "./answerresult.js"; import { GetAnswerError, GetAnswerError$inboundSchema, } from "./getanswererror.js"; export type GetAnswerResponse = { answerResult?: AnswerResult | undefined; error?: GetAnswerError | undefined; }; /** @internal */ export const GetAnswerResponse$inboundSchema: z.ZodType< GetAnswerResponse, z.ZodTypeDef, unknown > = z.object({ answerResult: AnswerResult$inboundSchema.optional(), error: GetAnswerError$inboundSchema.optional(), }); export function getAnswerResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetAnswerResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAnswerResponse' from JSON`, ); }