/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { AlertRouteEscalationBindingPayloadV2, AlertRouteEscalationBindingPayloadV2$inboundSchema, AlertRouteEscalationBindingPayloadV2$Outbound, AlertRouteEscalationBindingPayloadV2$outboundSchema, } from "./alertrouteescalationbindingpayloadv2.js"; import { AlertRouteIncidentTemplatePayloadV2, AlertRouteIncidentTemplatePayloadV2$inboundSchema, AlertRouteIncidentTemplatePayloadV2$Outbound, AlertRouteIncidentTemplatePayloadV2$outboundSchema, } from "./alertrouteincidenttemplatepayloadv2.js"; import { ConditionGroupPayloadV2, ConditionGroupPayloadV2$inboundSchema, ConditionGroupPayloadV2$Outbound, ConditionGroupPayloadV2$outboundSchema, } from "./conditiongrouppayloadv2.js"; import { ExpressionPayloadV2, ExpressionPayloadV2$inboundSchema, ExpressionPayloadV2$Outbound, ExpressionPayloadV2$outboundSchema, } from "./expressionpayloadv2.js"; import { GroupingKeyV2, GroupingKeyV2$inboundSchema, GroupingKeyV2$Outbound, GroupingKeyV2$outboundSchema, } from "./groupingkeyv2.js"; export type CreateRequestBody = { /** * Legacy field - the alert sources that will match this alert route */ alertSourceIds?: Array | undefined; /** * Should triage incidents be declined when alerts are resolved? */ autoDeclineEnabled?: boolean | undefined; /** * What condition groups must be true for this alert route to fire? */ conditionGroups?: Array | undefined; /** * How long should the escalation defer time be? */ deferTimeSeconds?: number | undefined; /** * Whether this alert route is enabled or not */ enabled?: boolean | undefined; /** * Which escalation paths should this alert route escalate to? */ escalationBindings?: Array | undefined; /** * The expressions used in this template */ expressions?: Array | undefined; /** * Which attributes should this alert route use to group alerts? */ groupingKeys?: Array | undefined; /** * How large should the grouping window be? */ groupingWindowSeconds?: number | undefined; /** * What condition groups must be true for this alert route to create an incident? */ incidentConditionGroups?: Array | undefined; /** * Whether this alert route will create incidents or not */ incidentEnabled?: boolean | undefined; /** * The name of this alert route config, for the user's reference */ name?: string | undefined; template?: AlertRouteIncidentTemplatePayloadV2 | undefined; }; /** @internal */ export const CreateRequestBody$inboundSchema: z.ZodType< CreateRequestBody, z.ZodTypeDef, unknown > = z.object({ alert_source_ids: z.array(z.string()).optional(), auto_decline_enabled: z.boolean().optional(), condition_groups: z.array(ConditionGroupPayloadV2$inboundSchema).optional(), defer_time_seconds: z.number().int().optional(), enabled: z.boolean().optional(), escalation_bindings: z.array( AlertRouteEscalationBindingPayloadV2$inboundSchema, ).optional(), expressions: z.array(ExpressionPayloadV2$inboundSchema).optional(), grouping_keys: z.array(GroupingKeyV2$inboundSchema).optional(), grouping_window_seconds: z.number().int().optional(), incident_condition_groups: z.array(ConditionGroupPayloadV2$inboundSchema) .optional(), incident_enabled: z.boolean().optional(), name: z.string().optional(), template: AlertRouteIncidentTemplatePayloadV2$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "alert_source_ids": "alertSourceIds", "auto_decline_enabled": "autoDeclineEnabled", "condition_groups": "conditionGroups", "defer_time_seconds": "deferTimeSeconds", "escalation_bindings": "escalationBindings", "grouping_keys": "groupingKeys", "grouping_window_seconds": "groupingWindowSeconds", "incident_condition_groups": "incidentConditionGroups", "incident_enabled": "incidentEnabled", }); }); /** @internal */ export type CreateRequestBody$Outbound = { alert_source_ids?: Array | undefined; auto_decline_enabled?: boolean | undefined; condition_groups?: Array | undefined; defer_time_seconds?: number | undefined; enabled?: boolean | undefined; escalation_bindings?: | Array | undefined; expressions?: Array | undefined; grouping_keys?: Array | undefined; grouping_window_seconds?: number | undefined; incident_condition_groups?: | Array | undefined; incident_enabled?: boolean | undefined; name?: string | undefined; template?: AlertRouteIncidentTemplatePayloadV2$Outbound | undefined; }; /** @internal */ export const CreateRequestBody$outboundSchema: z.ZodType< CreateRequestBody$Outbound, z.ZodTypeDef, CreateRequestBody > = z.object({ alertSourceIds: z.array(z.string()).optional(), autoDeclineEnabled: z.boolean().optional(), conditionGroups: z.array(ConditionGroupPayloadV2$outboundSchema).optional(), deferTimeSeconds: z.number().int().optional(), enabled: z.boolean().optional(), escalationBindings: z.array( AlertRouteEscalationBindingPayloadV2$outboundSchema, ).optional(), expressions: z.array(ExpressionPayloadV2$outboundSchema).optional(), groupingKeys: z.array(GroupingKeyV2$outboundSchema).optional(), groupingWindowSeconds: z.number().int().optional(), incidentConditionGroups: z.array(ConditionGroupPayloadV2$outboundSchema) .optional(), incidentEnabled: z.boolean().optional(), name: z.string().optional(), template: AlertRouteIncidentTemplatePayloadV2$outboundSchema.optional(), }).transform((v) => { return remap$(v, { alertSourceIds: "alert_source_ids", autoDeclineEnabled: "auto_decline_enabled", conditionGroups: "condition_groups", deferTimeSeconds: "defer_time_seconds", escalationBindings: "escalation_bindings", groupingKeys: "grouping_keys", groupingWindowSeconds: "grouping_window_seconds", incidentConditionGroups: "incident_condition_groups", incidentEnabled: "incident_enabled", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateRequestBody$ { /** @deprecated use `CreateRequestBody$inboundSchema` instead. */ export const inboundSchema = CreateRequestBody$inboundSchema; /** @deprecated use `CreateRequestBody$outboundSchema` instead. */ export const outboundSchema = CreateRequestBody$outboundSchema; /** @deprecated use `CreateRequestBody$Outbound` instead. */ export type Outbound = CreateRequestBody$Outbound; }