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
1,680 changes: 1,679 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions examples/v2/governance-controls/CreateGovernanceMitigation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Mitigate governance detections returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceControlsApi;
import com.datadog.api.client.v2.model.GovernanceControlDetectionResourceType;
import com.datadog.api.client.v2.model.GovernanceMitigationRequest;
import com.datadog.api.client.v2.model.GovernanceMitigationRequestAttributes;
import com.datadog.api.client.v2.model.GovernanceMitigationRequestData;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.createGovernanceMitigation", true);
GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);

GovernanceMitigationRequest body =
new GovernanceMitigationRequest()
.data(
new GovernanceMitigationRequestData()
.attributes(
new GovernanceMitigationRequestAttributes()
.detectionIds(
Collections.singletonList("3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d"))
.detectionType("unused_api_keys")
.mitigationType("revoke_api_key"))
.type(GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION));

try {
apiInstance.createGovernanceMitigation(body);
} catch (ApiException e) {
System.err.println("Exception when calling GovernanceControlsApi#createGovernanceMitigation");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Get a governance control detection returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceControlsApi;
import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getGovernanceControlDetection", true);
GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);

try {
GovernanceControlDetectionResponse result =
apiInstance.getGovernanceControlDetection(
"unused_api_keys", "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d");
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceControlsApi#getGovernanceControlDetection");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get governance control notification settings returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceControlsApi;
import com.datadog.api.client.v2.model.ControlNotificationSettingsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getGovernanceControlNotificationSettings", true);
GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);

try {
ControlNotificationSettingsResponse result =
apiInstance.getGovernanceControlNotificationSettings("unused_api_keys");
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceControlsApi#getGovernanceControlNotificationSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// List governance control detections returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceControlsApi;
import com.datadog.api.client.v2.model.GovernanceControlDetectionsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listGovernanceControlDetections", true);
GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);

try {
GovernanceControlDetectionsResponse result =
apiInstance.listGovernanceControlDetections("unused_api_keys");
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceControlsApi#listGovernanceControlDetections");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Update a governance control detection returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceControlsApi;
import com.datadog.api.client.v2.model.GovernanceControlDetectionResourceType;
import com.datadog.api.client.v2.model.GovernanceControlDetectionResponse;
import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateAttributes;
import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateData;
import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateRequest;
import com.datadog.api.client.v2.model.GovernanceControlDetectionUpdateState;
import java.time.OffsetDateTime;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.updateGovernanceControlDetection", true);
GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);

GovernanceControlDetectionUpdateRequest body =
new GovernanceControlDetectionUpdateRequest()
.data(
new GovernanceControlDetectionUpdateData()
.attributes(
new GovernanceControlDetectionUpdateAttributes()
.assignedTeam("platform-security")
.assignedTo("11111111-2222-3333-4444-555555555555")
.mitigateAfter(OffsetDateTime.parse("2024-03-15T00:00:00Z"))
.state(GovernanceControlDetectionUpdateState.EXCEPTION))
.type(GovernanceControlDetectionResourceType.GOVERNANCE_CONTROL_DETECTION));

try {
GovernanceControlDetectionResponse result =
apiInstance.updateGovernanceControlDetection(
"unused_api_keys", "3f9b2c1a-8d4e-4a6b-9c2f-1e7d5a0b3c4d", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceControlsApi#updateGovernanceControlDetection");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Update governance control notification settings returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceControlsApi;
import com.datadog.api.client.v2.model.ControlNotificationEventSetting;
import com.datadog.api.client.v2.model.ControlNotificationSettingsResourceType;
import com.datadog.api.client.v2.model.ControlNotificationSettingsResponse;
import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateAttributes;
import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateData;
import com.datadog.api.client.v2.model.ControlNotificationSettingsUpdateRequest;
import com.datadog.api.client.v2.model.ControlNotificationTarget;
import com.datadog.api.client.v2.model.ControlNotificationTargetType;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled(
"v2.updateGovernanceControlNotificationSettings", true);
GovernanceControlsApi apiInstance = new GovernanceControlsApi(defaultClient);

ControlNotificationSettingsUpdateRequest body =
new ControlNotificationSettingsUpdateRequest()
.data(
new ControlNotificationSettingsUpdateData()
.attributes(
new ControlNotificationSettingsUpdateAttributes()
.eventSettings(
Collections.singletonList(
new ControlNotificationEventSetting()
.enabled(true)
.eventType("new_detection")
.targets(
Collections.singletonList(
new ControlNotificationTarget()
.handle("#governance-alerts")
.type(ControlNotificationTargetType.SLACK))))))
.type(ControlNotificationSettingsResourceType.CONTROL_NOTIFICATION_SETTINGS));

try {
ControlNotificationSettingsResponse result =
apiInstance.updateGovernanceControlNotificationSettings("unused_api_keys", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling"
+ " GovernanceControlsApi#updateGovernanceControlNotificationSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions examples/v2/governance-settings/GetGovernanceConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get the governance console configuration returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceSettingsApi;
import com.datadog.api.client.v2.model.GovernanceConfigResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getGovernanceConfig", true);
GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);

try {
GovernanceConfigResponse result = apiInstance.getGovernanceConfig();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GovernanceSettingsApi#getGovernanceConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Get governance notification settings returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceSettingsApi;
import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getGovernanceNotificationSettings", true);
GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);

try {
GovernanceNotificationSettingsResponse result =
apiInstance.getGovernanceNotificationSettings();
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceSettingsApi#getGovernanceNotificationSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions examples/v2/governance-settings/ListGovernanceLimits.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// List governance limits returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceSettingsApi;
import com.datadog.api.client.v2.model.GovernanceLimitsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listGovernanceLimits", true);
GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);

try {
GovernanceLimitsResponse result = apiInstance.listGovernanceLimits();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GovernanceSettingsApi#listGovernanceLimits");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// List governance resource limits returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceSettingsApi;
import com.datadog.api.client.v2.model.GovernanceResourceLimitsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listGovernanceResourceLimits", true);
GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);

try {
GovernanceResourceLimitsResponse result = apiInstance.listGovernanceResourceLimits();
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceSettingsApi#listGovernanceResourceLimits");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Update governance notification settings returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.GovernanceSettingsApi;
import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResourceType;
import com.datadog.api.client.v2.model.GovernanceNotificationSettingsResponse;
import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateAttributes;
import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateData;
import com.datadog.api.client.v2.model.GovernanceNotificationSettingsUpdateRequest;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.updateGovernanceNotificationSettings", true);
GovernanceSettingsApi apiInstance = new GovernanceSettingsApi(defaultClient);

GovernanceNotificationSettingsUpdateRequest body =
new GovernanceNotificationSettingsUpdateRequest()
.data(
new GovernanceNotificationSettingsUpdateData()
.attributes(
new GovernanceNotificationSettingsUpdateAttributes()
.assignmentNotificationsEnabled(true))
.type(
GovernanceNotificationSettingsResourceType
.GOVERNANCE_NOTIFICATION_SETTINGS));

try {
GovernanceNotificationSettingsResponse result =
apiInstance.updateGovernanceNotificationSettings(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling GovernanceSettingsApi#updateGovernanceNotificationSettings");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
11 changes: 11 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1054,9 +1054,20 @@ public class ApiClient {
put("v2.upsertAndPublishFormVersion", false);
put("v2.upsertFormVersion", false);
put("v2.updateOrgSamlConfigurations", false);
put("v2.getGovernanceConfig", false);
put("v2.getGovernanceNotificationSettings", false);
put("v2.listGovernanceLimits", false);
put("v2.listGovernanceResourceLimits", false);
put("v2.updateGovernanceNotificationSettings", false);
put("v2.createGovernanceMitigation", false);
put("v2.getGovernanceControl", false);
put("v2.getGovernanceControlDetection", false);
put("v2.getGovernanceControlNotificationSettings", false);
put("v2.listGovernanceControlDetections", false);
put("v2.listGovernanceControls", false);
put("v2.updateGovernanceControl", false);
put("v2.updateGovernanceControlDetection", false);
put("v2.updateGovernanceControlNotificationSettings", false);
put("v2.listGovernanceInsights", false);
put("v2.createHamrOrgConnection", false);
put("v2.getHamrOrgConnection", false);
Expand Down
Loading
Loading