Skip to content

Commit 0fb02c3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3324318 of spec repo
1 parent 496dbe6 commit 0fb02c3

File tree

41 files changed

+5648
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5648
-68
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 480 additions & 9 deletions
Large diffs are not rendered by default.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Create an On-Call notification rule for a user returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.model.CreateOnCallNotificationRuleRequest;
7+
import com.datadog.api.client.v2.model.CreateOnCallNotificationRuleRequestData;
8+
import com.datadog.api.client.v2.model.NotificationChannelType;
9+
import com.datadog.api.client.v2.model.OnCallNotificationRule;
10+
import com.datadog.api.client.v2.model.OnCallNotificationRuleCategory;
11+
import com.datadog.api.client.v2.model.OnCallNotificationRuleChannelRelationship;
12+
import com.datadog.api.client.v2.model.OnCallNotificationRuleChannelRelationshipData;
13+
import com.datadog.api.client.v2.model.OnCallNotificationRuleRelationships;
14+
import com.datadog.api.client.v2.model.OnCallNotificationRuleRequestAttributes;
15+
import com.datadog.api.client.v2.model.OnCallNotificationRuleType;
16+
17+
public class Example {
18+
public static void main(String[] args) {
19+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
20+
OnCallApi apiInstance = new OnCallApi(defaultClient);
21+
22+
// there is a valid "user" in the system
23+
String USER_DATA_ID = System.getenv("USER_DATA_ID");
24+
25+
// there is a valid "oncall_email_notification_channel" in the system
26+
String ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID =
27+
System.getenv("ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID");
28+
29+
CreateOnCallNotificationRuleRequest body =
30+
new CreateOnCallNotificationRuleRequest()
31+
.data(
32+
new CreateOnCallNotificationRuleRequestData()
33+
.attributes(
34+
new OnCallNotificationRuleRequestAttributes()
35+
.category(OnCallNotificationRuleCategory.HIGH_URGENCY)
36+
.delayMinutes(0L))
37+
.relationships(
38+
new OnCallNotificationRuleRelationships()
39+
.channel(
40+
new OnCallNotificationRuleChannelRelationship()
41+
.data(
42+
new OnCallNotificationRuleChannelRelationshipData()
43+
.id(ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID)
44+
.type(NotificationChannelType.NOTIFICATION_CHANNELS))))
45+
.type(OnCallNotificationRuleType.NOTIFICATION_RULES));
46+
47+
try {
48+
OnCallNotificationRule result = apiInstance.createUserNotificationRule(USER_DATA_ID, body);
49+
System.out.println(result);
50+
} catch (ApiException e) {
51+
System.err.println("Exception when calling OnCallApi#createUserNotificationRule");
52+
System.err.println("Status code: " + e.getCode());
53+
System.err.println("Reason: " + e.getResponseBody());
54+
System.err.println("Response headers: " + e.getResponseHeaders());
55+
e.printStackTrace();
56+
}
57+
}
58+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Delete an On-Call notification rule for a user returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
OnCallApi apiInstance = new OnCallApi(defaultClient);
11+
12+
// there is a valid "user" in the system
13+
String USER_DATA_ID = System.getenv("USER_DATA_ID");
14+
15+
// there is a valid "oncall_email_notification_rule" in the system
16+
String ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID =
17+
System.getenv("ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID");
18+
19+
try {
20+
apiInstance.deleteUserNotificationRule(USER_DATA_ID, ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID);
21+
} catch (ApiException e) {
22+
System.err.println("Exception when calling OnCallApi#deleteUserNotificationRule");
23+
System.err.println("Status code: " + e.getCode());
24+
System.err.println("Reason: " + e.getResponseBody());
25+
System.err.println("Response headers: " + e.getResponseHeaders());
26+
e.printStackTrace();
27+
}
28+
}
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Get an On-Call notification rule for a user returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.api.OnCallApi.GetUserNotificationRuleOptionalParameters;
7+
import com.datadog.api.client.v2.model.OnCallNotificationRule;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
OnCallApi apiInstance = new OnCallApi(defaultClient);
13+
14+
// there is a valid "user" in the system
15+
String USER_DATA_ID = System.getenv("USER_DATA_ID");
16+
17+
// there is a valid "oncall_email_notification_rule" in the system
18+
String ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID =
19+
System.getenv("ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID");
20+
21+
try {
22+
OnCallNotificationRule result =
23+
apiInstance.getUserNotificationRule(
24+
USER_DATA_ID,
25+
ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID,
26+
new GetUserNotificationRuleOptionalParameters().include("channel"));
27+
System.out.println(result);
28+
} catch (ApiException e) {
29+
System.err.println("Exception when calling OnCallApi#getUserNotificationRule");
30+
System.err.println("Status code: " + e.getCode());
31+
System.err.println("Reason: " + e.getResponseBody());
32+
System.err.println("Response headers: " + e.getResponseHeaders());
33+
e.printStackTrace();
34+
}
35+
}
36+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// List On-Call notification rules for a user returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.api.OnCallApi.ListUserNotificationRulesOptionalParameters;
7+
import com.datadog.api.client.v2.model.ListOnCallNotificationRulesResponse;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
OnCallApi apiInstance = new OnCallApi(defaultClient);
13+
14+
// there is a valid "user" in the system
15+
String USER_DATA_ID = System.getenv("USER_DATA_ID");
16+
17+
try {
18+
ListOnCallNotificationRulesResponse result =
19+
apiInstance.listUserNotificationRules(
20+
USER_DATA_ID, new ListUserNotificationRulesOptionalParameters().include("channel"));
21+
System.out.println(result);
22+
} catch (ApiException e) {
23+
System.err.println("Exception when calling OnCallApi#listUserNotificationRules");
24+
System.err.println("Status code: " + e.getCode());
25+
System.err.println("Reason: " + e.getResponseBody());
26+
System.err.println("Response headers: " + e.getResponseHeaders());
27+
e.printStackTrace();
28+
}
29+
}
30+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Update an On-Call notification rule for a user returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.OnCallApi;
6+
import com.datadog.api.client.v2.api.OnCallApi.UpdateUserNotificationRuleOptionalParameters;
7+
import com.datadog.api.client.v2.model.NotificationChannelType;
8+
import com.datadog.api.client.v2.model.OnCallNotificationRule;
9+
import com.datadog.api.client.v2.model.OnCallNotificationRuleCategory;
10+
import com.datadog.api.client.v2.model.OnCallNotificationRuleChannelRelationship;
11+
import com.datadog.api.client.v2.model.OnCallNotificationRuleChannelRelationshipData;
12+
import com.datadog.api.client.v2.model.OnCallNotificationRuleRelationships;
13+
import com.datadog.api.client.v2.model.OnCallNotificationRuleRequestAttributes;
14+
import com.datadog.api.client.v2.model.OnCallNotificationRuleType;
15+
import com.datadog.api.client.v2.model.UpdateOnCallNotificationRuleRequest;
16+
import com.datadog.api.client.v2.model.UpdateOnCallNotificationRuleRequestData;
17+
18+
public class Example {
19+
public static void main(String[] args) {
20+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
21+
OnCallApi apiInstance = new OnCallApi(defaultClient);
22+
23+
// there is a valid "user" in the system
24+
String USER_DATA_ID = System.getenv("USER_DATA_ID");
25+
26+
// there is a valid "oncall_email_notification_rule" in the system
27+
String ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID =
28+
System.getenv("ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID");
29+
30+
// there is a valid "oncall_email_notification_channel" in the system
31+
String ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID =
32+
System.getenv("ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID");
33+
34+
UpdateOnCallNotificationRuleRequest body =
35+
new UpdateOnCallNotificationRuleRequest()
36+
.data(
37+
new UpdateOnCallNotificationRuleRequestData()
38+
.attributes(
39+
new OnCallNotificationRuleRequestAttributes()
40+
.category(OnCallNotificationRuleCategory.HIGH_URGENCY)
41+
.delayMinutes(1L))
42+
.id(ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID)
43+
.relationships(
44+
new OnCallNotificationRuleRelationships()
45+
.channel(
46+
new OnCallNotificationRuleChannelRelationship()
47+
.data(
48+
new OnCallNotificationRuleChannelRelationshipData()
49+
.id(ONCALL_EMAIL_NOTIFICATION_CHANNEL_DATA_ID)
50+
.type(NotificationChannelType.NOTIFICATION_CHANNELS))))
51+
.type(OnCallNotificationRuleType.NOTIFICATION_RULES));
52+
53+
try {
54+
OnCallNotificationRule result =
55+
apiInstance.updateUserNotificationRule(
56+
USER_DATA_ID,
57+
ONCALL_EMAIL_NOTIFICATION_RULE_DATA_ID,
58+
body,
59+
new UpdateUserNotificationRuleOptionalParameters().include("channel"));
60+
System.out.println(result);
61+
} catch (ApiException e) {
62+
System.err.println("Exception when calling OnCallApi#updateUserNotificationRule");
63+
System.err.println("Status code: " + e.getCode());
64+
System.err.println("Reason: " + e.getResponseBody());
65+
System.err.println("Response headers: " + e.getResponseHeaders());
66+
e.printStackTrace();
67+
}
68+
}
69+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,14 +748,12 @@ public class ApiClient {
748748
put("v2.updateDeploymentGate", false);
749749
put("v2.updateDeploymentRule", false);
750750
put("v2.createIncident", false);
751-
put("v2.createIncidentImpact", false);
752751
put("v2.createIncidentIntegration", false);
753752
put("v2.createIncidentNotificationRule", false);
754753
put("v2.createIncidentNotificationTemplate", false);
755754
put("v2.createIncidentTodo", false);
756755
put("v2.createIncidentType", false);
757756
put("v2.deleteIncident", false);
758-
put("v2.deleteIncidentImpact", false);
759757
put("v2.deleteIncidentIntegration", false);
760758
put("v2.deleteIncidentNotificationRule", false);
761759
put("v2.deleteIncidentNotificationTemplate", false);
@@ -768,7 +766,6 @@ public class ApiClient {
768766
put("v2.getIncidentTodo", false);
769767
put("v2.getIncidentType", false);
770768
put("v2.listIncidentAttachments", false);
771-
put("v2.listIncidentImpacts", false);
772769
put("v2.listIncidentIntegrations", false);
773770
put("v2.listIncidentNotificationRules", false);
774771
put("v2.listIncidentNotificationTemplates", false);

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

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,6 @@ public ApiResponse<IncidentImpactResponse> createIncidentImpactWithHttpInfo(
353353
IncidentImpactCreateRequest body,
354354
CreateIncidentImpactOptionalParameters parameters)
355355
throws ApiException {
356-
// Check if unstable operation is enabled
357-
String operationId = "createIncidentImpact";
358-
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
359-
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
360-
} else {
361-
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
362-
}
363356
Object localVarPostBody = body;
364357

365358
// verify the required parameter 'incidentId' is set
@@ -420,16 +413,6 @@ public ApiResponse<IncidentImpactResponse> createIncidentImpactWithHttpInfo(
420413
String incidentId,
421414
IncidentImpactCreateRequest body,
422415
CreateIncidentImpactOptionalParameters parameters) {
423-
// Check if unstable operation is enabled
424-
String operationId = "createIncidentImpact";
425-
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
426-
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
427-
} else {
428-
CompletableFuture<ApiResponse<IncidentImpactResponse>> result = new CompletableFuture<>();
429-
result.completeExceptionally(
430-
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
431-
return result;
432-
}
433416
Object localVarPostBody = body;
434417

435418
// verify the required parameter 'incidentId' is set
@@ -1518,13 +1501,6 @@ public CompletableFuture<Void> deleteIncidentImpactAsync(String incidentId, Stri
15181501
*/
15191502
public ApiResponse<Void> deleteIncidentImpactWithHttpInfo(String incidentId, String impactId)
15201503
throws ApiException {
1521-
// Check if unstable operation is enabled
1522-
String operationId = "deleteIncidentImpact";
1523-
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1524-
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1525-
} else {
1526-
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
1527-
}
15281504
Object localVarPostBody = null;
15291505

15301506
// verify the required parameter 'incidentId' is set
@@ -1578,16 +1554,6 @@ public ApiResponse<Void> deleteIncidentImpactWithHttpInfo(String incidentId, Str
15781554
*/
15791555
public CompletableFuture<ApiResponse<Void>> deleteIncidentImpactWithHttpInfoAsync(
15801556
String incidentId, String impactId) {
1581-
// Check if unstable operation is enabled
1582-
String operationId = "deleteIncidentImpact";
1583-
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
1584-
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
1585-
} else {
1586-
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
1587-
result.completeExceptionally(
1588-
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
1589-
return result;
1590-
}
15911557
Object localVarPostBody = null;
15921558

15931559
// verify the required parameter 'incidentId' is set
@@ -4141,13 +4107,6 @@ public CompletableFuture<IncidentImpactsResponse> listIncidentImpactsAsync(
41414107
*/
41424108
public ApiResponse<IncidentImpactsResponse> listIncidentImpactsWithHttpInfo(
41434109
String incidentId, ListIncidentImpactsOptionalParameters parameters) throws ApiException {
4144-
// Check if unstable operation is enabled
4145-
String operationId = "listIncidentImpacts";
4146-
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
4147-
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
4148-
} else {
4149-
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
4150-
}
41514110
Object localVarPostBody = null;
41524111

41534112
// verify the required parameter 'incidentId' is set
@@ -4199,16 +4158,6 @@ public ApiResponse<IncidentImpactsResponse> listIncidentImpactsWithHttpInfo(
41994158
public CompletableFuture<ApiResponse<IncidentImpactsResponse>>
42004159
listIncidentImpactsWithHttpInfoAsync(
42014160
String incidentId, ListIncidentImpactsOptionalParameters parameters) {
4202-
// Check if unstable operation is enabled
4203-
String operationId = "listIncidentImpacts";
4204-
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
4205-
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
4206-
} else {
4207-
CompletableFuture<ApiResponse<IncidentImpactsResponse>> result = new CompletableFuture<>();
4208-
result.completeExceptionally(
4209-
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
4210-
return result;
4211-
}
42124161
Object localVarPostBody = null;
42134162

42144163
// verify the required parameter 'incidentId' is set

0 commit comments

Comments
 (0)