Skip to content
Merged
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
717 changes: 717 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions examples/v2/governance-controls/GetGovernanceControl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Get a governance control 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.GovernanceControlResponse;

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

try {
GovernanceControlResponse result = apiInstance.getGovernanceControl("unused_api_keys");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GovernanceControlsApi#getGovernanceControl");
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-controls/ListGovernanceControls.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// List governance controls 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.GovernanceControlsResponse;

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

try {
GovernanceControlsResponse result = apiInstance.listGovernanceControls();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GovernanceControlsApi#listGovernanceControls");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
44 changes: 44 additions & 0 deletions examples/v2/governance-controls/UpdateGovernanceControl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Update a governance control 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.GovernanceControlResourceType;
import com.datadog.api.client.v2.model.GovernanceControlResponse;
import com.datadog.api.client.v2.model.GovernanceControlUpdateAttributes;
import com.datadog.api.client.v2.model.GovernanceControlUpdateData;
import com.datadog.api.client.v2.model.GovernanceControlUpdateRequest;

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

GovernanceControlUpdateRequest body =
new GovernanceControlUpdateRequest()
.data(
new GovernanceControlUpdateData()
.attributes(
new GovernanceControlUpdateAttributes()
.detectionFrequency("daily")
.mitigationType("revoke_api_key")
.name("Unused API Keys")
.notificationFrequency("daily")
.notificationType("slack"))
.id("0d4e6f8a-1b2c-3d4e-5f6a-7b8c9d0e1f2a")
.type(GovernanceControlResourceType.GOVERNANCE_CONTROL));

try {
GovernanceControlResponse result =
apiInstance.updateGovernanceControl("unused_api_keys", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GovernanceControlsApi#updateGovernanceControl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
3 changes: 3 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,6 +1054,9 @@ public class ApiClient {
put("v2.upsertAndPublishFormVersion", false);
put("v2.upsertFormVersion", false);
put("v2.updateOrgSamlConfigurations", false);
put("v2.getGovernanceControl", false);
put("v2.listGovernanceControls", false);
put("v2.updateGovernanceControl", false);
put("v2.listGovernanceInsights", false);
put("v2.createHamrOrgConnection", false);
put("v2.getHamrOrgConnection", false);
Expand Down
Loading
Loading