/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f99dbb83a1b5 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const AddCollectionItemsErrorErrorType = { ExistingItem: "EXISTING_ITEM", } as const; export type AddCollectionItemsErrorErrorType = ClosedEnum< typeof AddCollectionItemsErrorErrorType >; export type AddCollectionItemsError = { errorType?: AddCollectionItemsErrorErrorType | undefined; }; /** @internal */ export const AddCollectionItemsErrorErrorType$inboundSchema: z.ZodNativeEnum< typeof AddCollectionItemsErrorErrorType > = z.nativeEnum(AddCollectionItemsErrorErrorType); /** @internal */ export const AddCollectionItemsError$inboundSchema: z.ZodType< AddCollectionItemsError, z.ZodTypeDef, unknown > = z.object({ errorType: AddCollectionItemsErrorErrorType$inboundSchema.optional(), }); export function addCollectionItemsErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AddCollectionItemsError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AddCollectionItemsError' from JSON`, ); }