/* * 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 { SDKValidationError } from "./errors/sdk-validation-error.js"; export type ChannelGetResponse = { channel: ChannelName; /** * URL for creating a link */ link: string; /** * URL for checking status */ status: string; /** * URL for disconnecting */ disconnect: string; /** * Webhook URL for platform callbacks (Telegram/Slack/Discord) */ webhook?: string | null | undefined; /** * WebSocket URL for pairing (WhatsApp) */ socket?: string | null | undefined; }; /** @internal */ export const ChannelGetResponse$inboundSchema: z.ZodMiniType< ChannelGetResponse, unknown > = z.object({ channel: ChannelName$inboundSchema, link: types.string(), status: types.string(), disconnect: types.string(), webhook: z.optional(z.nullable(types.string())), socket: z.optional(z.nullable(types.string())), }); export function channelGetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ChannelGetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChannelGetResponse' from JSON`, ); }