/* * 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 { EscalationPathRoundRobinConfigV2, EscalationPathRoundRobinConfigV2$inboundSchema, EscalationPathRoundRobinConfigV2$Outbound, EscalationPathRoundRobinConfigV2$outboundSchema, } from "./escalationpathroundrobinconfigv2.js"; import { EscalationPathTargetV2, EscalationPathTargetV2$inboundSchema, EscalationPathTargetV2$Outbound, EscalationPathTargetV2$outboundSchema, } from "./escalationpathtargetv2.js"; /** * If the time to ack is relative to a time window, this defines whether we move when the window is active or inactive */ export const TimeToAckIntervalCondition = { Active: "active", Inactive: "inactive", } as const; /** * If the time to ack is relative to a time window, this defines whether we move when the window is active or inactive */ export type TimeToAckIntervalCondition = ClosedEnum< typeof TimeToAckIntervalCondition >; export type EscalationPathNodeLevelV2 = { roundRobinConfig?: EscalationPathRoundRobinConfigV2 | undefined; /** * The targets for this level */ targets: Array; /** * If the time to ack is relative to a time window, this defines whether we move when the window is active or inactive */ timeToAckIntervalCondition?: TimeToAckIntervalCondition | undefined; /** * How long should we wait for this level to acknowledge before escalating? */ timeToAckSeconds?: number | undefined; /** * If the time to ack is relative to a time window, this identifies which window it is relative to */ timeToAckWeekdayIntervalConfigId?: string | undefined; }; /** @internal */ export const TimeToAckIntervalCondition$inboundSchema: z.ZodNativeEnum< typeof TimeToAckIntervalCondition > = z.nativeEnum(TimeToAckIntervalCondition); /** @internal */ export const TimeToAckIntervalCondition$outboundSchema: z.ZodNativeEnum< typeof TimeToAckIntervalCondition > = TimeToAckIntervalCondition$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TimeToAckIntervalCondition$ { /** @deprecated use `TimeToAckIntervalCondition$inboundSchema` instead. */ export const inboundSchema = TimeToAckIntervalCondition$inboundSchema; /** @deprecated use `TimeToAckIntervalCondition$outboundSchema` instead. */ export const outboundSchema = TimeToAckIntervalCondition$outboundSchema; } /** @internal */ export const EscalationPathNodeLevelV2$inboundSchema: z.ZodType< EscalationPathNodeLevelV2, z.ZodTypeDef, unknown > = z.object({ round_robin_config: EscalationPathRoundRobinConfigV2$inboundSchema.optional(), targets: z.array(EscalationPathTargetV2$inboundSchema), time_to_ack_interval_condition: TimeToAckIntervalCondition$inboundSchema .optional(), time_to_ack_seconds: z.number().int().optional(), time_to_ack_weekday_interval_config_id: z.string().optional(), }).transform((v) => { return remap$(v, { "round_robin_config": "roundRobinConfig", "time_to_ack_interval_condition": "timeToAckIntervalCondition", "time_to_ack_seconds": "timeToAckSeconds", "time_to_ack_weekday_interval_config_id": "timeToAckWeekdayIntervalConfigId", }); }); /** @internal */ export type EscalationPathNodeLevelV2$Outbound = { round_robin_config?: EscalationPathRoundRobinConfigV2$Outbound | undefined; targets: Array; time_to_ack_interval_condition?: string | undefined; time_to_ack_seconds?: number | undefined; time_to_ack_weekday_interval_config_id?: string | undefined; }; /** @internal */ export const EscalationPathNodeLevelV2$outboundSchema: z.ZodType< EscalationPathNodeLevelV2$Outbound, z.ZodTypeDef, EscalationPathNodeLevelV2 > = z.object({ roundRobinConfig: EscalationPathRoundRobinConfigV2$outboundSchema.optional(), targets: z.array(EscalationPathTargetV2$outboundSchema), timeToAckIntervalCondition: TimeToAckIntervalCondition$outboundSchema .optional(), timeToAckSeconds: z.number().int().optional(), timeToAckWeekdayIntervalConfigId: z.string().optional(), }).transform((v) => { return remap$(v, { roundRobinConfig: "round_robin_config", timeToAckIntervalCondition: "time_to_ack_interval_condition", timeToAckSeconds: "time_to_ack_seconds", timeToAckWeekdayIntervalConfigId: "time_to_ack_weekday_interval_config_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EscalationPathNodeLevelV2$ { /** @deprecated use `EscalationPathNodeLevelV2$inboundSchema` instead. */ export const inboundSchema = EscalationPathNodeLevelV2$inboundSchema; /** @deprecated use `EscalationPathNodeLevelV2$outboundSchema` instead. */ export const outboundSchema = EscalationPathNodeLevelV2$outboundSchema; /** @deprecated use `EscalationPathNodeLevelV2$Outbound` instead. */ export type Outbound = EscalationPathNodeLevelV2$Outbound; }