/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2340222bfe47 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Person, Person$inboundSchema } from "./person.js"; export const GetAnswerErrorErrorType = { NoPermission: "NO_PERMISSION", InvalidId: "INVALID_ID", } as const; export type GetAnswerErrorErrorType = OpenEnum; export type GetAnswerError = { errorType?: GetAnswerErrorErrorType | undefined; answerAuthor?: Person | undefined; }; /** @internal */ export const GetAnswerErrorErrorType$inboundSchema: z.ZodType< GetAnswerErrorErrorType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(GetAnswerErrorErrorType); /** @internal */ export const GetAnswerError$inboundSchema: z.ZodType< GetAnswerError, z.ZodTypeDef, unknown > = z.object({ errorType: GetAnswerErrorErrorType$inboundSchema.optional(), answerAuthor: Person$inboundSchema.optional(), }); export function getAnswerErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetAnswerError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAnswerError' from JSON`, ); }