/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8b75b50032cc */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PromptVariable = { /** * Stable object name. */ name?: string | undefined; }; /** @internal */ export const PromptVariable$inboundSchema: z.ZodType = z.object({ name: z.string().optional(), }); /** @internal */ export type PromptVariable$Outbound = { name?: string | undefined; }; /** @internal */ export const PromptVariable$outboundSchema: z.ZodType< PromptVariable$Outbound, PromptVariable > = z.object({ name: z.string().optional(), }); export function promptVariableToJSON(promptVariable: PromptVariable): string { return JSON.stringify(PromptVariable$outboundSchema.parse(promptVariable)); } export function promptVariableFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PromptVariable$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptVariable' from JSON`, ); }