/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { SlackChannelEndpointDto, SlackChannelEndpointDto$Outbound, SlackChannelEndpointDto$outboundSchema, } from "./slackchannelendpointdto.js"; /** * Rich context object with id and optional data */ export type CreateSlackChannelEndpointDtoContext2 = { id: string; /** * Optional additional context data */ data?: { [k: string]: any } | undefined; }; export type CreateSlackChannelEndpointDtoContext = | CreateSlackChannelEndpointDtoContext2 | string; export type CreateSlackChannelEndpointDto = { /** * The unique identifier for the channel endpoint. If not provided, one will be generated automatically. */ identifier?: string | undefined; /** * The subscriber ID to which the channel endpoint is linked */ subscriberId: string; context?: | { [k: string]: CreateSlackChannelEndpointDtoContext2 | string } | undefined; /** * The identifier of the integration to use for this channel endpoint. */ integrationIdentifier: string; /** * The identifier of the channel connection to use for this channel endpoint. */ connectionIdentifier?: string | undefined; /** * Type of channel endpoint */ type: "slack_channel"; /** * Slack channel endpoint data */ endpoint: SlackChannelEndpointDto; }; /** @internal */ export type CreateSlackChannelEndpointDtoContext2$Outbound = { id: string; data?: { [k: string]: any } | undefined; }; /** @internal */ export const CreateSlackChannelEndpointDtoContext2$outboundSchema: z.ZodType< CreateSlackChannelEndpointDtoContext2$Outbound, z.ZodTypeDef, CreateSlackChannelEndpointDtoContext2 > = z.object({ id: z.string(), data: z.record(z.any()).optional(), }); export function createSlackChannelEndpointDtoContext2ToJSON( createSlackChannelEndpointDtoContext2: CreateSlackChannelEndpointDtoContext2, ): string { return JSON.stringify( CreateSlackChannelEndpointDtoContext2$outboundSchema.parse( createSlackChannelEndpointDtoContext2, ), ); } /** @internal */ export type CreateSlackChannelEndpointDtoContext$Outbound = | CreateSlackChannelEndpointDtoContext2$Outbound | string; /** @internal */ export const CreateSlackChannelEndpointDtoContext$outboundSchema: z.ZodType< CreateSlackChannelEndpointDtoContext$Outbound, z.ZodTypeDef, CreateSlackChannelEndpointDtoContext > = z.union([ z.lazy(() => CreateSlackChannelEndpointDtoContext2$outboundSchema), z.string(), ]); export function createSlackChannelEndpointDtoContextToJSON( createSlackChannelEndpointDtoContext: CreateSlackChannelEndpointDtoContext, ): string { return JSON.stringify( CreateSlackChannelEndpointDtoContext$outboundSchema.parse( createSlackChannelEndpointDtoContext, ), ); } /** @internal */ export type CreateSlackChannelEndpointDto$Outbound = { identifier?: string | undefined; subscriberId: string; context?: { [k: string]: CreateSlackChannelEndpointDtoContext2$Outbound | string; } | undefined; integrationIdentifier: string; connectionIdentifier?: string | undefined; type: "slack_channel"; endpoint: SlackChannelEndpointDto$Outbound; }; /** @internal */ export const CreateSlackChannelEndpointDto$outboundSchema: z.ZodType< CreateSlackChannelEndpointDto$Outbound, z.ZodTypeDef, CreateSlackChannelEndpointDto > = z.object({ identifier: z.string().optional(), subscriberId: z.string(), context: z.record( z.union([ z.lazy(() => CreateSlackChannelEndpointDtoContext2$outboundSchema), z.string(), ]), ).optional(), integrationIdentifier: z.string(), connectionIdentifier: z.string().optional(), type: z.literal("slack_channel"), endpoint: SlackChannelEndpointDto$outboundSchema, }); export function createSlackChannelEndpointDtoToJSON( createSlackChannelEndpointDto: CreateSlackChannelEndpointDto, ): string { return JSON.stringify( CreateSlackChannelEndpointDto$outboundSchema.parse( createSlackChannelEndpointDto, ), ); }