diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dc0f066c079..c36767d6922 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -25834,6 +25834,14 @@ components: FlakyTestsSearchFilter: description: Search filter settings. properties: + include_history: + default: false + description: |- + Whether to include the status change history for each flaky test in the response. + When set to true, each test will include a 'history' array with chronological status changes. + Defaults to false. + example: true + type: boolean query: default: "*" description: |- @@ -25879,14 +25887,6 @@ components: properties: filter: $ref: "#/components/schemas/FlakyTestsSearchFilter" - include_history: - default: false - description: |- - Whether to include the status change history for each flaky test in the response. - When set to true, each test will include a `history` array with chronological status changes. - Defaults to false. - example: true - type: boolean page: $ref: "#/components/schemas/FlakyTestsSearchPageOptions" sort: @@ -57944,7 +57944,6 @@ components: - none - false_positive - testing_or_maintenance - - remediated - investigated_case_opened - true_positive_benign - true_positive_malicious @@ -57954,7 +57953,6 @@ components: - NONE - FALSE_POSITIVE - TESTING_OR_MAINTENANCE - - REMEDIATED - INVESTIGATED_CASE_OPENED - TRUE_POSITIVE_BENIGN - TRUE_POSITIVE_MALICIOUS @@ -103307,8 +103305,6 @@ paths: schema: $ref: "#/components/schemas/SecurityMonitoringSignalResponse" description: OK - "403": - $ref: "#/components/responses/NotAuthorizedResponse" "404": $ref: "#/components/responses/NotFoundResponse" "429": @@ -103346,17 +103342,25 @@ paths: $ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse" description: OK "400": - $ref: "#/components/responses/BadRequestResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request "403": - $ref: "#/components/responses/NotAuthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden "404": - $ref: "#/components/responses/NotFoundResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Modify the triage assignee of a security signal tags: ["Security Monitoring"] x-codegen-request-body-name: body @@ -103386,17 +103390,25 @@ paths: $ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse" description: OK "400": - $ref: "#/components/responses/BadRequestResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request "403": - $ref: "#/components/responses/NotAuthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden "404": - $ref: "#/components/responses/NotFoundResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Change the related incidents of a security signal tags: ["Security Monitoring"] x-codegen-request-body-name: body @@ -103426,17 +103438,25 @@ paths: $ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse" description: OK "400": - $ref: "#/components/responses/BadRequestResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request "403": - $ref: "#/components/responses/NotAuthorizedResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden "404": - $ref: "#/components/responses/NotFoundResponse" + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Change the triage state of a security signal tags: ["Security Monitoring"] x-codegen-request-body-name: body diff --git a/examples/v2/test-optimization/SearchFlakyTests.java b/examples/v2/test-optimization/SearchFlakyTests.java index 58650a27895..4c356007fa5 100644 --- a/examples/v2/test-optimization/SearchFlakyTests.java +++ b/examples/v2/test-optimization/SearchFlakyTests.java @@ -27,11 +27,11 @@ public static void main(String[] args) { new FlakyTestsSearchRequestAttributes() .filter( new FlakyTestsSearchFilter() + .includeHistory(true) .query( """ flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist" """)) - .includeHistory(true) .page( new FlakyTestsSearchPageOptions() .cursor( diff --git a/examples/v2/test-optimization/SearchFlakyTests_1224086727.java b/examples/v2/test-optimization/SearchFlakyTests_1224086727.java index 164ee6fe99f..cb08200d7fa 100644 --- a/examples/v2/test-optimization/SearchFlakyTests_1224086727.java +++ b/examples/v2/test-optimization/SearchFlakyTests_1224086727.java @@ -27,11 +27,11 @@ public static void main(String[] args) { new FlakyTestsSearchRequestAttributes() .filter( new FlakyTestsSearchFilter() + .includeHistory(true) .query( """ flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist" """)) - .includeHistory(true) .page( new FlakyTestsSearchPageOptions() .cursor( diff --git a/examples/v2/test-optimization/SearchFlakyTests_209064879.java b/examples/v2/test-optimization/SearchFlakyTests_209064879.java index f1b3d1462bc..ebef8c47cf2 100644 --- a/examples/v2/test-optimization/SearchFlakyTests_209064879.java +++ b/examples/v2/test-optimization/SearchFlakyTests_209064879.java @@ -30,10 +30,10 @@ public static void main(String[] args) { .query( """ flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist" -""")) +""") + .includeHistory(true)) .page(new FlakyTestsSearchPageOptions().limit(10L)) - .sort(FlakyTestsSearchSort.FQN_ASCENDING) - .includeHistory(true)) + .sort(FlakyTestsSearchSort.FQN_ASCENDING)) .type(FlakyTestsSearchRequestDataType.SEARCH_FLAKY_TESTS_REQUEST)); try { diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index 7632101ebd2..e7f988a4801 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -4062,7 +4062,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * Status Code Description Response Headers * 200 OK - * 400 Bad Request - - * 403 Not Authorized - + * 403 Forbidden - * 404 Not Found - * 429 Too many requests - * @@ -4102,7 +4102,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "PATCH", builder, @@ -4169,7 +4169,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); @@ -4234,7 +4234,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * Status Code Description Response Headers * 200 OK - * 400 Bad Request - - * 403 Not Authorized - + * 403 Forbidden - * 404 Not Found - * 429 Too many requests - * @@ -4275,7 +4275,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "PATCH", builder, @@ -4342,7 +4342,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); @@ -4407,7 +4407,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * Status Code Description Response Headers * 200 OK - * 400 Bad Request - - * 403 Not Authorized - + * 403 Forbidden - * 404 Not Found - * 429 Too many requests - * @@ -4446,7 +4446,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "PATCH", builder, @@ -4513,7 +4513,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); @@ -6943,7 +6943,6 @@ public CompletableFuture getSecurityMonitoring * Response details * Status Code Description Response Headers * 200 OK - - * 403 Not Authorized - * 404 Not Found - * 429 Too many requests - * diff --git a/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchFilter.java b/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchFilter.java index e69ed3f25a0..7a6ceed2c35 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchFilter.java +++ b/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchFilter.java @@ -17,14 +17,43 @@ import java.util.Objects; /** Search filter settings. */ -@JsonPropertyOrder({FlakyTestsSearchFilter.JSON_PROPERTY_QUERY}) +@JsonPropertyOrder({ + FlakyTestsSearchFilter.JSON_PROPERTY_INCLUDE_HISTORY, + FlakyTestsSearchFilter.JSON_PROPERTY_QUERY +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class FlakyTestsSearchFilter { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_HISTORY = "include_history"; + private Boolean includeHistory = false; + public static final String JSON_PROPERTY_QUERY = "query"; private String query = "*"; + public FlakyTestsSearchFilter includeHistory(Boolean includeHistory) { + this.includeHistory = includeHistory; + return this; + } + + /** + * Whether to include the status change history for each flaky test in the response. When set to + * true, each test will include a 'history' array with chronological status changes. Defaults to + * false. + * + * @return includeHistory + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDE_HISTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeHistory() { + return includeHistory; + } + + public void setIncludeHistory(Boolean includeHistory) { + this.includeHistory = includeHistory; + } + public FlakyTestsSearchFilter query(String query) { this.query = query; return this; @@ -106,19 +135,21 @@ public boolean equals(Object o) { return false; } FlakyTestsSearchFilter flakyTestsSearchFilter = (FlakyTestsSearchFilter) o; - return Objects.equals(this.query, flakyTestsSearchFilter.query) + return Objects.equals(this.includeHistory, flakyTestsSearchFilter.includeHistory) + && Objects.equals(this.query, flakyTestsSearchFilter.query) && Objects.equals(this.additionalProperties, flakyTestsSearchFilter.additionalProperties); } @Override public int hashCode() { - return Objects.hash(query, additionalProperties); + return Objects.hash(includeHistory, query, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FlakyTestsSearchFilter {\n"); + sb.append(" includeHistory: ").append(toIndentedString(includeHistory)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java index b8c4e04d22e..eb6799104de 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java @@ -19,7 +19,6 @@ /** Attributes for the flaky tests search request. */ @JsonPropertyOrder({ FlakyTestsSearchRequestAttributes.JSON_PROPERTY_FILTER, - FlakyTestsSearchRequestAttributes.JSON_PROPERTY_INCLUDE_HISTORY, FlakyTestsSearchRequestAttributes.JSON_PROPERTY_PAGE, FlakyTestsSearchRequestAttributes.JSON_PROPERTY_SORT }) @@ -30,9 +29,6 @@ public class FlakyTestsSearchRequestAttributes { public static final String JSON_PROPERTY_FILTER = "filter"; private FlakyTestsSearchFilter filter; - public static final String JSON_PROPERTY_INCLUDE_HISTORY = "include_history"; - private Boolean includeHistory = false; - public static final String JSON_PROPERTY_PAGE = "page"; private FlakyTestsSearchPageOptions page; @@ -61,29 +57,6 @@ public void setFilter(FlakyTestsSearchFilter filter) { this.filter = filter; } - public FlakyTestsSearchRequestAttributes includeHistory(Boolean includeHistory) { - this.includeHistory = includeHistory; - return this; - } - - /** - * Whether to include the status change history for each flaky test in the response. When set to - * true, each test will include a history array with chronological status changes. - * Defaults to false. - * - * @return includeHistory - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INCLUDE_HISTORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIncludeHistory() { - return includeHistory; - } - - public void setIncludeHistory(Boolean includeHistory) { - this.includeHistory = includeHistory; - } - public FlakyTestsSearchRequestAttributes page(FlakyTestsSearchPageOptions page) { this.page = page; this.unparsed |= page.unparsed; @@ -190,7 +163,6 @@ public boolean equals(Object o) { FlakyTestsSearchRequestAttributes flakyTestsSearchRequestAttributes = (FlakyTestsSearchRequestAttributes) o; return Objects.equals(this.filter, flakyTestsSearchRequestAttributes.filter) - && Objects.equals(this.includeHistory, flakyTestsSearchRequestAttributes.includeHistory) && Objects.equals(this.page, flakyTestsSearchRequestAttributes.page) && Objects.equals(this.sort, flakyTestsSearchRequestAttributes.sort) && Objects.equals( @@ -199,7 +171,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(filter, includeHistory, page, sort, additionalProperties); + return Objects.hash(filter, page, sort, additionalProperties); } @Override @@ -207,7 +179,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FlakyTestsSearchRequestAttributes {\n"); sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); - sb.append(" includeHistory: ").append(toIndentedString(includeHistory)).append("\n"); sb.append(" page: ").append(toIndentedString(page)).append("\n"); sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSignalArchiveReason.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSignalArchiveReason.java index f2ef9c6f0c7..eba542576fd 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSignalArchiveReason.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSignalArchiveReason.java @@ -30,7 +30,6 @@ public class SecurityMonitoringSignalArchiveReason extends ModelEnum { "none", "false_positive", "testing_or_maintenance", - "remediated", "investigated_case_opened", "true_positive_benign", "true_positive_malicious", @@ -42,8 +41,6 @@ public class SecurityMonitoringSignalArchiveReason extends ModelEnum { new SecurityMonitoringSignalArchiveReason("false_positive"); public static final SecurityMonitoringSignalArchiveReason TESTING_OR_MAINTENANCE = new SecurityMonitoringSignalArchiveReason("testing_or_maintenance"); - public static final SecurityMonitoringSignalArchiveReason REMEDIATED = - new SecurityMonitoringSignalArchiveReason("remediated"); public static final SecurityMonitoringSignalArchiveReason INVESTIGATED_CASE_OPENED = new SecurityMonitoringSignalArchiveReason("investigated_case_opened"); public static final SecurityMonitoringSignalArchiveReason TRUE_POSITIVE_BENIGN = diff --git a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature index 427db05baf4..74e119ab5c0 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature @@ -85,7 +85,7 @@ Feature: Test Optimization Scenario: Search flaky tests returns "Bad Request" response Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} + And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} When the request is sent Then the response status is 400 Bad Request @@ -101,7 +101,7 @@ Feature: Test Optimization Scenario: Search flaky tests returns "OK" response Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} + And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} When the request is sent Then the response status is 200 OK @@ -117,7 +117,7 @@ Feature: Test Optimization Scenario: Search flaky tests returns "OK" response with history Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"limit": 10}, "sort": "fqn", "include_history": true}, "type": "search_flaky_tests_request"}} + And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\"", "include_history": true}, "page": {"limit": 10}, "sort": "fqn"}, "type": "search_flaky_tests_request"}} When the request is sent Then the response status is 200 OK And the response "data[0].attributes" has field "history" @@ -129,7 +129,7 @@ Feature: Test Optimization Scenario: Search flaky tests returns "OK" response with pagination Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} + And body with value {"data": {"attributes": {"filter": {"include_history": true, "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} When the request with pagination is sent Then the response status is 200 OK