Skip to content

Commit 293b577

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
add include parameter to On-Call team rules test (#2582)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 7cc4c3b commit 293b577

16 files changed

+246
-123
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-27 10:37:47.296878",
8-
"spec_repo_commit": "c75940cb"
7+
"regenerated": "2025-05-27 15:21:04.559526",
8+
"spec_repo_commit": "97968943"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-27 10:37:47.323956",
13-
"spec_repo_commit": "c75940cb"
12+
"regenerated": "2025-05-27 15:21:04.576370",
13+
"spec_repo_commit": "97968943"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 63 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30384,8 +30384,8 @@ components:
3038430384
description: Defines an action that is executed when a routing rule matches
3038530385
certain criteria.
3038630386
oneOf:
30387-
- $ref: '#/components/schemas/SlackAction'
30388-
- $ref: '#/components/schemas/TeamsAction'
30387+
- $ref: '#/components/schemas/SendSlackMessageAction'
30388+
- $ref: '#/components/schemas/SendTeamsMessageAction'
3038930389
RoutingRuleAttributes:
3039030390
description: Defines the configurable attributes of a routing rule, such as
3039130391
actions, query, time restriction, and urgency.
@@ -30401,6 +30401,7 @@ components:
3040130401
type: string
3040230402
time_restriction:
3040330403
$ref: '#/components/schemas/TimeRestrictions'
30404+
nullable: true
3040430405
urgency:
3040530406
$ref: '#/components/schemas/Urgency'
3040630407
type: object
@@ -30416,8 +30417,7 @@ components:
3041630417
properties:
3041730418
data:
3041830419
$ref: '#/components/schemas/RoutingRuleRelationshipsPolicyData'
30419-
required:
30420-
- data
30420+
nullable: true
3042130421
type: object
3042230422
RoutingRuleRelationshipsPolicyData:
3042330423
description: Represents the policy data reference, containing the policy's ID
@@ -34489,6 +34489,65 @@ components:
3448934489
required:
3449034490
- selfServiceTrigger
3449134491
type: object
34492+
SendSlackMessageAction:
34493+
description: Sends a message to a Slack channel.
34494+
properties:
34495+
channel:
34496+
description: The channel ID.
34497+
example: CHANNEL
34498+
type: string
34499+
type:
34500+
$ref: '#/components/schemas/SendSlackMessageActionType'
34501+
workspace:
34502+
description: The workspace ID.
34503+
example: WORKSPACE
34504+
type: string
34505+
required:
34506+
- type
34507+
- channel
34508+
- workspace
34509+
type: object
34510+
SendSlackMessageActionType:
34511+
default: send_slack_message
34512+
description: Indicates that the action is a send Slack message action.
34513+
enum:
34514+
- send_slack_message
34515+
example: send_slack_message
34516+
type: string
34517+
x-enum-varnames:
34518+
- SEND_SLACK_MESSAGE
34519+
SendTeamsMessageAction:
34520+
description: Sends a message to a Microsoft Teams channel.
34521+
properties:
34522+
channel:
34523+
description: The channel ID.
34524+
example: CHANNEL
34525+
type: string
34526+
team:
34527+
description: The team ID.
34528+
example: TEAM
34529+
type: string
34530+
tenant:
34531+
description: The tenant ID.
34532+
example: TENANT
34533+
type: string
34534+
type:
34535+
$ref: '#/components/schemas/SendTeamsMessageActionType'
34536+
required:
34537+
- type
34538+
- channel
34539+
- tenant
34540+
- team
34541+
type: object
34542+
SendTeamsMessageActionType:
34543+
default: send_teams_message
34544+
description: Indicates that the action is a send Microsoft Teams message action.
34545+
enum:
34546+
- send_teams_message
34547+
example: send_teams_message
34548+
type: string
34549+
x-enum-varnames:
34550+
- SEND_TEAMS_MESSAGE
3449234551
SensitiveDataScannerConfigRequest:
3449334552
description: Group reorder request.
3449434553
properties:
@@ -36396,26 +36455,6 @@ components:
3639636455
type: string
3639736456
x-enum-varnames:
3639836457
- AGGREGATED_CONNECTION
36399-
SlackAction:
36400-
description: Sends a message to a Slack channel.
36401-
properties:
36402-
channel:
36403-
description: The channel ID.
36404-
example: CHANNEL
36405-
type: string
36406-
type:
36407-
description: Must be set to "send_slack_message".
36408-
example: send_slack_message
36409-
type: string
36410-
workspace:
36411-
description: The workspace ID.
36412-
example: WORKSPACE
36413-
type: string
36414-
required:
36415-
- type
36416-
- channel
36417-
- workspace
36418-
type: object
3641936458
SlackIntegrationMetadata:
3642036459
description: Incident integration metadata for the Slack integration.
3642136460
properties:
@@ -38330,31 +38369,6 @@ components:
3833038369
required:
3833138370
- data
3833238371
type: object
38333-
TeamsAction:
38334-
description: Sends a message to a Microsoft Teams channel.
38335-
properties:
38336-
channel:
38337-
description: The channel ID.
38338-
example: CHANNEL
38339-
type: string
38340-
team:
38341-
description: The team ID.
38342-
example: TEAM
38343-
type: string
38344-
tenant:
38345-
description: The tenant ID.
38346-
example: TENANT
38347-
type: string
38348-
type:
38349-
description: Must be set to "send_teams_message".
38350-
example: send_teams_message
38351-
type: string
38352-
required:
38353-
- type
38354-
- channel
38355-
- tenant
38356-
- team
38357-
type: object
3835838372
TeamsField:
3835938373
description: Supported teams field.
3836038374
enum:

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14851,6 +14851,34 @@ datadog\_api\_client.v2.model.self\_service\_trigger\_wrapper module
1485114851
:members:
1485214852
:show-inheritance:
1485314853

14854+
datadog\_api\_client.v2.model.send\_slack\_message\_action module
14855+
-----------------------------------------------------------------
14856+
14857+
.. automodule:: datadog_api_client.v2.model.send_slack_message_action
14858+
:members:
14859+
:show-inheritance:
14860+
14861+
datadog\_api\_client.v2.model.send\_slack\_message\_action\_type module
14862+
-----------------------------------------------------------------------
14863+
14864+
.. automodule:: datadog_api_client.v2.model.send_slack_message_action_type
14865+
:members:
14866+
:show-inheritance:
14867+
14868+
datadog\_api\_client.v2.model.send\_teams\_message\_action module
14869+
-----------------------------------------------------------------
14870+
14871+
.. automodule:: datadog_api_client.v2.model.send_teams_message_action
14872+
:members:
14873+
:show-inheritance:
14874+
14875+
datadog\_api\_client.v2.model.send\_teams\_message\_action\_type module
14876+
-----------------------------------------------------------------------
14877+
14878+
.. automodule:: datadog_api_client.v2.model.send_teams_message_action_type
14879+
:members:
14880+
:show-inheritance:
14881+
1485414882
datadog\_api\_client.v2.model.sensitive\_data\_scanner\_config\_request module
1485514883
------------------------------------------------------------------------------
1485614884

@@ -15747,13 +15775,6 @@ datadog\_api\_client.v2.model.single\_aggregated\_connection\_response\_data\_ty
1574715775
:members:
1574815776
:show-inheritance:
1574915777

15750-
datadog\_api\_client.v2.model.slack\_action module
15751-
--------------------------------------------------
15752-
15753-
.. automodule:: datadog_api_client.v2.model.slack_action
15754-
:members:
15755-
:show-inheritance:
15756-
1575715778
datadog\_api\_client.v2.model.slack\_integration\_metadata module
1575815779
-----------------------------------------------------------------
1575915780

@@ -16699,13 +16720,6 @@ datadog\_api\_client.v2.model.team\_update\_request module
1669916720
:members:
1670016721
:show-inheritance:
1670116722

16702-
datadog\_api\_client.v2.model.teams\_action module
16703-
--------------------------------------------------
16704-
16705-
.. automodule:: datadog_api_client.v2.model.teams_action
16706-
:members:
16707-
:show-inheritance:
16708-
1670916723
datadog\_api\_client.v2.model.teams\_field module
1671016724
-------------------------------------------------
1671116725

examples/v2/on-call/SetOnCallTeamRoutingRules.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +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.slack_action import SlackAction
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
910
from datadog_api_client.v2.model.team_routing_rules_request import TeamRoutingRulesRequest
1011
from datadog_api_client.v2.model.team_routing_rules_request_data import TeamRoutingRulesRequestData
1112
from datadog_api_client.v2.model.team_routing_rules_request_data_attributes import TeamRoutingRulesRequestDataAttributes
@@ -28,9 +29,9 @@
2829
rules=[
2930
TeamRoutingRulesRequestRule(
3031
actions=[
31-
SlackAction(
32+
SendSlackMessageAction(
3233
channel="channel",
33-
type="send_slack_message",
34+
type=SendSlackMessageActionType.SEND_SLACK_MESSAGE,
3435
workspace="workspace",
3536
),
3637
],
@@ -52,7 +53,6 @@
5253
),
5354
],
5455
),
55-
urgency=Urgency.HIGH,
5656
),
5757
TeamRoutingRulesRequestRule(
5858
policy_id=ESCALATION_POLICY_DATA_ID,
@@ -69,6 +69,6 @@
6969
configuration = Configuration()
7070
with ApiClient(configuration) as api_client:
7171
api_instance = OnCallApi(api_client)
72-
response = api_instance.set_on_call_team_routing_rules(team_id=DD_TEAM_DATA_ID, body=body)
72+
response = api_instance.set_on_call_team_routing_rules(team_id=DD_TEAM_DATA_ID, include="rules", body=body)
7373

7474
print(response)

src/datadog_api_client/v2/model/routing_rule_action.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def __init__(self, **kwargs):
1818
:param channel: The channel ID.
1919
:type channel: str
2020
21-
:param type: Must be set to "send_slack_message".
22-
:type type: str
21+
:param type: Indicates that the action is a send Slack message action.
22+
:type type: SendSlackMessageActionType
2323
2424
:param workspace: The workspace ID.
2525
:type workspace: str
@@ -41,12 +41,12 @@ def _composed_schemas(_):
4141
# code would be run when this module is imported, and these composed
4242
# classes don't exist yet because their module has not finished
4343
# loading
44-
from datadog_api_client.v2.model.slack_action import SlackAction
45-
from datadog_api_client.v2.model.teams_action import TeamsAction
44+
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
45+
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
4646

4747
return {
4848
"oneOf": [
49-
SlackAction,
50-
TeamsAction,
49+
SendSlackMessageAction,
50+
SendTeamsMessageAction,
5151
],
5252
}

src/datadog_api_client/v2/model/routing_rule_attributes.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
from datadog_api_client.v2.model.routing_rule_action import RoutingRuleAction
1818
from datadog_api_client.v2.model.time_restrictions import TimeRestrictions
1919
from datadog_api_client.v2.model.urgency import Urgency
20-
from datadog_api_client.v2.model.slack_action import SlackAction
21-
from datadog_api_client.v2.model.teams_action import TeamsAction
20+
from datadog_api_client.v2.model.send_slack_message_action import SendSlackMessageAction
21+
from datadog_api_client.v2.model.send_teams_message_action import SendTeamsMessageAction
2222

2323

2424
class RoutingRuleAttributes(ModelNormal):
@@ -44,7 +44,9 @@ def openapi_types(_):
4444

4545
def __init__(
4646
self_,
47-
actions: Union[List[Union[RoutingRuleAction, SlackAction, TeamsAction]], UnsetType] = unset,
47+
actions: Union[
48+
List[Union[RoutingRuleAction, SendSlackMessageAction, SendTeamsMessageAction]], UnsetType
49+
] = unset,
4850
query: Union[str, UnsetType] = unset,
4951
time_restriction: Union[TimeRestrictions, UnsetType] = unset,
5052
urgency: Union[Urgency, UnsetType] = unset,

src/datadog_api_client/v2/model/routing_rule_relationships_policy.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import TYPE_CHECKING
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
unset,
12+
UnsetType,
1113
)
1214

1315

@@ -30,13 +32,13 @@ def openapi_types(_):
3032
"data": "data",
3133
}
3234

33-
def __init__(self_, data: RoutingRuleRelationshipsPolicyData, **kwargs):
35+
def __init__(self_, data: Union[RoutingRuleRelationshipsPolicyData, UnsetType] = unset, **kwargs):
3436
"""
3537
Defines the relationship that links a routing rule to a policy.
3638
3739
:param data: Represents the policy data reference, containing the policy's ID and resource type.
38-
:type data: RoutingRuleRelationshipsPolicyData
40+
:type data: RoutingRuleRelationshipsPolicyData, optional
3941
"""
42+
if data is not unset:
43+
kwargs["data"] = data
4044
super().__init__(kwargs)
41-
42-
self_.data = data

0 commit comments

Comments
 (0)