Skip to content

Commit 3f9da6e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3e3bf46c of spec repo
1 parent bcc81f6 commit 3f9da6e

8 files changed

Lines changed: 199 additions & 12 deletions

File tree

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-19 17:45:10.273296",
8-
"spec_repo_commit": "77e5efb9"
7+
"regenerated": "2025-05-20 12:22:25.913458",
8+
"spec_repo_commit": "3e3bf46c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-19 17:45:10.289104",
13-
"spec_repo_commit": "77e5efb9"
12+
"regenerated": "2025-05-20 12:22:25.929229",
13+
"spec_repo_commit": "3e3bf46c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14944,6 +14944,10 @@ components:
1494414944
FindingAttributes:
1494514945
description: The JSON:API attributes of the finding.
1494614946
properties:
14947+
datadog_link:
14948+
$ref: '#/components/schemas/FindingDatadogLink'
14949+
description:
14950+
$ref: '#/components/schemas/FindingDescription'
1494714951
evaluation:
1494814952
$ref: '#/components/schemas/FindingEvaluation'
1494914953
evaluation_changed_at:
@@ -14965,6 +14969,22 @@ components:
1496514969
vulnerability_type:
1496614970
$ref: '#/components/schemas/FindingVulnerabilityType'
1496714971
type: object
14972+
FindingDatadogLink:
14973+
description: The Datadog relative link for this finding.
14974+
example: /security/compliance?panels=cpfinding%7Cevent%7CruleId%3Adef-000-u5t%7CresourceId%3Ae8c9ab7c52ebd7bf2fdb4db641082d7d%7CtabId%3Aoverview
14975+
type: string
14976+
FindingDescription:
14977+
description: The description and remediation steps for this finding.
14978+
example: '## Remediation
14979+
14980+
14981+
1. In the console, go to **Storage Account**.
14982+
14983+
2. For each Storage Account, navigate to **Data Protection**.
14984+
14985+
3. Select **Set soft delete enabled** and enter the number of days to retain
14986+
soft deleted data.'
14987+
type: string
1496814988
FindingEvaluation:
1496914989
description: The evaluation of the finding.
1497014990
enum:
@@ -52046,13 +52066,18 @@ paths:
5204652066
the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.\n\nQuery
5204752067
parameters must be only among the documented ones and with values of correct
5204852068
types. Duplicated query parameters (e.g. `filter[status]=low&filter[status]=info`)
52049-
are not allowed.\n\n### Response\n\nThe response includes an array of finding
52050-
objects, pagination metadata, and a count of items that match the query.\n\nEach
52051-
finding object contains the following:\n\n- The finding ID that can be used
52052-
in a `GetFinding` request to retrieve the full finding details.\n- Core attributes,
52053-
including status, evaluation, high-level resource details, muted state, and
52054-
rule details.\n- `evaluation_changed_at` and `resource_discovery_date` time
52055-
stamps.\n- An array of associated tags.\n"
52069+
are not allowed.\n\n### Additional extension fields\n\nAdditional extension
52070+
fields are available for some findings.\n\nThe data is available when you
52071+
include the query parameter `?detailed_findings=true` in the request.\n\nThe
52072+
following fields are available for findings:\n- `description`: The description
52073+
and remediation steps for the finding.\n- `datadog_link`: The Datadog relative
52074+
link for the finding.\n\n### Response\n\nThe response includes an array of
52075+
finding objects, pagination metadata, and a count of items that match the
52076+
query.\n\nEach finding object contains the following:\n\n- The finding ID
52077+
that can be used in a `GetFinding` request to retrieve the full finding details.\n-
52078+
Core attributes, including status, evaluation, high-level resource details,
52079+
muted state, and rule details.\n- `evaluation_changed_at` and `resource_discovery_date`
52080+
time stamps.\n- An array of associated tags.\n"
5205652081
operationId: ListFindings
5205752082
parameters:
5205852083
- description: Limit the number of findings returned. Must be <= 1000.
@@ -52155,6 +52180,14 @@ paths:
5215552180
items:
5215652181
$ref: '#/components/schemas/FindingVulnerabilityType'
5215752182
type: array
52183+
- description: Return additional fields for some findings.
52184+
example:
52185+
- true
52186+
in: query
52187+
name: detailed_findings
52188+
required: false
52189+
schema:
52190+
type: boolean
5215852191
responses:
5215952192
'200':
5216052193
content:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// List findings returns "OK" response with details
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListFindingsOptionalParameters;
7+
import com.datadog.api.client.v2.model.ListFindingsResponse;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.listFindings", true);
13+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
14+
15+
try {
16+
ListFindingsResponse result =
17+
apiInstance.listFindings(new ListFindingsOptionalParameters().detailedFindings(true));
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling SecurityMonitoringApi#listFindings");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}

src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5132,6 +5132,7 @@ public static class ListFindingsOptionalParameters {
51325132
private FindingEvaluation filterEvaluation;
51335133
private FindingStatus filterStatus;
51345134
private List<FindingVulnerabilityType> filterVulnerabilityType;
5135+
private Boolean detailedFindings;
51355136

51365137
/**
51375138
* Set pageLimit.
@@ -5285,6 +5286,17 @@ public ListFindingsOptionalParameters filterVulnerabilityType(
52855286
this.filterVulnerabilityType = filterVulnerabilityType;
52865287
return this;
52875288
}
5289+
5290+
/**
5291+
* Set detailedFindings.
5292+
*
5293+
* @param detailedFindings Return additional fields for some findings. (optional)
5294+
* @return ListFindingsOptionalParameters
5295+
*/
5296+
public ListFindingsOptionalParameters detailedFindings(Boolean detailedFindings) {
5297+
this.detailedFindings = detailedFindings;
5298+
return this;
5299+
}
52885300
}
52895301

52905302
/**
@@ -5435,6 +5447,17 @@ public PaginationIterable<Finding> listFindingsWithPagination(
54355447
* Duplicated query parameters (e.g. <code>filter[status]=low&amp;filter[status]=info</code>) are
54365448
* not allowed.
54375449
*
5450+
* <h3>Additional extension fields</h3>
5451+
*
5452+
* <p>Additional extension fields are available for some findings.
5453+
*
5454+
* <p>The data is available when you include the query parameter <code>?detailed_findings=true
5455+
* </code> in the request.
5456+
*
5457+
* <p>The following fields are available for findings: - <code>description</code>: The description
5458+
* and remediation steps for the finding. - <code>datadog_link</code>: The Datadog relative link
5459+
* for the finding.
5460+
*
54385461
* <h3>Response</h3>
54395462
*
54405463
* <p>The response includes an array of finding objects, pagination metadata, and a count of items
@@ -5488,6 +5511,7 @@ public ApiResponse<ListFindingsResponse> listFindingsWithHttpInfo(
54885511
FindingEvaluation filterEvaluation = parameters.filterEvaluation;
54895512
FindingStatus filterStatus = parameters.filterStatus;
54905513
List<FindingVulnerabilityType> filterVulnerabilityType = parameters.filterVulnerabilityType;
5514+
Boolean detailedFindings = parameters.detailedFindings;
54915515
// create path and map variables
54925516
String localVarPath = "/api/v2/posture_management/findings";
54935517

@@ -5513,6 +5537,8 @@ public ApiResponse<ListFindingsResponse> listFindingsWithHttpInfo(
55135537
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus));
55145538
localVarQueryParams.addAll(
55155539
apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType));
5540+
localVarQueryParams.addAll(
5541+
apiClient.parameterToPairs("", "detailed_findings", detailedFindings));
55165542

55175543
Invocation.Builder builder =
55185544
apiClient.createBuilder(
@@ -5568,6 +5594,7 @@ public CompletableFuture<ApiResponse<ListFindingsResponse>> listFindingsWithHttp
55685594
FindingEvaluation filterEvaluation = parameters.filterEvaluation;
55695595
FindingStatus filterStatus = parameters.filterStatus;
55705596
List<FindingVulnerabilityType> filterVulnerabilityType = parameters.filterVulnerabilityType;
5597+
Boolean detailedFindings = parameters.detailedFindings;
55715598
// create path and map variables
55725599
String localVarPath = "/api/v2/posture_management/findings";
55735600

@@ -5593,6 +5620,8 @@ public CompletableFuture<ApiResponse<ListFindingsResponse>> listFindingsWithHttp
55935620
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus));
55945621
localVarQueryParams.addAll(
55955622
apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType));
5623+
localVarQueryParams.addAll(
5624+
apiClient.parameterToPairs("", "detailed_findings", detailedFindings));
55965625

55975626
Invocation.Builder builder;
55985627
try {

src/main/java/com/datadog/api/client/v2/model/FindingAttributes.java

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
/** The JSON:API attributes of the finding. */
2222
@JsonPropertyOrder({
23+
FindingAttributes.JSON_PROPERTY_DATADOG_LINK,
24+
FindingAttributes.JSON_PROPERTY_DESCRIPTION,
2325
FindingAttributes.JSON_PROPERTY_EVALUATION,
2426
FindingAttributes.JSON_PROPERTY_EVALUATION_CHANGED_AT,
2527
FindingAttributes.JSON_PROPERTY_MUTE,
@@ -35,6 +37,12 @@
3537
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
3638
public class FindingAttributes {
3739
@JsonIgnore public boolean unparsed = false;
40+
public static final String JSON_PROPERTY_DATADOG_LINK = "datadog_link";
41+
private String datadogLink;
42+
43+
public static final String JSON_PROPERTY_DESCRIPTION = "description";
44+
private String description;
45+
3846
public static final String JSON_PROPERTY_EVALUATION = "evaluation";
3947
private FindingEvaluation evaluation;
4048

@@ -65,6 +73,48 @@ public class FindingAttributes {
6573
public static final String JSON_PROPERTY_VULNERABILITY_TYPE = "vulnerability_type";
6674
private FindingVulnerabilityType vulnerabilityType;
6775

76+
public FindingAttributes datadogLink(String datadogLink) {
77+
this.datadogLink = datadogLink;
78+
return this;
79+
}
80+
81+
/**
82+
* The Datadog relative link for this finding.
83+
*
84+
* @return datadogLink
85+
*/
86+
@jakarta.annotation.Nullable
87+
@JsonProperty(JSON_PROPERTY_DATADOG_LINK)
88+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
89+
public String getDatadogLink() {
90+
return datadogLink;
91+
}
92+
93+
public void setDatadogLink(String datadogLink) {
94+
this.datadogLink = datadogLink;
95+
}
96+
97+
public FindingAttributes description(String description) {
98+
this.description = description;
99+
return this;
100+
}
101+
102+
/**
103+
* The description and remediation steps for this finding.
104+
*
105+
* @return description
106+
*/
107+
@jakarta.annotation.Nullable
108+
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
109+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
110+
public String getDescription() {
111+
return description;
112+
}
113+
114+
public void setDescription(String description) {
115+
this.description = description;
116+
}
117+
68118
public FindingAttributes evaluation(FindingEvaluation evaluation) {
69119
this.evaluation = evaluation;
70120
this.unparsed |= !evaluation.isValid();
@@ -353,7 +403,9 @@ public boolean equals(Object o) {
353403
return false;
354404
}
355405
FindingAttributes findingAttributes = (FindingAttributes) o;
356-
return Objects.equals(this.evaluation, findingAttributes.evaluation)
406+
return Objects.equals(this.datadogLink, findingAttributes.datadogLink)
407+
&& Objects.equals(this.description, findingAttributes.description)
408+
&& Objects.equals(this.evaluation, findingAttributes.evaluation)
357409
&& Objects.equals(this.evaluationChangedAt, findingAttributes.evaluationChangedAt)
358410
&& Objects.equals(this.mute, findingAttributes.mute)
359411
&& Objects.equals(this.resource, findingAttributes.resource)
@@ -369,6 +421,8 @@ public boolean equals(Object o) {
369421
@Override
370422
public int hashCode() {
371423
return Objects.hash(
424+
datadogLink,
425+
description,
372426
evaluation,
373427
evaluationChangedAt,
374428
mute,
@@ -386,6 +440,8 @@ public int hashCode() {
386440
public String toString() {
387441
StringBuilder sb = new StringBuilder();
388442
sb.append("class FindingAttributes {\n");
443+
sb.append(" datadogLink: ").append(toIndentedString(datadogLink)).append("\n");
444+
sb.append(" description: ").append(toIndentedString(description)).append("\n");
389445
sb.append(" evaluation: ").append(toIndentedString(evaluation)).append("\n");
390446
sb.append(" evaluationChangedAt: ")
391447
.append(toIndentedString(evaluationChangedAt))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-05-20T12:11:24.321Z
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[
2+
{
3+
"httpRequest": {
4+
"headers": {},
5+
"method": "GET",
6+
"path": "/api/v2/posture_management/findings",
7+
"queryStringParameters": {
8+
"detailed_findings": [
9+
"true"
10+
]
11+
},
12+
"keepAlive": false,
13+
"secure": true
14+
},
15+
"httpResponse": {
16+
"body": "{\"data\":[],\"meta\":{\"page\":{\"total_filtered_count\":0},\"snapshot_timestamp\":1747743085077}}",
17+
"headers": {
18+
"Content-Type": [
19+
"application/vnd.api+json"
20+
]
21+
},
22+
"statusCode": 200,
23+
"reasonPhrase": "OK"
24+
},
25+
"times": {
26+
"remainingTimes": 1
27+
},
28+
"timeToLive": {
29+
"unlimited": true
30+
},
31+
"id": "0b731c8b-9bbe-9867-4f8a-d005c800b7d6"
32+
}
33+
]

src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,14 @@ Feature: Security Monitoring
840840
Then the response status is 200 OK
841841
And the response "data[0].type" is equal to "finding"
842842

843+
@team:DataDog/cloud-security-posture-management
844+
Scenario: List findings returns "OK" response with details
845+
Given operation "ListFindings" enabled
846+
And new "ListFindings" request
847+
And request contains "detailed_findings" parameter with value true
848+
When the request is sent
849+
Then the response status is 200 OK
850+
843851
@generated @skip @team:DataDog/cloud-security-posture-management @with-pagination
844852
Scenario: List findings returns "OK" response with pagination
845853
Given operation "ListFindings" enabled

0 commit comments

Comments
 (0)