Skip to content

Commit cd989b0

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 36ced86 of spec repo
1 parent fd82d71 commit cd989b0

File tree

56 files changed

+11202
-16
lines changed

Some content is hidden

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

56 files changed

+11202
-16
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 782 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Create a notification rule 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.CaseManagementApi;
6+
import com.datadog.api.client.v2.model.CaseNotificationRuleCreate;
7+
import com.datadog.api.client.v2.model.CaseNotificationRuleCreateAttributes;
8+
import com.datadog.api.client.v2.model.CaseNotificationRuleCreateRequest;
9+
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipient;
10+
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipientData;
11+
import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType;
12+
import com.datadog.api.client.v2.model.CaseNotificationRuleResponse;
13+
import com.datadog.api.client.v2.model.CaseNotificationRuleTrigger;
14+
import java.util.Collections;
15+
16+
public class Example {
17+
public static void main(String[] args) {
18+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
19+
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
20+
21+
// there is a valid "project" in the system
22+
String PROJECT_ID = System.getenv("PROJECT_ID");
23+
24+
CaseNotificationRuleCreateRequest body =
25+
new CaseNotificationRuleCreateRequest()
26+
.data(
27+
new CaseNotificationRuleCreate()
28+
.type(CaseNotificationRuleResourceType.NOTIFICATION_RULE)
29+
.attributes(
30+
new CaseNotificationRuleCreateAttributes()
31+
.isEnabled(true)
32+
.recipients(
33+
Collections.singletonList(
34+
new CaseNotificationRuleRecipient()
35+
.type("email")
36+
.data(
37+
new CaseNotificationRuleRecipientData()
38+
.email(
39+
"test-Example-Case-Management@example.com"))))
40+
.triggers(
41+
Collections.singletonList(
42+
new CaseNotificationRuleTrigger().type("case_created")))));
43+
44+
try {
45+
CaseNotificationRuleResponse result =
46+
apiInstance.createProjectNotificationRule(PROJECT_ID, body);
47+
System.out.println(result);
48+
} catch (ApiException e) {
49+
System.err.println("Exception when calling CaseManagementApi#createProjectNotificationRule");
50+
System.err.println("Status code: " + e.getCode());
51+
System.err.println("Reason: " + e.getResponseBody());
52+
System.err.println("Response headers: " + e.getResponseHeaders());
53+
e.printStackTrace();
54+
}
55+
}
56+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Delete a notification rule 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.CaseManagementApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
11+
12+
// there is a valid "project" in the system
13+
String PROJECT_ID = System.getenv("PROJECT_ID");
14+
15+
// there is a valid "case_notification_rule" in the system
16+
String CASE_NOTIFICATION_RULE_ID = System.getenv("CASE_NOTIFICATION_RULE_ID");
17+
18+
try {
19+
apiInstance.deleteProjectNotificationRule(PROJECT_ID, CASE_NOTIFICATION_RULE_ID);
20+
} catch (ApiException e) {
21+
System.err.println("Exception when calling CaseManagementApi#deleteProjectNotificationRule");
22+
System.err.println("Status code: " + e.getCode());
23+
System.err.println("Reason: " + e.getResponseBody());
24+
System.err.println("Response headers: " + e.getResponseHeaders());
25+
e.printStackTrace();
26+
}
27+
}
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get notification rules 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.CaseManagementApi;
6+
import com.datadog.api.client.v2.model.CaseNotificationRulesResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
12+
13+
// there is a valid "project" in the system
14+
String PROJECT_ID = System.getenv("PROJECT_ID");
15+
16+
try {
17+
CaseNotificationRulesResponse result = apiInstance.getProjectNotificationRules(PROJECT_ID);
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling CaseManagementApi#getProjectNotificationRules");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Update a project 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.CaseManagementApi;
6+
import com.datadog.api.client.v2.model.ProjectResourceType;
7+
import com.datadog.api.client.v2.model.ProjectResponse;
8+
import com.datadog.api.client.v2.model.ProjectUpdate;
9+
import com.datadog.api.client.v2.model.ProjectUpdateAttributes;
10+
import com.datadog.api.client.v2.model.ProjectUpdateRequest;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
16+
17+
// there is a valid "project" in the system
18+
String PROJECT_ID = System.getenv("PROJECT_ID");
19+
20+
ProjectUpdateRequest body =
21+
new ProjectUpdateRequest()
22+
.data(
23+
new ProjectUpdate()
24+
.type(ProjectResourceType.PROJECT)
25+
.attributes(
26+
new ProjectUpdateAttributes()
27+
.name("Updated Project Name Example-Case-Management")));
28+
29+
try {
30+
ProjectResponse result = apiInstance.updateProject(PROJECT_ID, body);
31+
System.out.println(result);
32+
} catch (ApiException e) {
33+
System.err.println("Exception when calling CaseManagementApi#updateProject");
34+
System.err.println("Status code: " + e.getCode());
35+
System.err.println("Reason: " + e.getResponseBody());
36+
System.err.println("Response headers: " + e.getResponseHeaders());
37+
e.printStackTrace();
38+
}
39+
}
40+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Update a notification rule 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.CaseManagementApi;
6+
import com.datadog.api.client.v2.model.CaseNotificationRuleAttributes;
7+
import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType;
8+
import com.datadog.api.client.v2.model.CaseNotificationRuleResponse;
9+
import com.datadog.api.client.v2.model.CaseNotificationRuleUpdate;
10+
import com.datadog.api.client.v2.model.CaseNotificationRuleUpdateRequest;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
16+
17+
// there is a valid "project" in the system
18+
String PROJECT_ID = System.getenv("PROJECT_ID");
19+
20+
// there is a valid "case_notification_rule" in the system
21+
String CASE_NOTIFICATION_RULE_ID = System.getenv("CASE_NOTIFICATION_RULE_ID");
22+
23+
CaseNotificationRuleUpdateRequest body =
24+
new CaseNotificationRuleUpdateRequest()
25+
.data(
26+
new CaseNotificationRuleUpdate()
27+
.type(CaseNotificationRuleResourceType.NOTIFICATION_RULE)
28+
.attributes(new CaseNotificationRuleAttributes().isEnabled(false)));
29+
30+
try {
31+
CaseNotificationRuleResponse result =
32+
apiInstance.updateProjectNotificationRule(PROJECT_ID, CASE_NOTIFICATION_RULE_ID, body);
33+
System.out.println(result);
34+
} catch (ApiException e) {
35+
System.err.println("Exception when calling CaseManagementApi#updateProjectNotificationRule");
36+
System.err.println("Status code: " + e.getCode());
37+
System.err.println("Reason: " + e.getResponseBody());
38+
System.err.println("Response headers: " + e.getResponseHeaders());
39+
e.printStackTrace();
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)