Skip to content

Commit

Permalink
Regenerate client from commit dee0a779 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Nov 4, 2024
1 parent 1243ed9 commit 66850f8
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-31 16:41:33.862946",
"spec_repo_commit": "63c441b2"
"regenerated": "2024-11-04 15:58:45.940406",
"spec_repo_commit": "dee0a779"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-31 16:41:33.881242",
"spec_repo_commit": "63c441b2"
"regenerated": "2024-11-04 15:58:45.959562",
"spec_repo_commit": "dee0a779"
}
}
}
34 changes: 34 additions & 0 deletions examples/v2/security-monitoring/ListFindings_1668290866.java
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();
}
}
}
4 changes: 2 additions & 2 deletions src/test/java/com/datadog/api/TestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,10 @@ public Invocation.Builder request() {
expectedQueryParams.put(entry.getKey(), paramValueList.get(0));
}

List<String> actualQueryValue = Arrays.asList(this.queryParams.entrySet().iterator().next().getValue());
List<String> actualQueryValue =
Arrays.asList(this.queryParams.entrySet().iterator().next().getValue());
Collections.sort(actualQueryValue);
assertEquals(expectedQueryParams, this.queryParams);

}
return new TestBuilder(this.client);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-10-21T20:05:58.636Z
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"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,14 @@ Feature: Security Monitoring
When the request with pagination is sent
Then the response status is 200 OK

@team:DataDog/cloud-security-posture-management
Scenario: List findings with detection_type query param returns "OK" response
Given operation "ListFindings" enabled
And new "ListFindings" request
And request contains "filter[vulnerability_type]" parameter with value ["misconfiguration", "attack_path"]
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: List rules returns "Bad Request" response
Given new "ListSecurityMonitoringRules" request
Expand Down

0 comments on commit 66850f8

Please sign in to comment.