/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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"; export type CreatePromptRequest = { /** * Human-readable prompt name */ name: string; /** * Detailed description of the prompt */ description?: string | undefined; /** * The prompt template text with {{variable}} placeholders */ template: string; /** * Custom metadata key-value pairs */ metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const CreatePromptRequest$inboundSchema: z.ZodType< CreatePromptRequest, z.ZodTypeDef, unknown > = z.object({ name: z.string(), description: z.string().optional(), template: z.string(), metadata: z.record(z.any()).optional(), }); /** @internal */ export type CreatePromptRequest$Outbound = { name: string; description?: string | undefined; template: string; metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const CreatePromptRequest$outboundSchema: z.ZodType< CreatePromptRequest$Outbound, z.ZodTypeDef, CreatePromptRequest > = z.object({ name: z.string(), description: z.string().optional(), template: z.string(), metadata: z.record(z.any()).optional(), }); export function createPromptRequestToJSON( createPromptRequest: CreatePromptRequest, ): string { return JSON.stringify( CreatePromptRequest$outboundSchema.parse(createPromptRequest), ); } export function createPromptRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreatePromptRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreatePromptRequest' from JSON`, ); }