Skip to content

Commit 7a35e86

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

File tree

12 files changed

+349
-200
lines changed

12 files changed

+349
-200
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:49.383412",
8-
"spec_repo_commit": "c75940cb"
7+
"regenerated": "2025-05-27 15:21:07.185558",
8+
"spec_repo_commit": "97968943"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-27 10:37:49.403493",
13-
"spec_repo_commit": "c75940cb"
12+
"regenerated": "2025-05-27 15:21:07.201322",
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:

examples/v2/on-call/SetOnCallTeamRoutingRules.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import com.datadog.api.client.ApiClient;
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.api.OnCallApi.SetOnCallTeamRoutingRulesOptionalParameters;
67
import com.datadog.api.client.v2.model.RoutingRuleAction;
7-
import com.datadog.api.client.v2.model.SlackAction;
8+
import com.datadog.api.client.v2.model.SendSlackMessageAction;
9+
import com.datadog.api.client.v2.model.SendSlackMessageActionType;
810
import com.datadog.api.client.v2.model.TeamRoutingRules;
911
import com.datadog.api.client.v2.model.TeamRoutingRulesRequest;
1012
import com.datadog.api.client.v2.model.TeamRoutingRulesRequestData;
@@ -41,9 +43,11 @@ public static void main(String[] args) {
4143
.actions(
4244
Collections.singletonList(
4345
new RoutingRuleAction(
44-
new SlackAction()
46+
new SendSlackMessageAction()
4547
.channel("channel")
46-
.type("send_slack_message")
48+
.type(
49+
SendSlackMessageActionType
50+
.SEND_SLACK_MESSAGE)
4751
.workspace("workspace"))))
4852
.query("tags.service:test")
4953
.timeRestriction(
@@ -60,8 +64,7 @@ public static void main(String[] args) {
6064
.endDay(Weekday.TUESDAY)
6165
.endTime("17:00:00")
6266
.startDay(Weekday.TUESDAY)
63-
.startTime("09:00:00"))))
64-
.urgency(Urgency.HIGH),
67+
.startTime("09:00:00")))),
6568
new TeamRoutingRulesRequestRule()
6669
.policyId(ESCALATION_POLICY_DATA_ID)
6770
.query("")
@@ -70,7 +73,11 @@ public static void main(String[] args) {
7073
.type(TeamRoutingRulesRequestDataType.TEAM_ROUTING_RULES));
7174

7275
try {
73-
TeamRoutingRules result = apiInstance.setOnCallTeamRoutingRules(DD_TEAM_DATA_ID, body);
76+
TeamRoutingRules result =
77+
apiInstance.setOnCallTeamRoutingRules(
78+
DD_TEAM_DATA_ID,
79+
body,
80+
new SetOnCallTeamRoutingRulesOptionalParameters().include("rules"));
7481
System.out.println(result);
7582
} catch (ApiException e) {
7683
System.err.println("Exception when calling OnCallApi#setOnCallTeamRoutingRules");

0 commit comments

Comments
 (0)