/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 9b54d94f2354 */ 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 { Shortcut, Shortcut$inboundSchema } from "./shortcut.js"; import { ShortcutError, ShortcutError$inboundSchema } from "./shortcuterror.js"; export type CreateShortcutResponse = { shortcut?: Shortcut | undefined; error?: ShortcutError | undefined; }; /** @internal */ export const CreateShortcutResponse$inboundSchema: z.ZodType< CreateShortcutResponse, z.ZodTypeDef, unknown > = z.object({ shortcut: Shortcut$inboundSchema.optional(), error: ShortcutError$inboundSchema.optional(), }); export function createShortcutResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateShortcutResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateShortcutResponse' from JSON`, ); }