/* * 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 { AuthDto, AuthDto$inboundSchema } from "./authdto.js"; import { WorkspaceDto, WorkspaceDto$inboundSchema } from "./workspacedto.js"; /** * The channel type (email, sms, push, chat, etc.). */ export const Channel = { InApp: "in_app", Email: "email", Sms: "sms", Chat: "chat", Push: "push", } as const; /** * The channel type (email, sms, push, chat, etc.). */ export type Channel = ClosedEnum; /** * The provider identifier (e.g., sendgrid, twilio, slack, etc.). */ export const ProviderId = { 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 ProviderId = ClosedEnum; export type GetChannelConnectionResponseDto = { /** * The unique identifier of the channel endpoint. */ identifier: string; /** * The channel type (email, sms, push, chat, etc.). */ channel: Channel | null; /** * The provider identifier (e.g., sendgrid, twilio, slack, etc.). */ providerId: ProviderId | null; /** * The identifier of the integration to use for this channel endpoint. */ integrationIdentifier: string | null; /** * The subscriber ID to which the channel connection is linked */ subscriberId: string | null; /** * The context of the channel connection */ contextKeys: Array; workspace: WorkspaceDto; auth: AuthDto; /** * 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 Channel$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Channel); /** @internal */ export const ProviderId$inboundSchema: z.ZodNativeEnum = z .nativeEnum(ProviderId); /** @internal */ export const GetChannelConnectionResponseDto$inboundSchema: z.ZodType< GetChannelConnectionResponseDto, z.ZodTypeDef, unknown > = z.object({ identifier: z.string(), channel: z.nullable(Channel$inboundSchema), providerId: z.nullable(ProviderId$inboundSchema), integrationIdentifier: z.nullable(z.string()), subscriberId: z.nullable(z.string()), contextKeys: z.array(z.string()), workspace: WorkspaceDto$inboundSchema, auth: AuthDto$inboundSchema, createdAt: z.string(), updatedAt: z.string(), }); export function getChannelConnectionResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetChannelConnectionResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetChannelConnectionResponseDto' from JSON`, ); }