/* * 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 TextFormat = { type: "text"; }; /** @internal */ export const TextFormat$inboundSchema: z.ZodType< TextFormat, z.ZodTypeDef, unknown > = z.object({ type: z.literal("text"), }); /** @internal */ export type TextFormat$Outbound = { type: "text"; }; /** @internal */ export const TextFormat$outboundSchema: z.ZodType< TextFormat$Outbound, z.ZodTypeDef, TextFormat > = z.object({ type: z.literal("text"), }); export function textFormatToJSON(textFormat: TextFormat): string { return JSON.stringify(TextFormat$outboundSchema.parse(textFormat)); } export function textFormatFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TextFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextFormat' from JSON`, ); }