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