Skip to content

Commit 9f1c2b1

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1aaa45c of spec repo
1 parent 475987d commit 9f1c2b1

12 files changed

Lines changed: 224 additions & 29 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60087,6 +60087,7 @@ components:
6008760087
- $ref: "#/components/schemas/SendSlackMessageAction"
6008860088
- $ref: "#/components/schemas/SendTeamsMessageAction"
6008960089
- $ref: "#/components/schemas/TriggerWorkflowAutomationAction"
60090+
- $ref: "#/components/schemas/RoutingRuleEscalationPolicyAction"
6009060091
RoutingRuleAttributes:
6009160092
description: Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
6009260093
properties:
@@ -60104,6 +60105,37 @@ components:
6010460105
urgency:
6010560106
$ref: "#/components/schemas/Urgency"
6010660107
type: object
60108+
RoutingRuleEscalationPolicyAction:
60109+
description: "Routes the page to an escalation policy, optionally restricted to business hours."
60110+
properties:
60111+
ack_timeout_minutes:
60112+
description: "The number of minutes before an acknowledged page is re-triggered."
60113+
example: 10
60114+
format: int64
60115+
type: integer
60116+
policy_id:
60117+
description: "The ID of the escalation policy to route to."
60118+
example: "00000000-0000-0000-0000-000000000000"
60119+
type: string
60120+
support_hours:
60121+
$ref: "#/components/schemas/TimeRestrictions"
60122+
type:
60123+
$ref: "#/components/schemas/RoutingRuleEscalationPolicyActionType"
60124+
urgency:
60125+
$ref: "#/components/schemas/Urgency"
60126+
required:
60127+
- type
60128+
- policy_id
60129+
type: object
60130+
RoutingRuleEscalationPolicyActionType:
60131+
default: escalation_policy
60132+
description: "Indicates that the action routes to an escalation policy."
60133+
enum:
60134+
- escalation_policy
60135+
example: escalation_policy
60136+
type: string
60137+
x-enum-varnames:
60138+
- ESCALATION_POLICY
6010760139
RoutingRuleRelationships:
6010860140
description: Specifies relationships for a routing rule, linking to associated policy resources.
6010960141
properties:

docs/datadog_api_client.v2.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26303,6 +26303,20 @@ datadog\_api\_client.v2.model.routing\_rule\_attributes module
2630326303
:members:
2630426304
:show-inheritance:
2630526305

26306+
datadog\_api\_client.v2.model.routing\_rule\_escalation\_policy\_action module
26307+
------------------------------------------------------------------------------
26308+
26309+
.. automodule:: datadog_api_client.v2.model.routing_rule_escalation_policy_action
26310+
:members:
26311+
:show-inheritance:
26312+
26313+
datadog\_api\_client.v2.model.routing\_rule\_escalation\_policy\_action\_type module
26314+
------------------------------------------------------------------------------------
26315+
26316+
.. automodule:: datadog_api_client.v2.model.routing_rule_escalation_policy_action_type
26317+
:members:
26318+
:show-inheritance:
26319+
2630626320
datadog\_api\_client.v2.model.routing\_rule\_relationships module
2630726321
-----------------------------------------------------------------
2630826322

examples/v2/on-call/SetOnCallTeamRoutingRules.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from os import environ
66
from datadog_api_client import ApiClient, Configuration
77
from datadog_api_client.v2.api.on_call_api import OnCallApi
8-
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
9-
from datadog_api_client.v2.model.send_slack_message_action_type import SendSlackMessageActionType
8+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action import RoutingRuleEscalationPolicyAction
9+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action_type import RoutingRuleEscalationPolicyActionType
1010
from datadog_api_client.v2.model.team_routing_rules_request import TeamRoutingRulesRequest
1111
from datadog_api_client.v2.model.team_routing_rules_request_data import TeamRoutingRulesRequestData
1212
from datadog_api_client.v2.model.team_routing_rules_request_data_attributes import TeamRoutingRulesRequestDataAttributes
@@ -29,10 +29,11 @@
2929
rules=[
3030
TeamRoutingRulesRequestRule(
3131
actions=[
32-
SendSlackMessageAction(
33-
channel="channel",
34-
type=SendSlackMessageActionType.SEND_SLACK_MESSAGE,
35-
workspace="workspace",
32+
RoutingRuleEscalationPolicyAction(
33+
type=RoutingRuleEscalationPolicyActionType.ESCALATION_POLICY,
34+
policy_id=ESCALATION_POLICY_DATA_ID,
35+
urgency=Urgency.LOW,
36+
ack_timeout_minutes=30,
3637
),
3738
],
3839
query="tags.service:test",

src/datadog_api_client/v2/model/routing_rule_action.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ def __init__(self, **kwargs):
3232
3333
:param handle: The handle of the Workflow Automation to trigger.
3434
:type handle: str
35+
36+
:param ack_timeout_minutes: The number of minutes before an acknowledged page is re-triggered.
37+
:type ack_timeout_minutes: int, optional
38+
39+
:param policy_id: The ID of the escalation policy to route to.
40+
:type policy_id: str
41+
42+
:param support_hours: Holds time zone information and a list of time restrictions for a routing rule.
43+
:type support_hours: TimeRestrictions, optional
44+
45+
:param urgency: Specifies the level of urgency for a routing rule (low, high, or dynamic).
46+
:type urgency: Urgency, optional
3547
"""
3648
super().__init__(kwargs)
3749

@@ -47,11 +59,13 @@ def _composed_schemas(_):
4759
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
4860
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
4961
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction
62+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action import RoutingRuleEscalationPolicyAction
5063

5164
return {
5265
"oneOf": [
5366
SendSlackMessageAction,
5467
SendTeamsMessageAction,
5568
TriggerWorkflowAutomationAction,
69+
RoutingRuleEscalationPolicyAction,
5670
],
5771
}

src/datadog_api_client/v2/model/routing_rule_attributes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
2121
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
2222
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction
23+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action import RoutingRuleEscalationPolicyAction
2324

2425

2526
class RoutingRuleAttributes(ModelNormal):
@@ -48,7 +49,11 @@ def __init__(
4849
actions: Union[
4950
List[
5051
Union[
51-
RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction, TriggerWorkflowAutomationAction
52+
RoutingRuleAction,
53+
SendSlackMessageAction,
54+
SendTeamsMessageAction,
55+
TriggerWorkflowAutomationAction,
56+
RoutingRuleEscalationPolicyAction,
5257
]
5358
],
5459
UnsetType,
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class RoutingRuleEscalationPolicyActionType(ModelSimple):
16+
"""
17+
Indicates that the action routes to an escalation policy.
18+
19+
:param value: If omitted defaults to "escalation_policy". Must be one of ["escalation_policy"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"escalation_policy",
25+
}
26+
ESCALATION_POLICY: ClassVar["RoutingRuleEscalationPolicyActionType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
RoutingRuleEscalationPolicyActionType.ESCALATION_POLICY = RoutingRuleEscalationPolicyActionType("escalation_policy")

src/datadog_api_client/v2/model/team_routing_rules_request_rule.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
2121
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
2222
from datadog_api_client.v2.model.trigger_workflow_automation_action import TriggerWorkflowAutomationAction
23+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action import RoutingRuleEscalationPolicyAction
2324

2425

2526
class TeamRoutingRulesRequestRule(ModelNormal):
@@ -50,7 +51,11 @@ def __init__(
5051
actions: Union[
5152
List[
5253
Union[
53-
RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction, TriggerWorkflowAutomationAction
54+
RoutingRuleAction,
55+
SendSlackMessageAction,
56+
SendTeamsMessageAction,
57+
TriggerWorkflowAutomationAction,
58+
RoutingRuleEscalationPolicyAction,
5459
]
5560
],
5661
UnsetType,

src/datadog_api_client/v2/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5401,6 +5401,8 @@
54015401
from datadog_api_client.v2.model.routing_rule import RoutingRule
54025402
from datadog_api_client.v2.model.routing_rule_action import RoutingRuleAction
54035403
from datadog_api_client.v2.model.routing_rule_attributes import RoutingRuleAttributes
5404+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action import RoutingRuleEscalationPolicyAction
5405+
from datadog_api_client.v2.model.routing_rule_escalation_policy_action_type import RoutingRuleEscalationPolicyActionType
54045406
from datadog_api_client.v2.model.routing_rule_relationships import RoutingRuleRelationships
54055407
from datadog_api_client.v2.model.routing_rule_relationships_policy import RoutingRuleRelationshipsPolicy
54065408
from datadog_api_client.v2.model.routing_rule_relationships_policy_data import RoutingRuleRelationshipsPolicyData
@@ -11390,6 +11392,8 @@
1139011392
"RoutingRule",
1139111393
"RoutingRuleAction",
1139211394
"RoutingRuleAttributes",
11395+
"RoutingRuleEscalationPolicyAction",
11396+
"RoutingRuleEscalationPolicyActionType",
1139311397
"RoutingRuleRelationships",
1139411398
"RoutingRuleRelationshipsPolicy",
1139511399
"RoutingRuleRelationshipsPolicyData",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-11-27T14:11:49.966Z
1+
2026-05-13T17:02:48.620Z

0 commit comments

Comments
 (0)