/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { SlackUserEndpointDto, SlackUserEndpointDto$Outbound, SlackUserEndpointDto$outboundSchema, } from "./slackuserendpointdto.js"; /** * Rich context object with id and optional data */ export type CreateSlackUserEndpointDtoContext2 = { id: string; /** * Optional additional context data */ data?: { [k: string]: any } | undefined; }; export type CreateSlackUserEndpointDtoContext = | CreateSlackUserEndpointDtoContext2 | string; export type CreateSlackUserEndpointDto = { /** * 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]: CreateSlackUserEndpointDtoContext2 | 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_user"; /** * Slack user endpoint data */ endpoint: SlackUserEndpointDto; }; /** @internal */ export type CreateSlackUserEndpointDtoContext2$Outbound = { id: string; data?: { [k: string]: any } | undefined; }; /** @internal */ export const CreateSlackUserEndpointDtoContext2$outboundSchema: z.ZodType< CreateSlackUserEndpointDtoContext2$Outbound, z.ZodTypeDef, CreateSlackUserEndpointDtoContext2 > = z.object({ id: z.string(), data: z.record(z.any()).optional(), }); export function createSlackUserEndpointDtoContext2ToJSON( createSlackUserEndpointDtoContext2: CreateSlackUserEndpointDtoContext2, ): string { return JSON.stringify( CreateSlackUserEndpointDtoContext2$outboundSchema.parse( createSlackUserEndpointDtoContext2, ), ); } /** @internal */ export type CreateSlackUserEndpointDtoContext$Outbound = | CreateSlackUserEndpointDtoContext2$Outbound | string; /** @internal */ export const CreateSlackUserEndpointDtoContext$outboundSchema: z.ZodType< CreateSlackUserEndpointDtoContext$Outbound, z.ZodTypeDef, CreateSlackUserEndpointDtoContext > = z.union([ z.lazy(() => CreateSlackUserEndpointDtoContext2$outboundSchema), z.string(), ]); export function createSlackUserEndpointDtoContextToJSON( createSlackUserEndpointDtoContext: CreateSlackUserEndpointDtoContext, ): string { return JSON.stringify( CreateSlackUserEndpointDtoContext$outboundSchema.parse( createSlackUserEndpointDtoContext, ), ); } /** @internal */ export type CreateSlackUserEndpointDto$Outbound = { identifier?: string | undefined; subscriberId: string; context?: { [k: string]: CreateSlackUserEndpointDtoContext2$Outbound | string; } | undefined; integrationIdentifier: string; connectionIdentifier?: string | undefined; type: "slack_user"; endpoint: SlackUserEndpointDto$Outbound; }; /** @internal */ export const CreateSlackUserEndpointDto$outboundSchema: z.ZodType< CreateSlackUserEndpointDto$Outbound, z.ZodTypeDef, CreateSlackUserEndpointDto > = z.object({ identifier: z.string().optional(), subscriberId: z.string(), context: z.record( z.union([ z.lazy(() => CreateSlackUserEndpointDtoContext2$outboundSchema), z.string(), ]), ).optional(), integrationIdentifier: z.string(), connectionIdentifier: z.string().optional(), type: z.literal("slack_user"), endpoint: SlackUserEndpointDto$outboundSchema, }); export function createSlackUserEndpointDtoToJSON( createSlackUserEndpointDto: CreateSlackUserEndpointDto, ): string { return JSON.stringify( CreateSlackUserEndpointDto$outboundSchema.parse(createSlackUserEndpointDto), ); }