Skip to content

Commit f6349ea

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 302f87a7 of spec repo
1 parent 5f88599 commit f6349ea

File tree

6 files changed

+168
-12
lines changed

6 files changed

+168
-12
lines changed

.apigentools-info

+4-4
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-14 15:44:18.459381",
8-
"spec_repo_commit": "64f5e7ee"
7+
"regenerated": "2025-05-16 10:37:08.566052",
8+
"spec_repo_commit": "302f87a7"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-14 15:44:18.474808",
13-
"spec_repo_commit": "64f5e7ee"
12+
"regenerated": "2025-05-16 10:37:08.582842",
13+
"spec_repo_commit": "302f87a7"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+43-7
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,25 @@ 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+
### From the console
14982+
14983+
14984+
1. Go to Storage Account
14985+
14986+
2. For each Storage Account, navigate to Data Protection
14987+
14988+
3. Select Set soft delete enabled and enter the number of days to retain soft
14989+
deleted data.'
14990+
type: string
1496814991
FindingEvaluation:
1496914992
description: The evaluation of the finding.
1497014993
enum:
@@ -52046,13 +52069,18 @@ paths:
5204652069
the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.\n\nQuery
5204752070
parameters must be only among the documented ones and with values of correct
5204852071
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"
52072+
are not allowed.\n\n### Additional Extension\n\nAdditional extension fields
52073+
are available for some findings.\n\nThe data is available by including the
52074+
query parameter `?detailed_findings=true` in the request.\n\nThe following
52075+
fields are available for findings:\n- `description`: The description and remediation
52076+
steps for this finding.\n- `datadog_link`: The Datadog relative link for this
52077+
finding.\n\n### Response\n\nThe response includes an array of finding objects,
52078+
pagination metadata, and a count of items that match the query.\n\nEach finding
52079+
object contains the following:\n\n- The finding ID that can be used in a `GetFinding`
52080+
request to retrieve the full finding details.\n- Core attributes, including
52081+
status, evaluation, high-level resource details, muted state, and rule details.\n-
52082+
`evaluation_changed_at` and `resource_discovery_date` time stamps.\n- An array
52083+
of associated tags.\n"
5205652084
operationId: ListFindings
5205752085
parameters:
5205852086
- description: Limit the number of findings returned. Must be <= 1000.
@@ -52155,6 +52183,14 @@ paths:
5215552183
items:
5215652184
$ref: '#/components/schemas/FindingVulnerabilityType'
5215752185
type: array
52186+
- description: Return additional fields for some findings.
52187+
example:
52188+
- true
52189+
in: query
52190+
name: detailed_findings
52191+
required: false
52192+
schema:
52193+
type: boolean
5215852194
responses:
5215952195
'200':
5216052196
content:
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

+29
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</h3>
5451+
*
5452+
* <p>Additional extension fields are available for some findings.
5453+
*
5454+
* <p>The data is available by including the query parameter <code>?detailed_findings=true</code>
5455+
* in the request.
5456+
*
5457+
* <p>The following fields are available for findings: - <code>description</code>: The description
5458+
* and remediation steps for this finding. - <code>datadog_link</code>: The Datadog relative link
5459+
* for this 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

+57-1
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))

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

+8
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+
@replay-only @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)