Skip to content

Commit da774bd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0c5a5b9 of spec repo
1 parent 5a389cf commit da774bd

File tree

3 files changed

+290
-0
lines changed

3 files changed

+290
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26714,6 +26714,31 @@ components:
2671426714
description: The ID of the monitor notification rule.
2671526715
example: 00000000-0000-1234-0000-000000000000
2671626716
type: string
26717+
MonitorNotificationRuleListFilters:
26718+
additionalProperties: false
26719+
description: Filter all rules by the given filter criteria. Defaults to no filtering.
26720+
properties:
26721+
recipients:
26722+
description: List of recipients to filter Notification Rules by.
26723+
example:
26724+
- slack-monitor-app
26725+
- email@example.com
26726+
items:
26727+
type: string
26728+
type: array
26729+
tags:
26730+
description: List of tags to filter Notification Rules by.
26731+
example:
26732+
- env:prod
26733+
- service:api
26734+
- team:my-team
26735+
items:
26736+
type: string
26737+
type: array
26738+
text:
26739+
description: Text to filter Notification Rules by.
26740+
type: string
26741+
type: object
2671726742
MonitorNotificationRuleListResponse:
2671826743
description: Response for retrieving all monitor notification rules.
2671926744
properties:
@@ -58153,6 +58178,43 @@ paths:
5815358178
description: Returns a list of all monitor notification rules.
5815458179
operationId: GetMonitorNotificationRules
5815558180
parameters:
58181+
- description: The page to start paginating from. If `page` is not specified,
58182+
the argument defaults to the first page.
58183+
in: query
58184+
name: page
58185+
required: false
58186+
schema:
58187+
format: int32
58188+
maximum: 1000000
58189+
minimum: 0
58190+
type: integer
58191+
- description: The number of rules to return per page. If `per_page` is not
58192+
specified, the argument defaults to 100.
58193+
in: query
58194+
name: per_page
58195+
required: false
58196+
schema:
58197+
format: int32
58198+
maximum: 1000
58199+
minimum: 1
58200+
type: integer
58201+
- description: 'String for sort order, composed of field and sort order separated
58202+
by a colon, for example `name:asc`. Supported sort directions: `asc`, `desc`.
58203+
Supported fields: `name`, `created_at`.'
58204+
in: query
58205+
name: sort
58206+
required: false
58207+
schema:
58208+
type: string
58209+
- description: 'Filter all rules by the given filter criteria. Defaults to no
58210+
filtering.
58211+
58212+
Supported fields: `text`, `tags`, `recipients`.'
58213+
in: query
58214+
name: filters
58215+
required: false
58216+
schema:
58217+
$ref: '#/components/schemas/MonitorNotificationRuleListFilters'
5815658218
- description: 'Comma-separated list of resource paths for related resources
5815758219
to include in the response. Supported resource
5815858220

src/main/java/com/datadog/api/client/v2/api/MonitorsApi.java

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.datadog.api.client.v2.model.MonitorConfigPolicyListResponse;
1010
import com.datadog.api.client.v2.model.MonitorConfigPolicyResponse;
1111
import com.datadog.api.client.v2.model.MonitorNotificationRuleCreateRequest;
12+
import com.datadog.api.client.v2.model.MonitorNotificationRuleListFilters;
1213
import com.datadog.api.client.v2.model.MonitorNotificationRuleListResponse;
1314
import com.datadog.api.client.v2.model.MonitorNotificationRuleResponse;
1415
import com.datadog.api.client.v2.model.MonitorNotificationRuleUpdateRequest;
@@ -1252,8 +1253,63 @@ public ApiResponse<MonitorNotificationRuleResponse> getMonitorNotificationRuleWi
12521253

12531254
/** Manage optional parameters to getMonitorNotificationRules. */
12541255
public static class GetMonitorNotificationRulesOptionalParameters {
1256+
private Integer page;
1257+
private Integer perPage;
1258+
private String sort;
1259+
private MonitorNotificationRuleListFilters filters;
12551260
private String include;
12561261

1262+
/**
1263+
* Set page.
1264+
*
1265+
* @param page The page to start paginating from. If <code>page</code> is not specified, the
1266+
* argument defaults to the first page. (optional)
1267+
* @return GetMonitorNotificationRulesOptionalParameters
1268+
*/
1269+
public GetMonitorNotificationRulesOptionalParameters page(Integer page) {
1270+
this.page = page;
1271+
return this;
1272+
}
1273+
1274+
/**
1275+
* Set perPage.
1276+
*
1277+
* @param perPage The number of rules to return per page. If <code>per_page</code> is not
1278+
* specified, the argument defaults to 100. (optional)
1279+
* @return GetMonitorNotificationRulesOptionalParameters
1280+
*/
1281+
public GetMonitorNotificationRulesOptionalParameters perPage(Integer perPage) {
1282+
this.perPage = perPage;
1283+
return this;
1284+
}
1285+
1286+
/**
1287+
* Set sort.
1288+
*
1289+
* @param sort String for sort order, composed of field and sort order separated by a colon, for
1290+
* example <code>name:asc</code>. Supported sort directions: <code>asc</code>, <code>desc
1291+
* </code>. Supported fields: <code>name</code>, <code>created_at</code>. (optional)
1292+
* @return GetMonitorNotificationRulesOptionalParameters
1293+
*/
1294+
public GetMonitorNotificationRulesOptionalParameters sort(String sort) {
1295+
this.sort = sort;
1296+
return this;
1297+
}
1298+
1299+
/**
1300+
* Set filters.
1301+
*
1302+
* @param filters Filter all rules by the given filter criteria. Defaults to no filtering.
1303+
* Supported fields: <code>text</code>, <code>tags</code>, <code>recipients</code>.
1304+
* (optional)
1305+
* @return GetMonitorNotificationRulesOptionalParameters
1306+
*/
1307+
public GetMonitorNotificationRulesOptionalParameters filters(
1308+
MonitorNotificationRuleListFilters filters) {
1309+
this.filters = filters;
1310+
return this;
1311+
}
1312+
12571313
/**
12581314
* Set include.
12591315
*
@@ -1346,13 +1402,21 @@ public CompletableFuture<MonitorNotificationRuleListResponse> getMonitorNotifica
13461402
public ApiResponse<MonitorNotificationRuleListResponse> getMonitorNotificationRulesWithHttpInfo(
13471403
GetMonitorNotificationRulesOptionalParameters parameters) throws ApiException {
13481404
Object localVarPostBody = null;
1405+
Integer page = parameters.page;
1406+
Integer perPage = parameters.perPage;
1407+
String sort = parameters.sort;
1408+
MonitorNotificationRuleListFilters filters = parameters.filters;
13491409
String include = parameters.include;
13501410
// create path and map variables
13511411
String localVarPath = "/api/v2/monitor/notification_rule";
13521412

13531413
List<Pair> localVarQueryParams = new ArrayList<Pair>();
13541414
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
13551415

1416+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
1417+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "per_page", perPage));
1418+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
1419+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filters", filters));
13561420
localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
13571421

13581422
Invocation.Builder builder =
@@ -1387,13 +1451,21 @@ public ApiResponse<MonitorNotificationRuleListResponse> getMonitorNotificationRu
13871451
getMonitorNotificationRulesWithHttpInfoAsync(
13881452
GetMonitorNotificationRulesOptionalParameters parameters) {
13891453
Object localVarPostBody = null;
1454+
Integer page = parameters.page;
1455+
Integer perPage = parameters.perPage;
1456+
String sort = parameters.sort;
1457+
MonitorNotificationRuleListFilters filters = parameters.filters;
13901458
String include = parameters.include;
13911459
// create path and map variables
13921460
String localVarPath = "/api/v2/monitor/notification_rule";
13931461

13941462
List<Pair> localVarQueryParams = new ArrayList<Pair>();
13951463
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
13961464

1465+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
1466+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "per_page", perPage));
1467+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
1468+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filters", filters));
13971469
localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
13981470

13991471
Invocation.Builder builder;
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
10+
import com.fasterxml.jackson.annotation.JsonInclude;
11+
import com.fasterxml.jackson.annotation.JsonProperty;
12+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
13+
import java.util.ArrayList;
14+
import java.util.List;
15+
import java.util.Objects;
16+
17+
/** Filter all rules by the given filter criteria. Defaults to no filtering. */
18+
@JsonPropertyOrder({
19+
MonitorNotificationRuleListFilters.JSON_PROPERTY_RECIPIENTS,
20+
MonitorNotificationRuleListFilters.JSON_PROPERTY_TAGS,
21+
MonitorNotificationRuleListFilters.JSON_PROPERTY_TEXT
22+
})
23+
@jakarta.annotation.Generated(
24+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
25+
public class MonitorNotificationRuleListFilters {
26+
@JsonIgnore public boolean unparsed = false;
27+
public static final String JSON_PROPERTY_RECIPIENTS = "recipients";
28+
private List<String> recipients = null;
29+
30+
public static final String JSON_PROPERTY_TAGS = "tags";
31+
private List<String> tags = null;
32+
33+
public static final String JSON_PROPERTY_TEXT = "text";
34+
private String text;
35+
36+
public MonitorNotificationRuleListFilters recipients(List<String> recipients) {
37+
this.recipients = recipients;
38+
return this;
39+
}
40+
41+
public MonitorNotificationRuleListFilters addRecipientsItem(String recipientsItem) {
42+
if (this.recipients == null) {
43+
this.recipients = new ArrayList<>();
44+
}
45+
this.recipients.add(recipientsItem);
46+
return this;
47+
}
48+
49+
/**
50+
* List of recipients to filter Notification Rules by.
51+
*
52+
* @return recipients
53+
*/
54+
@jakarta.annotation.Nullable
55+
@JsonProperty(JSON_PROPERTY_RECIPIENTS)
56+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
57+
public List<String> getRecipients() {
58+
return recipients;
59+
}
60+
61+
public void setRecipients(List<String> recipients) {
62+
this.recipients = recipients;
63+
}
64+
65+
public MonitorNotificationRuleListFilters tags(List<String> tags) {
66+
this.tags = tags;
67+
return this;
68+
}
69+
70+
public MonitorNotificationRuleListFilters addTagsItem(String tagsItem) {
71+
if (this.tags == null) {
72+
this.tags = new ArrayList<>();
73+
}
74+
this.tags.add(tagsItem);
75+
return this;
76+
}
77+
78+
/**
79+
* List of tags to filter Notification Rules by.
80+
*
81+
* @return tags
82+
*/
83+
@jakarta.annotation.Nullable
84+
@JsonProperty(JSON_PROPERTY_TAGS)
85+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
86+
public List<String> getTags() {
87+
return tags;
88+
}
89+
90+
public void setTags(List<String> tags) {
91+
this.tags = tags;
92+
}
93+
94+
public MonitorNotificationRuleListFilters text(String text) {
95+
this.text = text;
96+
return this;
97+
}
98+
99+
/**
100+
* Text to filter Notification Rules by.
101+
*
102+
* @return text
103+
*/
104+
@jakarta.annotation.Nullable
105+
@JsonProperty(JSON_PROPERTY_TEXT)
106+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
107+
public String getText() {
108+
return text;
109+
}
110+
111+
public void setText(String text) {
112+
this.text = text;
113+
}
114+
115+
/** Return true if this MonitorNotificationRuleListFilters object is equal to o. */
116+
@Override
117+
public boolean equals(Object o) {
118+
if (this == o) {
119+
return true;
120+
}
121+
if (o == null || getClass() != o.getClass()) {
122+
return false;
123+
}
124+
MonitorNotificationRuleListFilters monitorNotificationRuleListFilters =
125+
(MonitorNotificationRuleListFilters) o;
126+
return Objects.equals(this.recipients, monitorNotificationRuleListFilters.recipients)
127+
&& Objects.equals(this.tags, monitorNotificationRuleListFilters.tags)
128+
&& Objects.equals(this.text, monitorNotificationRuleListFilters.text);
129+
}
130+
131+
@Override
132+
public int hashCode() {
133+
return Objects.hash(recipients, tags, text);
134+
}
135+
136+
@Override
137+
public String toString() {
138+
StringBuilder sb = new StringBuilder();
139+
sb.append("class MonitorNotificationRuleListFilters {\n");
140+
sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n");
141+
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
142+
sb.append(" text: ").append(toIndentedString(text)).append("\n");
143+
sb.append('}');
144+
return sb.toString();
145+
}
146+
147+
/**
148+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
149+
*/
150+
private String toIndentedString(Object o) {
151+
if (o == null) {
152+
return "null";
153+
}
154+
return o.toString().replace("\n", "\n ");
155+
}
156+
}

0 commit comments

Comments
 (0)