/* * 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 UpdateRequestBody = { /** * Legacy field - the alert sources that will match this alert route */ alertSourceIds: Array; /** * Should triage incidents be declined when alerts are resolved? */ autoDeclineEnabled: boolean; /** * What condition groups must be true for this alert route to fire? */ conditionGroups: Array; /** * How long should the escalation defer time be? */ deferTimeSeconds: number; /** * Whether this alert route is enabled or not */ enabled: boolean; /** * Which escalation paths should this alert route escalate to? */ escalationBindings: Array; /** * The expressions used in this template */ expressions?: Array | undefined; /** * Which attributes should this alert route use to group alerts? */ groupingKeys: Array; /** * How large should the grouping window be? */ groupingWindowSeconds: number; /** * What condition groups must be true for this alert route to create an incident? */ incidentConditionGroups: Array; /** * Whether this alert route will create incidents or not */ incidentEnabled: boolean; /** * The name of this alert route config, for the user's reference */ name: string; template?: AlertRouteIncidentTemplatePayloadV2 | undefined; }; /** @internal */ export const UpdateRequestBody$inboundSchema: z.ZodType< UpdateRequestBody, z.ZodTypeDef, unknown > = z.object({ alert_source_ids: z.array(z.string()), auto_decline_enabled: z.boolean(), condition_groups: z.array(ConditionGroupPayloadV2$inboundSchema), defer_time_seconds: z.number().int(), enabled: z.boolean(), escalation_bindings: z.array( AlertRouteEscalationBindingPayloadV2$inboundSchema, ), expressions: z.array(ExpressionPayloadV2$inboundSchema).optional(), grouping_keys: z.array(GroupingKeyV2$inboundSchema), grouping_window_seconds: z.number().int(), incident_condition_groups: z.array(ConditionGroupPayloadV2$inboundSchema), incident_enabled: z.boolean(), name: z.string(), 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 UpdateRequestBody$Outbound = { alert_source_ids: Array; auto_decline_enabled: boolean; condition_groups: Array; defer_time_seconds: number; enabled: boolean; escalation_bindings: Array; expressions?: Array | undefined; grouping_keys: Array; grouping_window_seconds: number; incident_condition_groups: Array; incident_enabled: boolean; name: string; template?: AlertRouteIncidentTemplatePayloadV2$Outbound | undefined; }; /** @internal */ export const UpdateRequestBody$outboundSchema: z.ZodType< UpdateRequestBody$Outbound, z.ZodTypeDef, UpdateRequestBody > = z.object({ alertSourceIds: z.array(z.string()), autoDeclineEnabled: z.boolean(), conditionGroups: z.array(ConditionGroupPayloadV2$outboundSchema), deferTimeSeconds: z.number().int(), enabled: z.boolean(), escalationBindings: z.array( AlertRouteEscalationBindingPayloadV2$outboundSchema, ), expressions: z.array(ExpressionPayloadV2$outboundSchema).optional(), groupingKeys: z.array(GroupingKeyV2$outboundSchema), groupingWindowSeconds: z.number().int(), incidentConditionGroups: z.array(ConditionGroupPayloadV2$outboundSchema), incidentEnabled: z.boolean(), name: z.string(), 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 UpdateRequestBody$ { /** @deprecated use `UpdateRequestBody$inboundSchema` instead. */ export const inboundSchema = UpdateRequestBody$inboundSchema; /** @deprecated use `UpdateRequestBody$outboundSchema` instead. */ export const outboundSchema = UpdateRequestBody$outboundSchema; /** @deprecated use `UpdateRequestBody$Outbound` instead. */ export type Outbound = UpdateRequestBody$Outbound; }