/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetPromptRequest = { id: string; version?: number | undefined; variables?: string | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const GetPromptRequest$inboundSchema: z.ZodType< GetPromptRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), version: z.number().int().optional(), variables: z.string().optional(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetPromptRequest$Outbound = { id: string; version?: number | undefined; variables?: string | undefined; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetPromptRequest$outboundSchema: z.ZodType< GetPromptRequest$Outbound, z.ZodTypeDef, GetPromptRequest > = z.object({ id: z.string(), version: z.number().int().optional(), variables: z.string().optional(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getPromptRequestToJSON( getPromptRequest: GetPromptRequest, ): string { return JSON.stringify( GetPromptRequest$outboundSchema.parse(getPromptRequest), ); } export function getPromptRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetPromptRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetPromptRequest' from JSON`, ); }