/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PhoneEndpointDto, PhoneEndpointDto$inboundSchema, } from "./phoneendpointdto.js"; import { SlackChannelEndpointDto, SlackChannelEndpointDto$inboundSchema, } from "./slackchannelendpointdto.js"; import { SlackUserEndpointDto, SlackUserEndpointDto$inboundSchema, } from "./slackuserendpointdto.js"; import { WebhookEndpointDto, WebhookEndpointDto$inboundSchema, } from "./webhookendpointdto.js"; /** * The channel type (email, sms, push, chat, etc.). */ export const GetChannelEndpointResponseDtoChannel = { InApp: "in_app", Email: "email", Sms: "sms", Chat: "chat", Push: "push", } as const; /** * The channel type (email, sms, push, chat, etc.). */ export type GetChannelEndpointResponseDtoChannel = ClosedEnum< typeof GetChannelEndpointResponseDtoChannel >; /** * The provider identifier (e.g., sendgrid, twilio, slack, etc.). */ export const GetChannelEndpointResponseDtoProviderId = { Emailjs: "emailjs", Mailgun: "mailgun", Mailjet: "mailjet", Mandrill: "mandrill", Nodemailer: "nodemailer", Postmark: "postmark", Sendgrid: "sendgrid", Sendinblue: "sendinblue", Ses: "ses", Netcore: "netcore", InfobipEmail: "infobip-email", Resend: "resend", Plunk: "plunk", Mailersend: "mailersend", Mailtrap: "mailtrap", Clickatell: "clickatell", Outlook365: "outlook365", NovuEmail: "novu-email", Sparkpost: "sparkpost", EmailWebhook: "email-webhook", Braze: "braze", NovuEmailAgent: "novu-email-agent", Nexmo: "nexmo", Plivo: "plivo", Sms77: "sms77", SmsCentral: "sms-central", Sns: "sns", Telnyx: "telnyx", Twilio: "twilio", Gupshup: "gupshup", Firetext: "firetext", InfobipSms: "infobip-sms", BurstSms: "burst-sms", BulkSms: "bulk-sms", IsendSms: "isend-sms", FortySixElks: "forty-six-elks", Kannel: "kannel", Maqsam: "maqsam", Termii: "termii", AfricasTalking: "africas-talking", NovuSms: "novu-sms", Sendchamp: "sendchamp", GenericSms: "generic-sms", Clicksend: "clicksend", Bandwidth: "bandwidth", Messagebird: "messagebird", Simpletexting: "simpletexting", AzureSms: "azure-sms", RingCentral: "ring-central", BrevoSms: "brevo-sms", EazySms: "eazy-sms", Mobishastra: "mobishastra", AfroMessage: "afro-message", Unifonic: "unifonic", Smsmode: "smsmode", Imedia: "imedia", Sinch: "sinch", IsendproSms: "isendpro-sms", CmTelecom: "cm-telecom", Fcm: "fcm", Apns: "apns", Expo: "expo", OneSignal: "one-signal", Pushpad: "pushpad", PushWebhook: "push-webhook", PusherBeams: "pusher-beams", Appio: "appio", Novu: "novu", Slack: "slack", Discord: "discord", Msteams: "msteams", Mattermost: "mattermost", Ryver: "ryver", Zulip: "zulip", GrafanaOnCall: "grafana-on-call", Getstream: "getstream", RocketChat: "rocket-chat", WhatsappBusiness: "whatsapp-business", ChatWebhook: "chat-webhook", NovuSlack: "novu-slack", Anthropic: "anthropic", } as const; /** * The provider identifier (e.g., sendgrid, twilio, slack, etc.). */ export type GetChannelEndpointResponseDtoProviderId = ClosedEnum< typeof GetChannelEndpointResponseDtoProviderId >; /** * Type of channel endpoint */ export const GetChannelEndpointResponseDtoType = { SlackChannel: "slack_channel", SlackUser: "slack_user", Webhook: "webhook", Phone: "phone", MsTeamsChannel: "ms_teams_channel", MsTeamsUser: "ms_teams_user", } as const; /** * Type of channel endpoint */ export type GetChannelEndpointResponseDtoType = ClosedEnum< typeof GetChannelEndpointResponseDtoType >; /** * Endpoint data specific to the channel type */ export type Endpoint = | SlackChannelEndpointDto | SlackUserEndpointDto | WebhookEndpointDto | PhoneEndpointDto; export type GetChannelEndpointResponseDto = { /** * The unique identifier of the channel endpoint. */ identifier: string; /** * The channel type (email, sms, push, chat, etc.). */ channel: GetChannelEndpointResponseDtoChannel | null; /** * The provider identifier (e.g., sendgrid, twilio, slack, etc.). */ providerId: GetChannelEndpointResponseDtoProviderId | null; /** * The identifier of the integration to use for this channel endpoint. */ integrationIdentifier: string | null; /** * The identifier of the channel connection used for this endpoint. */ connectionIdentifier: string | null; /** * The subscriber ID to which the channel endpoint is linked */ subscriberId: string | null; /** * The context of the channel connection */ contextKeys: Array; /** * Type of channel endpoint */ type: GetChannelEndpointResponseDtoType; /** * Endpoint data specific to the channel type */ endpoint: | SlackChannelEndpointDto | SlackUserEndpointDto | WebhookEndpointDto | PhoneEndpointDto; /** * The timestamp indicating when the channel endpoint was created, in ISO 8601 format. */ createdAt: string; /** * The timestamp indicating when the channel endpoint was last updated, in ISO 8601 format. */ updatedAt: string; }; /** @internal */ export const GetChannelEndpointResponseDtoChannel$inboundSchema: z.ZodNativeEnum = z.nativeEnum( GetChannelEndpointResponseDtoChannel, ); /** @internal */ export const GetChannelEndpointResponseDtoProviderId$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetChannelEndpointResponseDtoProviderId); /** @internal */ export const GetChannelEndpointResponseDtoType$inboundSchema: z.ZodNativeEnum< typeof GetChannelEndpointResponseDtoType > = z.nativeEnum(GetChannelEndpointResponseDtoType); /** @internal */ export const Endpoint$inboundSchema: z.ZodType< Endpoint, z.ZodTypeDef, unknown > = z.union([ SlackChannelEndpointDto$inboundSchema, SlackUserEndpointDto$inboundSchema, WebhookEndpointDto$inboundSchema, PhoneEndpointDto$inboundSchema, ]); export function endpointFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Endpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Endpoint' from JSON`, ); } /** @internal */ export const GetChannelEndpointResponseDto$inboundSchema: z.ZodType< GetChannelEndpointResponseDto, z.ZodTypeDef, unknown > = z.object({ identifier: z.string(), channel: z.nullable(GetChannelEndpointResponseDtoChannel$inboundSchema), providerId: z.nullable(GetChannelEndpointResponseDtoProviderId$inboundSchema), integrationIdentifier: z.nullable(z.string()), connectionIdentifier: z.nullable(z.string()), subscriberId: z.nullable(z.string()), contextKeys: z.array(z.string()), type: GetChannelEndpointResponseDtoType$inboundSchema, endpoint: z.union([ SlackChannelEndpointDto$inboundSchema, SlackUserEndpointDto$inboundSchema, WebhookEndpointDto$inboundSchema, PhoneEndpointDto$inboundSchema, ]), createdAt: z.string(), updatedAt: z.string(), }); export function getChannelEndpointResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetChannelEndpointResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetChannelEndpointResponseDto' from JSON`, ); }