-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit aeb956c4 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Nov 4, 2024
1 parent
13d1d9a
commit a65da81
Showing
6 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
examples/v2/security-monitoring/ListFindings_1668290866.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// List findings with detection_type query param returns "OK" response | ||
|
||
import com.datadog.api.client.ApiClient; | ||
import com.datadog.api.client.ApiException; | ||
import com.datadog.api.client.v2.api.SecurityMonitoringApi; | ||
import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListFindingsOptionalParameters; | ||
import com.datadog.api.client.v2.model.FindingVulnerabilityType; | ||
import com.datadog.api.client.v2.model.ListFindingsResponse; | ||
import java.util.Arrays; | ||
|
||
public class Example { | ||
public static void main(String[] args) { | ||
ApiClient defaultClient = ApiClient.getDefaultApiClient(); | ||
defaultClient.setUnstableOperationEnabled("v2.listFindings", true); | ||
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); | ||
|
||
try { | ||
ListFindingsResponse result = | ||
apiInstance.listFindings( | ||
new ListFindingsOptionalParameters() | ||
.filterVulnerabilityType( | ||
Arrays.asList( | ||
FindingVulnerabilityType.MISCONFIGURATION, | ||
FindingVulnerabilityType.ATTACK_PATH))); | ||
System.out.println(result); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling SecurityMonitoringApi#listFindings"); | ||
System.err.println("Status code: " + e.getCode()); | ||
System.err.println("Reason: " + e.getResponseBody()); | ||
System.err.println("Response headers: " + e.getResponseHeaders()); | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ttes/features/v2/List_findings_with_detection_type_query_param_returns_OK_response.freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2024-10-21T20:05:58.636Z |
34 changes: 34 additions & 0 deletions
34
...settes/features/v2/List_findings_with_detection_type_query_param_returns_OK_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
{ | ||
"httpRequest": { | ||
"headers": {}, | ||
"method": "GET", | ||
"path": "/api/v2/posture_management/findings", | ||
"queryStringParameters": { | ||
"filter[vulnerability_type]": [ | ||
"misconfiguration", | ||
"attack_path" | ||
] | ||
}, | ||
"keepAlive": false, | ||
"secure": true | ||
}, | ||
"httpResponse": { | ||
"body": "{\"data\":[],\"meta\":{\"page\":{\"total_filtered_count\":0},\"snapshot_timestamp\":1729541158755}}", | ||
"headers": { | ||
"Content-Type": [ | ||
"application/vnd.api+json" | ||
] | ||
}, | ||
"statusCode": 200, | ||
"reasonPhrase": "OK" | ||
}, | ||
"times": { | ||
"remainingTimes": 1 | ||
}, | ||
"timeToLive": { | ||
"unlimited": true | ||
}, | ||
"id": "5f6fcc70-3704-b046-2fc3-3728fd9b12b2" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters