/* * 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 TextMessage = { actor?: number | undefined; channelId?: Array | null | undefined; message?: string | undefined; session?: Array | null | undefined; treeId?: Array | null | undefined; }; /** @internal */ export const TextMessage$inboundSchema: z.ZodType< TextMessage, z.ZodTypeDef, unknown > = z.object({ actor: z.number().int().optional(), channel_id: z.nullable(z.array(z.number().int())).optional(), message: z.string().optional(), session: z.nullable(z.array(z.number().int())).optional(), tree_id: z.nullable(z.array(z.number().int())).optional(), }).transform((v) => { return remap$(v, { "channel_id": "channelId", "tree_id": "treeId", }); }); export function textMessageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TextMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextMessage' from JSON`, ); }