Skip to content

Commit 4b1b341

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add 'mute_buttons' argument to slack channel definition (#2782)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 81db608 commit 4b1b341

File tree

6 files changed

+61
-26
lines changed

6 files changed

+61
-26
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-04-02 20:49:30.088491",
8-
"spec_repo_commit": "9ea284b5"
7+
"regenerated": "2025-04-03 09:26:31.847840",
8+
"spec_repo_commit": "f1a43647"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-02 20:49:30.104275",
13-
"spec_repo_commit": "9ea284b5"
12+
"regenerated": "2025-04-03 09:26:31.864167",
13+
"spec_repo_commit": "f1a43647"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13489,6 +13489,10 @@ components:
1348913489
default: true
1349013490
description: Show the main body of the alert event.
1349113491
type: boolean
13492+
mute_buttons:
13493+
default: false
13494+
description: Show interactive buttons to mute the alerting monitor.
13495+
type: boolean
1349213496
notified:
1349313497
default: true
1349413498
description: Show the list of @-handles in the alert event.
@@ -13507,12 +13511,14 @@ components:
1350713511
example:
1350813512
- display:
1350913513
message: true
13514+
mute_buttons: true
1351013515
notified: true
1351113516
snapshot: true
1351213517
tags: true
1351313518
name: '#channel_name_main_account'
1351413519
- display:
1351513520
message: true
13521+
mute_buttons: true
1351613522
notified: true
1351713523
snapshot: false
1351813524
tags: true

examples/v1/slack-integration/CreateSlackIntegrationChannel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static void main(String[] args) {
1616
.display(
1717
new SlackIntegrationChannelDisplay()
1818
.message(true)
19+
.muteButtons(false)
1920
.notified(true)
2021
.snapshot(true)
2122
.tags(true))

examples/v1/slack-integration/UpdateSlackIntegrationChannel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static void main(String[] args) {
1616
.display(
1717
new SlackIntegrationChannelDisplay()
1818
.message(true)
19+
.muteButtons(false)
1920
.notified(true)
2021
.snapshot(true)
2122
.tags(true))

src/main/java/com/datadog/api/client/v1/model/SlackIntegrationChannelDisplay.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/** Configuration options for what is shown in an alert event message. */
2020
@JsonPropertyOrder({
2121
SlackIntegrationChannelDisplay.JSON_PROPERTY_MESSAGE,
22+
SlackIntegrationChannelDisplay.JSON_PROPERTY_MUTE_BUTTONS,
2223
SlackIntegrationChannelDisplay.JSON_PROPERTY_NOTIFIED,
2324
SlackIntegrationChannelDisplay.JSON_PROPERTY_SNAPSHOT,
2425
SlackIntegrationChannelDisplay.JSON_PROPERTY_TAGS
@@ -30,6 +31,9 @@ public class SlackIntegrationChannelDisplay {
3031
public static final String JSON_PROPERTY_MESSAGE = "message";
3132
private Boolean message = true;
3233

34+
public static final String JSON_PROPERTY_MUTE_BUTTONS = "mute_buttons";
35+
private Boolean muteButtons = false;
36+
3337
public static final String JSON_PROPERTY_NOTIFIED = "notified";
3438
private Boolean notified = true;
3539

@@ -60,6 +64,27 @@ public void setMessage(Boolean message) {
6064
this.message = message;
6165
}
6266

67+
public SlackIntegrationChannelDisplay muteButtons(Boolean muteButtons) {
68+
this.muteButtons = muteButtons;
69+
return this;
70+
}
71+
72+
/**
73+
* Show interactive buttons to mute the alerting monitor.
74+
*
75+
* @return muteButtons
76+
*/
77+
@jakarta.annotation.Nullable
78+
@JsonProperty(JSON_PROPERTY_MUTE_BUTTONS)
79+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
80+
public Boolean getMuteButtons() {
81+
return muteButtons;
82+
}
83+
84+
public void setMuteButtons(Boolean muteButtons) {
85+
this.muteButtons = muteButtons;
86+
}
87+
6388
public SlackIntegrationChannelDisplay notified(Boolean notified) {
6489
this.notified = notified;
6590
return this;
@@ -181,6 +206,7 @@ public boolean equals(Object o) {
181206
SlackIntegrationChannelDisplay slackIntegrationChannelDisplay =
182207
(SlackIntegrationChannelDisplay) o;
183208
return Objects.equals(this.message, slackIntegrationChannelDisplay.message)
209+
&& Objects.equals(this.muteButtons, slackIntegrationChannelDisplay.muteButtons)
184210
&& Objects.equals(this.notified, slackIntegrationChannelDisplay.notified)
185211
&& Objects.equals(this.snapshot, slackIntegrationChannelDisplay.snapshot)
186212
&& Objects.equals(this.tags, slackIntegrationChannelDisplay.tags)
@@ -190,14 +216,15 @@ public boolean equals(Object o) {
190216

191217
@Override
192218
public int hashCode() {
193-
return Objects.hash(message, notified, snapshot, tags, additionalProperties);
219+
return Objects.hash(message, muteButtons, notified, snapshot, tags, additionalProperties);
194220
}
195221

196222
@Override
197223
public String toString() {
198224
StringBuilder sb = new StringBuilder();
199225
sb.append("class SlackIntegrationChannelDisplay {\n");
200226
sb.append(" message: ").append(toIndentedString(message)).append("\n");
227+
sb.append(" muteButtons: ").append(toIndentedString(muteButtons)).append("\n");
201228
sb.append(" notified: ").append(toIndentedString(notified)).append("\n");
202229
sb.append(" snapshot: ").append(toIndentedString(snapshot)).append("\n");
203230
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");

src/test/resources/com/datadog/api/client/v1/api/slack_integration.feature

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,122 +9,122 @@ Feature: Slack Integration
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "SlackIntegration" API
1111

12-
@generated @skip @team:DataDog/saas-integrations
12+
@generated @skip @team:DataDog/chat-integrations
1313
Scenario: Create a Slack integration channel returns "Bad Request" response
1414
Given new "CreateSlackIntegrationChannel" request
1515
And request contains "account_name" parameter from "REPLACE.ME"
16-
And body with value {"display": {"message": true, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
16+
And body with value {"display": {"message": true, "mute_buttons": false, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

20-
@generated @skip @team:DataDog/saas-integrations
20+
@generated @skip @team:DataDog/chat-integrations
2121
Scenario: Create a Slack integration channel returns "Item Not Found" response
2222
Given new "CreateSlackIntegrationChannel" request
2323
And request contains "account_name" parameter from "REPLACE.ME"
24-
And body with value {"display": {"message": true, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
24+
And body with value {"display": {"message": true, "mute_buttons": false, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
2525
When the request is sent
2626
Then the response status is 404 Item Not Found
2727

28-
@generated @skip @team:DataDog/saas-integrations
28+
@generated @skip @team:DataDog/chat-integrations
2929
Scenario: Create a Slack integration channel returns "OK" response
3030
Given new "CreateSlackIntegrationChannel" request
3131
And request contains "account_name" parameter from "REPLACE.ME"
32-
And body with value {"display": {"message": true, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
32+
And body with value {"display": {"message": true, "mute_buttons": false, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
3333
When the request is sent
3434
Then the response status is 200 OK
3535

36-
@generated @skip @team:DataDog/saas-integrations
36+
@generated @skip @team:DataDog/chat-integrations
3737
Scenario: Get a Slack integration channel returns "Bad Request" response
3838
Given new "GetSlackIntegrationChannel" request
3939
And request contains "account_name" parameter from "REPLACE.ME"
4040
And request contains "channel_name" parameter from "REPLACE.ME"
4141
When the request is sent
4242
Then the response status is 400 Bad Request
4343

44-
@generated @skip @team:DataDog/saas-integrations
44+
@generated @skip @team:DataDog/chat-integrations
4545
Scenario: Get a Slack integration channel returns "Item Not Found" response
4646
Given new "GetSlackIntegrationChannel" request
4747
And request contains "account_name" parameter from "REPLACE.ME"
4848
And request contains "channel_name" parameter from "REPLACE.ME"
4949
When the request is sent
5050
Then the response status is 404 Item Not Found
5151

52-
@generated @skip @team:DataDog/saas-integrations
52+
@generated @skip @team:DataDog/chat-integrations
5353
Scenario: Get a Slack integration channel returns "OK" response
5454
Given new "GetSlackIntegrationChannel" request
5555
And request contains "account_name" parameter from "REPLACE.ME"
5656
And request contains "channel_name" parameter from "REPLACE.ME"
5757
When the request is sent
5858
Then the response status is 200 OK
5959

60-
@generated @skip @team:DataDog/saas-integrations
60+
@generated @skip @team:DataDog/chat-integrations
6161
Scenario: Get all channels in a Slack integration returns "Bad Request" response
6262
Given new "GetSlackIntegrationChannels" request
6363
And request contains "account_name" parameter from "REPLACE.ME"
6464
When the request is sent
6565
Then the response status is 400 Bad Request
6666

67-
@generated @skip @team:DataDog/saas-integrations
67+
@generated @skip @team:DataDog/chat-integrations
6868
Scenario: Get all channels in a Slack integration returns "Item Not Found" response
6969
Given new "GetSlackIntegrationChannels" request
7070
And request contains "account_name" parameter from "REPLACE.ME"
7171
When the request is sent
7272
Then the response status is 404 Item Not Found
7373

74-
@generated @skip @team:DataDog/saas-integrations
74+
@generated @skip @team:DataDog/chat-integrations
7575
Scenario: Get all channels in a Slack integration returns "OK" response
7676
Given new "GetSlackIntegrationChannels" request
7777
And request contains "account_name" parameter from "REPLACE.ME"
7878
When the request is sent
7979
Then the response status is 200 OK
8080

81-
@generated @skip @team:DataDog/saas-integrations
81+
@generated @skip @team:DataDog/chat-integrations
8282
Scenario: Remove a Slack integration channel returns "Bad Request" response
8383
Given new "RemoveSlackIntegrationChannel" request
8484
And request contains "account_name" parameter from "REPLACE.ME"
8585
And request contains "channel_name" parameter from "REPLACE.ME"
8686
When the request is sent
8787
Then the response status is 400 Bad Request
8888

89-
@generated @skip @team:DataDog/saas-integrations
89+
@generated @skip @team:DataDog/chat-integrations
9090
Scenario: Remove a Slack integration channel returns "Item Not Found" response
9191
Given new "RemoveSlackIntegrationChannel" request
9292
And request contains "account_name" parameter from "REPLACE.ME"
9393
And request contains "channel_name" parameter from "REPLACE.ME"
9494
When the request is sent
9595
Then the response status is 404 Item Not Found
9696

97-
@generated @skip @team:DataDog/saas-integrations
97+
@generated @skip @team:DataDog/chat-integrations
9898
Scenario: Remove a Slack integration channel returns "The channel was removed successfully." response
9999
Given new "RemoveSlackIntegrationChannel" request
100100
And request contains "account_name" parameter from "REPLACE.ME"
101101
And request contains "channel_name" parameter from "REPLACE.ME"
102102
When the request is sent
103103
Then the response status is 204 The channel was removed successfully.
104104

105-
@generated @skip @team:DataDog/saas-integrations
105+
@generated @skip @team:DataDog/chat-integrations
106106
Scenario: Update a Slack integration channel returns "Bad Request" response
107107
Given new "UpdateSlackIntegrationChannel" request
108108
And request contains "account_name" parameter from "REPLACE.ME"
109109
And request contains "channel_name" parameter from "REPLACE.ME"
110-
And body with value {"display": {"message": true, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
110+
And body with value {"display": {"message": true, "mute_buttons": false, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
111111
When the request is sent
112112
Then the response status is 400 Bad Request
113113

114-
@generated @skip @team:DataDog/saas-integrations
114+
@generated @skip @team:DataDog/chat-integrations
115115
Scenario: Update a Slack integration channel returns "Item Not Found" response
116116
Given new "UpdateSlackIntegrationChannel" request
117117
And request contains "account_name" parameter from "REPLACE.ME"
118118
And request contains "channel_name" parameter from "REPLACE.ME"
119-
And body with value {"display": {"message": true, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
119+
And body with value {"display": {"message": true, "mute_buttons": false, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
120120
When the request is sent
121121
Then the response status is 404 Item Not Found
122122

123-
@generated @skip @team:DataDog/saas-integrations
123+
@generated @skip @team:DataDog/chat-integrations
124124
Scenario: Update a Slack integration channel returns "OK" response
125125
Given new "UpdateSlackIntegrationChannel" request
126126
And request contains "account_name" parameter from "REPLACE.ME"
127127
And request contains "channel_name" parameter from "REPLACE.ME"
128-
And body with value {"display": {"message": true, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
128+
And body with value {"display": {"message": true, "mute_buttons": false, "notified": true, "snapshot": true, "tags": true}, "name": "#general"}
129129
When the request is sent
130130
Then the response status is 200 OK

0 commit comments

Comments
 (0)