Skip to content

Commit 88eeec7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8b43fc8 of spec repo
1 parent 69e0160 commit 88eeec7

17 files changed

Lines changed: 1977 additions & 7 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61289,6 +61289,136 @@ components:
6128961289
- name
6129061290
- options
6129161291
type: object
61292+
UpdateFlakyTestsRequest:
61293+
description: Request to update the state of multiple flaky tests.
61294+
properties:
61295+
data:
61296+
$ref: '#/components/schemas/UpdateFlakyTestsRequestData'
61297+
required:
61298+
- data
61299+
type: object
61300+
UpdateFlakyTestsRequestAttributes:
61301+
description: Attributes for updating flaky test states.
61302+
properties:
61303+
tests:
61304+
description: List of flaky tests to update.
61305+
items:
61306+
$ref: '#/components/schemas/UpdateFlakyTestsRequestTest'
61307+
type: array
61308+
required:
61309+
- tests
61310+
type: object
61311+
UpdateFlakyTestsRequestData:
61312+
description: The JSON:API data for updating flaky test states.
61313+
properties:
61314+
attributes:
61315+
$ref: '#/components/schemas/UpdateFlakyTestsRequestAttributes'
61316+
type:
61317+
$ref: '#/components/schemas/UpdateFlakyTestsRequestDataType'
61318+
required:
61319+
- type
61320+
- attributes
61321+
type: object
61322+
UpdateFlakyTestsRequestDataType:
61323+
description: The definition of `UpdateFlakyTestsRequestDataType` object.
61324+
enum:
61325+
- update_flaky_test_state_request
61326+
example: update_flaky_test_state_request
61327+
type: string
61328+
x-enum-varnames:
61329+
- UPDATE_FLAKY_TEST_STATE_REQUEST
61330+
UpdateFlakyTestsRequestTest:
61331+
description: Details of what tests to update and their new attributes.
61332+
properties:
61333+
id:
61334+
description: The ID of the flaky test. This is the same ID returned by the
61335+
Search flaky tests endpoint and corresponds to the test_fingerprint_fqn
61336+
field in test run events.
61337+
example: 4eb1887a8adb1847
61338+
type: string
61339+
new_state:
61340+
$ref: '#/components/schemas/UpdateFlakyTestsRequestTestNewState'
61341+
required:
61342+
- id
61343+
- new_state
61344+
type: object
61345+
UpdateFlakyTestsRequestTestNewState:
61346+
description: The new state to set for the flaky test.
61347+
enum:
61348+
- active
61349+
- quarantined
61350+
- disabled
61351+
- fixed
61352+
example: active
61353+
type: string
61354+
x-enum-varnames:
61355+
- ACTIVE
61356+
- QUARANTINED
61357+
- DISABLED
61358+
- FIXED
61359+
UpdateFlakyTestsResponse:
61360+
description: Response object for updating flaky test states.
61361+
properties:
61362+
data:
61363+
$ref: '#/components/schemas/UpdateFlakyTestsResponseData'
61364+
type: object
61365+
UpdateFlakyTestsResponseAttributes:
61366+
description: Attributes for the update flaky test state response.
61367+
properties:
61368+
has_errors:
61369+
description: '`True` if any errors occurred during the update operations.
61370+
`False` if all tests succeeded to be updated.'
61371+
example: true
61372+
type: boolean
61373+
results:
61374+
description: Results of the update operation for each test.
61375+
items:
61376+
$ref: '#/components/schemas/UpdateFlakyTestsResponseResult'
61377+
type: array
61378+
required:
61379+
- has_errors
61380+
- results
61381+
type: object
61382+
UpdateFlakyTestsResponseData:
61383+
description: Summary of the update operations. Tells whether a test succeeded
61384+
or failed to be updated.
61385+
properties:
61386+
attributes:
61387+
$ref: '#/components/schemas/UpdateFlakyTestsResponseAttributes'
61388+
id:
61389+
description: The ID of the response.
61390+
type: string
61391+
type:
61392+
$ref: '#/components/schemas/UpdateFlakyTestsResponseDataType'
61393+
type: object
61394+
UpdateFlakyTestsResponseDataType:
61395+
description: The definition of `UpdateFlakyTestsResponseDataType` object.
61396+
enum:
61397+
- update_flaky_test_state_response
61398+
type: string
61399+
x-enum-varnames:
61400+
- UPDATE_FLAKY_TEST_STATE_RESPONSE
61401+
UpdateFlakyTestsResponseResult:
61402+
description: Result of updating a single flaky test state.
61403+
properties:
61404+
error:
61405+
description: Error message if the update failed.
61406+
type: string
61407+
id:
61408+
description: The ID of the flaky test from the request. This is the same
61409+
ID returned by the Search flaky tests endpoint and corresponds to the
61410+
test_fingerprint_fqn field in test run events.
61411+
example: 4eb1887a8adb1847
61412+
type: string
61413+
success:
61414+
description: '`True` if the update was successful, `False` if there were
61415+
any errors.'
61416+
example: false
61417+
type: boolean
61418+
required:
61419+
- id
61420+
- success
61421+
type: object
6129261422
UpdateOnCallNotificationRuleRequest:
6129361423
description: A top-level wrapper for updating a notification rule for a user
6129461424
example:
@@ -63638,6 +63768,8 @@ components:
6363863768
teams_read: Read Teams data. A User with this permission can view Team
6363963769
names, metadata, and which Users are on each Team.
6364063770
test_optimization_read: View Test Optimization.
63771+
test_optimization_write: Update flaky tests from Flaky Tests Management
63772+
of Test Optimization.
6364163773
timeseries_query: Query Timeseries data.
6364263774
usage_read: View your organization's usage and usage attribution.
6364363775
user_access_invite: Invite other users to your organization.
@@ -94850,6 +94982,44 @@ paths:
9485094982
- incident_settings_write
9485194983
x-unstable: '**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/).'
9485294984
/api/v2/test/flaky-test-management/tests:
94985+
patch:
94986+
description: Update the state of multiple flaky tests in Flaky Test Management.
94987+
operationId: UpdateFlakyTests
94988+
requestBody:
94989+
content:
94990+
application/json:
94991+
schema:
94992+
$ref: '#/components/schemas/UpdateFlakyTestsRequest'
94993+
required: true
94994+
responses:
94995+
'200':
94996+
content:
94997+
application/json:
94998+
schema:
94999+
$ref: '#/components/schemas/UpdateFlakyTestsResponse'
95000+
description: OK
95001+
'400':
95002+
$ref: '#/components/responses/BadRequestResponse'
95003+
'403':
95004+
$ref: '#/components/responses/NotAuthorizedResponse'
95005+
'429':
95006+
$ref: '#/components/responses/TooManyRequestsResponse'
95007+
security:
95008+
- apiKeyAuth: []
95009+
appKeyAuth: []
95010+
- AuthZ:
95011+
- test_optimization_write
95012+
summary: Update flaky test states
95013+
tags:
95014+
- Test Optimization
95015+
x-codegen-request-body-name: body
95016+
x-permission:
95017+
operator: OR
95018+
permissions:
95019+
- test_optimization_write
95020+
x-unstable: '**Note**: This endpoint is in preview and may be subject to change.
95021+
95022+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
9485395023
post:
9485495024
description: List endpoint returning flaky tests from Flaky Test Management.
9485595025
Results are paginated.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Update flaky test states returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.TestOptimizationApi;
6+
import com.datadog.api.client.v2.model.UpdateFlakyTestsRequest;
7+
import com.datadog.api.client.v2.model.UpdateFlakyTestsRequestAttributes;
8+
import com.datadog.api.client.v2.model.UpdateFlakyTestsRequestData;
9+
import com.datadog.api.client.v2.model.UpdateFlakyTestsRequestDataType;
10+
import com.datadog.api.client.v2.model.UpdateFlakyTestsRequestTest;
11+
import com.datadog.api.client.v2.model.UpdateFlakyTestsRequestTestNewState;
12+
import com.datadog.api.client.v2.model.UpdateFlakyTestsResponse;
13+
import java.util.Collections;
14+
15+
public class Example {
16+
public static void main(String[] args) {
17+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
18+
defaultClient.setUnstableOperationEnabled("v2.updateFlakyTests", true);
19+
TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient);
20+
21+
UpdateFlakyTestsRequest body =
22+
new UpdateFlakyTestsRequest()
23+
.data(
24+
new UpdateFlakyTestsRequestData()
25+
.attributes(
26+
new UpdateFlakyTestsRequestAttributes()
27+
.tests(
28+
Collections.singletonList(
29+
new UpdateFlakyTestsRequestTest()
30+
.id("4eb1887a8adb1847")
31+
.newState(UpdateFlakyTestsRequestTestNewState.ACTIVE))))
32+
.type(UpdateFlakyTestsRequestDataType.UPDATE_FLAKY_TEST_STATE_REQUEST));
33+
34+
try {
35+
UpdateFlakyTestsResponse result = apiInstance.updateFlakyTests(body);
36+
System.out.println(result);
37+
} catch (ApiException e) {
38+
System.err.println("Exception when calling TestOptimizationApi#updateFlakyTests");
39+
System.err.println("Status code: " + e.getCode());
40+
System.err.println("Reason: " + e.getResponseBody());
41+
System.err.println("Response headers: " + e.getResponseHeaders());
42+
e.printStackTrace();
43+
}
44+
}
45+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ public class ApiClient {
924924
put("v2.listIncidentTeams", false);
925925
put("v2.updateIncidentTeam", false);
926926
put("v2.searchFlakyTests", false);
927+
put("v2.updateFlakyTests", false);
927928
}
928929
};
929930
protected static final java.util.logging.Logger logger =

0 commit comments

Comments
 (0)