/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ClosedEnum } from "../types/enums.js"; import { ChannelScope, ChannelScope$outboundSchema } from "./channel-scope.js"; /** * Linking mode (guild for Slack/Discord server-level linking) */ export const ChannelLinkRequestMode = { User: "user", Guild: "guild", } as const; /** * Linking mode (guild for Slack/Discord server-level linking) */ export type ChannelLinkRequestMode = ClosedEnum; export const ChannelLinkRequestPrivacy = { Public: "public", Private: "private", } as const; export type ChannelLinkRequestPrivacy = ClosedEnum< typeof ChannelLinkRequestPrivacy >; export type ChannelLinkRequest = { /** * User wallet address (inferred from x-session-user-address header if omitted) */ userAddress?: string | undefined; /** * Agent wallet address to link */ agentWallet: string; /** * Channel route scope. Local scope requires haiId. */ scope?: ChannelScope | undefined; /** * Required when scope is local. */ haiId?: string | undefined; /** * Display name for the agent on the channel */ agentName?: string | undefined; /** * Linking mode (guild for Slack/Discord server-level linking) */ mode?: ChannelLinkRequestMode | undefined; privacy?: ChannelLinkRequestPrivacy | undefined; }; /** @internal */ export const ChannelLinkRequestMode$outboundSchema: z.ZodMiniEnum< typeof ChannelLinkRequestMode > = z.enum(ChannelLinkRequestMode); /** @internal */ export const ChannelLinkRequestPrivacy$outboundSchema: z.ZodMiniEnum< typeof ChannelLinkRequestPrivacy > = z.enum(ChannelLinkRequestPrivacy); /** @internal */ export type ChannelLinkRequest$Outbound = { userAddress?: string | undefined; agentWallet: string; scope?: string | undefined; haiId?: string | undefined; agentName?: string | undefined; mode: string; privacy: string; }; /** @internal */ export const ChannelLinkRequest$outboundSchema: z.ZodMiniType< ChannelLinkRequest$Outbound, ChannelLinkRequest > = z.object({ userAddress: z.optional(z.string()), agentWallet: z.string(), scope: z.optional(ChannelScope$outboundSchema), haiId: z.optional(z.string()), agentName: z.optional(z.string()), mode: z._default(ChannelLinkRequestMode$outboundSchema, "user"), privacy: z._default(ChannelLinkRequestPrivacy$outboundSchema, "public"), }); export function channelLinkRequestToJSON( channelLinkRequest: ChannelLinkRequest, ): string { return JSON.stringify( ChannelLinkRequest$outboundSchema.parse(channelLinkRequest), ); }