|
| 1 | +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 2 | +# This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 3 | +# Copyright 2019-Present Datadog, Inc. |
| 4 | +from __future__ import annotations |
| 5 | + |
| 6 | +from typing import Union, TYPE_CHECKING |
| 7 | + |
| 8 | +from datadog_api_client.model_utils import ( |
| 9 | + ModelNormal, |
| 10 | + cached_property, |
| 11 | + unset, |
| 12 | + UnsetType, |
| 13 | +) |
| 14 | + |
| 15 | + |
| 16 | +if TYPE_CHECKING: |
| 17 | + from datadog_api_client.v2.model.time_restrictions import TimeRestrictions |
| 18 | + from datadog_api_client.v2.model.routing_rule_escalation_policy_action_type import ( |
| 19 | + RoutingRuleEscalationPolicyActionType, |
| 20 | + ) |
| 21 | + from datadog_api_client.v2.model.urgency import Urgency |
| 22 | + |
| 23 | + |
| 24 | +class RoutingRuleEscalationPolicyAction(ModelNormal): |
| 25 | + @cached_property |
| 26 | + def openapi_types(_): |
| 27 | + from datadog_api_client.v2.model.time_restrictions import TimeRestrictions |
| 28 | + from datadog_api_client.v2.model.routing_rule_escalation_policy_action_type import ( |
| 29 | + RoutingRuleEscalationPolicyActionType, |
| 30 | + ) |
| 31 | + from datadog_api_client.v2.model.urgency import Urgency |
| 32 | + |
| 33 | + return { |
| 34 | + "ack_timeout_minutes": (int,), |
| 35 | + "policy_id": (str,), |
| 36 | + "support_hours": (TimeRestrictions,), |
| 37 | + "type": (RoutingRuleEscalationPolicyActionType,), |
| 38 | + "urgency": (Urgency,), |
| 39 | + } |
| 40 | + |
| 41 | + attribute_map = { |
| 42 | + "ack_timeout_minutes": "ack_timeout_minutes", |
| 43 | + "policy_id": "policy_id", |
| 44 | + "support_hours": "support_hours", |
| 45 | + "type": "type", |
| 46 | + "urgency": "urgency", |
| 47 | + } |
| 48 | + |
| 49 | + def __init__( |
| 50 | + self_, |
| 51 | + policy_id: str, |
| 52 | + type: RoutingRuleEscalationPolicyActionType, |
| 53 | + ack_timeout_minutes: Union[int, UnsetType] = unset, |
| 54 | + support_hours: Union[TimeRestrictions, UnsetType] = unset, |
| 55 | + urgency: Union[Urgency, UnsetType] = unset, |
| 56 | + **kwargs, |
| 57 | + ): |
| 58 | + """ |
| 59 | + Routes the page to an escalation policy, optionally restricted to business hours. |
| 60 | +
|
| 61 | + :param ack_timeout_minutes: The number of minutes before an acknowledged page is re-triggered. |
| 62 | + :type ack_timeout_minutes: int, optional |
| 63 | +
|
| 64 | + :param policy_id: The ID of the escalation policy to route to. |
| 65 | + :type policy_id: str |
| 66 | +
|
| 67 | + :param support_hours: Holds time zone information and a list of time restrictions for a routing rule. |
| 68 | + :type support_hours: TimeRestrictions, optional |
| 69 | +
|
| 70 | + :param type: Indicates that the action routes to an escalation policy. |
| 71 | + :type type: RoutingRuleEscalationPolicyActionType |
| 72 | +
|
| 73 | + :param urgency: Specifies the level of urgency for a routing rule (low, high, or dynamic). |
| 74 | + :type urgency: Urgency, optional |
| 75 | + """ |
| 76 | + if ack_timeout_minutes is not unset: |
| 77 | + kwargs["ack_timeout_minutes"] = ack_timeout_minutes |
| 78 | + if support_hours is not unset: |
| 79 | + kwargs["support_hours"] = support_hours |
| 80 | + if urgency is not unset: |
| 81 | + kwargs["urgency"] = urgency |
| 82 | + super().__init__(kwargs) |
| 83 | + |
| 84 | + self_.policy_id = policy_id |
| 85 | + self_.type = type |
0 commit comments