/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; import { EscalationPathNodeIfElsePayloadV2, EscalationPathNodeIfElsePayloadV2$inboundSchema, EscalationPathNodeIfElsePayloadV2$Outbound, EscalationPathNodeIfElsePayloadV2$outboundSchema, } from "./escalationpathnodeifelsepayloadv2.js"; import { EscalationPathNodeLevelV2, EscalationPathNodeLevelV2$inboundSchema, EscalationPathNodeLevelV2$Outbound, EscalationPathNodeLevelV2$outboundSchema, } from "./escalationpathnodelevelv2.js"; import { EscalationPathNodeRepeatV2, EscalationPathNodeRepeatV2$inboundSchema, EscalationPathNodeRepeatV2$Outbound, EscalationPathNodeRepeatV2$outboundSchema, } from "./escalationpathnoderepeatv2.js"; /** * The type of this node: level or branch */ export const EscalationPathNodePayloadV2Type = { IfElse: "if_else", Repeat: "repeat", Level: "level", NotifyChannel: "notify_channel", } as const; /** * The type of this node: level or branch */ export type EscalationPathNodePayloadV2Type = ClosedEnum< typeof EscalationPathNodePayloadV2Type >; export type EscalationPathNodePayloadV2 = { /** * Unique internal ID of the escalation path node */ id: string; ifElse?: EscalationPathNodeIfElsePayloadV2 | undefined; level?: EscalationPathNodeLevelV2 | undefined; repeat?: EscalationPathNodeRepeatV2 | undefined; /** * The type of this node: level or branch */ type: EscalationPathNodePayloadV2Type; }; /** @internal */ export const EscalationPathNodePayloadV2Type$inboundSchema: z.ZodNativeEnum< typeof EscalationPathNodePayloadV2Type > = z.nativeEnum(EscalationPathNodePayloadV2Type); /** @internal */ export const EscalationPathNodePayloadV2Type$outboundSchema: z.ZodNativeEnum< typeof EscalationPathNodePayloadV2Type > = EscalationPathNodePayloadV2Type$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EscalationPathNodePayloadV2Type$ { /** @deprecated use `EscalationPathNodePayloadV2Type$inboundSchema` instead. */ export const inboundSchema = EscalationPathNodePayloadV2Type$inboundSchema; /** @deprecated use `EscalationPathNodePayloadV2Type$outboundSchema` instead. */ export const outboundSchema = EscalationPathNodePayloadV2Type$outboundSchema; } /** @internal */ export const EscalationPathNodePayloadV2$inboundSchema: z.ZodType< EscalationPathNodePayloadV2, z.ZodTypeDef, unknown > = z.object({ id: z.string(), if_else: EscalationPathNodeIfElsePayloadV2$inboundSchema.optional(), level: EscalationPathNodeLevelV2$inboundSchema.optional(), repeat: EscalationPathNodeRepeatV2$inboundSchema.optional(), type: EscalationPathNodePayloadV2Type$inboundSchema, }).transform((v) => { return remap$(v, { "if_else": "ifElse", }); }); /** @internal */ export type EscalationPathNodePayloadV2$Outbound = { id: string; if_else?: EscalationPathNodeIfElsePayloadV2$Outbound | undefined; level?: EscalationPathNodeLevelV2$Outbound | undefined; repeat?: EscalationPathNodeRepeatV2$Outbound | undefined; type: string; }; /** @internal */ export const EscalationPathNodePayloadV2$outboundSchema: z.ZodType< EscalationPathNodePayloadV2$Outbound, z.ZodTypeDef, EscalationPathNodePayloadV2 > = z.object({ id: z.string(), ifElse: EscalationPathNodeIfElsePayloadV2$outboundSchema.optional(), level: EscalationPathNodeLevelV2$outboundSchema.optional(), repeat: EscalationPathNodeRepeatV2$outboundSchema.optional(), type: EscalationPathNodePayloadV2Type$outboundSchema, }).transform((v) => { return remap$(v, { ifElse: "if_else", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EscalationPathNodePayloadV2$ { /** @deprecated use `EscalationPathNodePayloadV2$inboundSchema` instead. */ export const inboundSchema = EscalationPathNodePayloadV2$inboundSchema; /** @deprecated use `EscalationPathNodePayloadV2$outboundSchema` instead. */ export const outboundSchema = EscalationPathNodePayloadV2$outboundSchema; /** @deprecated use `EscalationPathNodePayloadV2$Outbound` instead. */ export type Outbound = EscalationPathNodePayloadV2$Outbound; }