/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { ChannelName, ChannelName$inboundSchema } from "./channel-name.js"; import { ChannelScope, ChannelScope$inboundSchema } from "./channel-scope.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type ChannelRoute = { id: string; channel: ChannelName; userAddress: string; agentWallet: string; /** * Channel route scope. Local scope requires haiId. */ scope: ChannelScope; haiId?: string | undefined; /** * Platform-specific account identifier (chat ID, channel ID, etc.) */ accountId: string; /** * Platform-specific thread/conversation identifier */ threadId: string; label?: string | undefined; metadata?: { [k: string]: any } | undefined; createdAt: number; updatedAt: number; }; /** @internal */ export const ChannelRoute$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), channel: ChannelName$inboundSchema, userAddress: types.string(), agentWallet: types.string(), scope: ChannelScope$inboundSchema, haiId: types.optional(types.string()), accountId: types.string(), threadId: types.string(), label: types.optional(types.string()), metadata: types.optional(z.record(z.string(), z.any())), createdAt: types.number(), updatedAt: types.number(), }); export function channelRouteFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ChannelRoute$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChannelRoute' from JSON`, ); }