Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
783 changes: 782 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions examples/v2/case-management/CreateProjectNotificationRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Create a notification rule returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseNotificationRuleCreate;
import com.datadog.api.client.v2.model.CaseNotificationRuleCreateAttributes;
import com.datadog.api.client.v2.model.CaseNotificationRuleCreateRequest;
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipient;
import com.datadog.api.client.v2.model.CaseNotificationRuleRecipientData;
import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType;
import com.datadog.api.client.v2.model.CaseNotificationRuleResponse;
import com.datadog.api.client.v2.model.CaseNotificationRuleTrigger;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

// there is a valid "project" in the system
String PROJECT_ID = System.getenv("PROJECT_ID");

CaseNotificationRuleCreateRequest body =
new CaseNotificationRuleCreateRequest()
.data(
new CaseNotificationRuleCreate()
.type(CaseNotificationRuleResourceType.NOTIFICATION_RULE)
.attributes(
new CaseNotificationRuleCreateAttributes()
.isEnabled(true)
.recipients(
Collections.singletonList(
new CaseNotificationRuleRecipient()
.type("email")
.data(
new CaseNotificationRuleRecipientData()
.email(
"test-Example-Case-Management@example.com"))))
.triggers(
Collections.singletonList(
new CaseNotificationRuleTrigger().type("case_created")))));

try {
CaseNotificationRuleResponse result =
apiInstance.createProjectNotificationRule(PROJECT_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#createProjectNotificationRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
28 changes: 28 additions & 0 deletions examples/v2/case-management/DeleteProjectNotificationRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Delete a notification rule returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

// there is a valid "project" in the system
String PROJECT_ID = System.getenv("PROJECT_ID");

// there is a valid "case_notification_rule" in the system
String CASE_NOTIFICATION_RULE_ID = System.getenv("CASE_NOTIFICATION_RULE_ID");

try {
apiInstance.deleteProjectNotificationRule(PROJECT_ID, CASE_NOTIFICATION_RULE_ID);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#deleteProjectNotificationRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
27 changes: 27 additions & 0 deletions examples/v2/case-management/GetProjectNotificationRules.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get notification rules returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseNotificationRulesResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

// there is a valid "project" in the system
String PROJECT_ID = System.getenv("PROJECT_ID");

try {
CaseNotificationRulesResponse result = apiInstance.getProjectNotificationRules(PROJECT_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#getProjectNotificationRules");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
40 changes: 40 additions & 0 deletions examples/v2/case-management/UpdateProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Update a project returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectResourceType;
import com.datadog.api.client.v2.model.ProjectResponse;
import com.datadog.api.client.v2.model.ProjectUpdate;
import com.datadog.api.client.v2.model.ProjectUpdateAttributes;
import com.datadog.api.client.v2.model.ProjectUpdateRequest;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

// there is a valid "project" in the system
String PROJECT_ID = System.getenv("PROJECT_ID");

ProjectUpdateRequest body =
new ProjectUpdateRequest()
.data(
new ProjectUpdate()
.type(ProjectResourceType.PROJECT)
.attributes(
new ProjectUpdateAttributes()
.name("Updated Project Name Example-Case-Management")));

try {
ProjectResponse result = apiInstance.updateProject(PROJECT_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#updateProject");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
42 changes: 42 additions & 0 deletions examples/v2/case-management/UpdateProjectNotificationRule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Update a notification rule returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseNotificationRuleAttributes;
import com.datadog.api.client.v2.model.CaseNotificationRuleResourceType;
import com.datadog.api.client.v2.model.CaseNotificationRuleResponse;
import com.datadog.api.client.v2.model.CaseNotificationRuleUpdate;
import com.datadog.api.client.v2.model.CaseNotificationRuleUpdateRequest;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

// there is a valid "project" in the system
String PROJECT_ID = System.getenv("PROJECT_ID");

// there is a valid "case_notification_rule" in the system
String CASE_NOTIFICATION_RULE_ID = System.getenv("CASE_NOTIFICATION_RULE_ID");

CaseNotificationRuleUpdateRequest body =
new CaseNotificationRuleUpdateRequest()
.data(
new CaseNotificationRuleUpdate()
.type(CaseNotificationRuleResourceType.NOTIFICATION_RULE)
.attributes(new CaseNotificationRuleAttributes().isEnabled(false)));

try {
CaseNotificationRuleResponse result =
apiInstance.updateProjectNotificationRule(PROJECT_ID, CASE_NOTIFICATION_RULE_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#updateProjectNotificationRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading