/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 0eca228cd965 */ 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"; export const ShortcutErrorErrorType = { NoPermission: "NO_PERMISSION", InvalidId: "INVALID_ID", ExistingShortcut: "EXISTING_SHORTCUT", InvalidChars: "INVALID_CHARS", } as const; export type ShortcutErrorErrorType = OpenEnum; export type ShortcutError = { errorType?: ShortcutErrorErrorType | undefined; }; /** @internal */ export const ShortcutErrorErrorType$inboundSchema: z.ZodType< ShortcutErrorErrorType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(ShortcutErrorErrorType); /** @internal */ export const ShortcutError$inboundSchema: z.ZodType< ShortcutError, z.ZodTypeDef, unknown > = z.object({ errorType: ShortcutErrorErrorType$inboundSchema.optional(), }); export function shortcutErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ShortcutError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ShortcutError' from JSON`, ); }