Skip to content

Commit be3a8e3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ebaa65e of spec repo
1 parent 4cbb808 commit be3a8e3

19 files changed

Lines changed: 894 additions & 7 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61289,6 +61289,129 @@ components:
6128961289
- name
6129061290
- options
6129161291
type: object
61292+
UpdateFlakyTestStateRequest:
61293+
description: Request to update the state of multiple flaky tests.
61294+
properties:
61295+
data:
61296+
$ref: '#/components/schemas/UpdateFlakyTestStateRequestData'
61297+
required:
61298+
- data
61299+
type: object
61300+
UpdateFlakyTestStateRequestAttributes:
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/UpdateFlakyTestStateRequestTest'
61307+
type: array
61308+
required:
61309+
- tests
61310+
type: object
61311+
UpdateFlakyTestStateRequestData:
61312+
description: The JSON:API data for updating flaky test states.
61313+
properties:
61314+
attributes:
61315+
$ref: '#/components/schemas/UpdateFlakyTestStateRequestAttributes'
61316+
type:
61317+
$ref: '#/components/schemas/UpdateFlakyTestStateRequestDataType'
61318+
required:
61319+
- type
61320+
- attributes
61321+
type: object
61322+
UpdateFlakyTestStateRequestDataType:
61323+
description: The definition of `UpdateFlakyTestStateRequestDataType` 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+
UpdateFlakyTestStateRequestTest:
61331+
description: A flaky test to update.
61332+
properties:
61333+
id:
61334+
description: The ID of the flaky test (FQN).
61335+
example: 4eb1887a8adb1847
61336+
type: string
61337+
new_state:
61338+
$ref: '#/components/schemas/UpdateFlakyTestStateRequestTestNewState'
61339+
required:
61340+
- id
61341+
- new_state
61342+
type: object
61343+
UpdateFlakyTestStateRequestTestNewState:
61344+
description: The new state to set for the flaky test.
61345+
enum:
61346+
- active
61347+
- quarantined
61348+
- disabled
61349+
- fixed
61350+
example: active
61351+
type: string
61352+
x-enum-varnames:
61353+
- ACTIVE
61354+
- QUARANTINED
61355+
- DISABLED
61356+
- FIXED
61357+
UpdateFlakyTestStateResponse:
61358+
description: Response object for updating flaky test states.
61359+
properties:
61360+
data:
61361+
$ref: '#/components/schemas/UpdateFlakyTestStateResponseData'
61362+
type: object
61363+
UpdateFlakyTestStateResponseAttributes:
61364+
description: Attributes for the update flaky test state response.
61365+
properties:
61366+
has_errors:
61367+
description: Whether any errors occurred during the update operation.
61368+
example: false
61369+
type: boolean
61370+
results:
61371+
description: Results of the update operation for each test.
61372+
items:
61373+
$ref: '#/components/schemas/UpdateFlakyTestStateResponseResult'
61374+
type: array
61375+
required:
61376+
- has_errors
61377+
- results
61378+
type: object
61379+
UpdateFlakyTestStateResponseData:
61380+
description: The JSON:API data for the update flaky test state response.
61381+
properties:
61382+
attributes:
61383+
$ref: '#/components/schemas/UpdateFlakyTestStateResponseAttributes'
61384+
id:
61385+
description: The ID of the response.
61386+
type: string
61387+
type:
61388+
$ref: '#/components/schemas/UpdateFlakyTestStateResponseDataType'
61389+
type: object
61390+
UpdateFlakyTestStateResponseDataType:
61391+
description: The definition of `UpdateFlakyTestStateResponseDataType` object.
61392+
enum:
61393+
- update_flaky_test_state_response
61394+
type: string
61395+
x-enum-varnames:
61396+
- UPDATE_FLAKY_TEST_STATE_RESPONSE
61397+
UpdateFlakyTestStateResponseResult:
61398+
description: Result of updating a single flaky test state.
61399+
properties:
61400+
error:
61401+
description: Error message if the update failed.
61402+
type: string
61403+
id:
61404+
description: The ID of the flaky test (FQN).
61405+
example: 4eb1887a8adb1847
61406+
type: string
61407+
success:
61408+
description: Whether the update was successful.
61409+
example: false
61410+
type: boolean
61411+
required:
61412+
- id
61413+
- success
61414+
type: object
6129261415
UpdateOnCallNotificationRuleRequest:
6129361416
description: A top-level wrapper for updating a notification rule for a user
6129461417
example:
@@ -63638,6 +63761,7 @@ components:
6363863761
teams_read: Read Teams data. A User with this permission can view Team
6363963762
names, metadata, and which Users are on each Team.
6364063763
test_optimization_read: View Test Optimization.
63764+
test_optimization_write: Modify Test Optimization.
6364163765
timeseries_query: Query Timeseries data.
6364263766
usage_read: View your organization's usage and usage attribution.
6364363767
user_access_invite: Invite other users to your organization.
@@ -94850,6 +94974,44 @@ paths:
9485094974
- incident_settings_write
9485194975
x-unstable: '**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/).'
9485294976
/api/v2/test/flaky-test-management/tests:
94977+
patch:
94978+
description: Update the state of multiple flaky tests in Flaky Test Management.
94979+
operationId: UpdateFlakyTestState
94980+
requestBody:
94981+
content:
94982+
application/json:
94983+
schema:
94984+
$ref: '#/components/schemas/UpdateFlakyTestStateRequest'
94985+
required: true
94986+
responses:
94987+
'200':
94988+
content:
94989+
application/json:
94990+
schema:
94991+
$ref: '#/components/schemas/UpdateFlakyTestStateResponse'
94992+
description: OK
94993+
'400':
94994+
$ref: '#/components/responses/BadRequestResponse'
94995+
'403':
94996+
$ref: '#/components/responses/NotAuthorizedResponse'
94997+
'429':
94998+
$ref: '#/components/responses/TooManyRequestsResponse'
94999+
security:
95000+
- apiKeyAuth: []
95001+
appKeyAuth: []
95002+
- AuthZ:
95003+
- test_optimization_write
95004+
summary: Update flaky test states
95005+
tags:
95006+
- Test Optimization
95007+
x-codegen-request-body-name: body
95008+
x-permission:
95009+
operator: OR
95010+
permissions:
95011+
- test_optimization_write
95012+
x-unstable: '**Note**: This endpoint is in preview and may be subject to change.
95013+
95014+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
9485395015
post:
9485495016
description: List endpoint returning flaky tests from Flaky Test Management.
9485595017
Results are paginated.

docs/datadog_api_client.v2.model.rst

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26975,6 +26975,83 @@ datadog\_api\_client.v2.model.update\_deployment\_rule\_params\_data\_attributes
2697526975
:members:
2697626976
:show-inheritance:
2697726977

26978+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_request module
26979+
------------------------------------------------------------------------
26980+
26981+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_request
26982+
:members:
26983+
:show-inheritance:
26984+
26985+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_request\_attributes module
26986+
------------------------------------------------------------------------------------
26987+
26988+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_request_attributes
26989+
:members:
26990+
:show-inheritance:
26991+
26992+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_request\_data module
26993+
------------------------------------------------------------------------------
26994+
26995+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_request_data
26996+
:members:
26997+
:show-inheritance:
26998+
26999+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_request\_data\_type module
27000+
------------------------------------------------------------------------------------
27001+
27002+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_request_data_type
27003+
:members:
27004+
:show-inheritance:
27005+
27006+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_request\_test module
27007+
------------------------------------------------------------------------------
27008+
27009+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_request_test
27010+
:members:
27011+
:show-inheritance:
27012+
27013+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_request\_test\_new\_state module
27014+
------------------------------------------------------------------------------------------
27015+
27016+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_request_test_new_state
27017+
:members:
27018+
:show-inheritance:
27019+
27020+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_response module
27021+
-------------------------------------------------------------------------
27022+
27023+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_response
27024+
:members:
27025+
:show-inheritance:
27026+
27027+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_response\_attributes module
27028+
-------------------------------------------------------------------------------------
27029+
27030+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_response_attributes
27031+
:members:
27032+
:show-inheritance:
27033+
27034+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_response\_data module
27035+
-------------------------------------------------------------------------------
27036+
27037+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_response_data
27038+
:members:
27039+
:show-inheritance:
27040+
27041+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_response\_data\_type module
27042+
-------------------------------------------------------------------------------------
27043+
27044+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_response_data_type
27045+
:members:
27046+
:show-inheritance:
27047+
27048+
datadog\_api\_client.v2.model.update\_flaky\_test\_state\_response\_result module
27049+
---------------------------------------------------------------------------------
27050+
27051+
.. automodule:: datadog_api_client.v2.model.update_flaky_test_state_response_result
27052+
:members:
27053+
:show-inheritance:
27054+
2697827055
datadog\_api\_client.v2.model.update\_on\_call\_notification\_rule\_request module
2697927056
----------------------------------------------------------------------------------
2698027057

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""
2+
Update flaky test states returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi
7+
from datadog_api_client.v2.model.update_flaky_test_state_request import UpdateFlakyTestStateRequest
8+
from datadog_api_client.v2.model.update_flaky_test_state_request_attributes import UpdateFlakyTestStateRequestAttributes
9+
from datadog_api_client.v2.model.update_flaky_test_state_request_data import UpdateFlakyTestStateRequestData
10+
from datadog_api_client.v2.model.update_flaky_test_state_request_data_type import UpdateFlakyTestStateRequestDataType
11+
from datadog_api_client.v2.model.update_flaky_test_state_request_test import UpdateFlakyTestStateRequestTest
12+
from datadog_api_client.v2.model.update_flaky_test_state_request_test_new_state import (
13+
UpdateFlakyTestStateRequestTestNewState,
14+
)
15+
16+
body = UpdateFlakyTestStateRequest(
17+
data=UpdateFlakyTestStateRequestData(
18+
attributes=UpdateFlakyTestStateRequestAttributes(
19+
tests=[
20+
UpdateFlakyTestStateRequestTest(
21+
id="4eb1887a8adb1847",
22+
new_state=UpdateFlakyTestStateRequestTestNewState.ACTIVE,
23+
),
24+
],
25+
),
26+
type=UpdateFlakyTestStateRequestDataType.UPDATE_FLAKY_TEST_STATE_REQUEST,
27+
),
28+
)
29+
30+
configuration = Configuration()
31+
configuration.unstable_operations["update_flaky_test_state"] = True
32+
with ApiClient(configuration) as api_client:
33+
api_instance = TestOptimizationApi(api_client)
34+
response = api_instance.update_flaky_test_state(body=body)
35+
36+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ def __init__(
415415
"v2.list_incident_teams": False,
416416
"v2.update_incident_team": False,
417417
"v2.search_flaky_tests": False,
418+
"v2.update_flaky_test_state": False,
418419
}
419420
)
420421

src/datadog_api_client/v2/api/test_optimization_api.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
UnsetType,
1515
unset,
1616
)
17+
from datadog_api_client.v2.model.update_flaky_test_state_response import UpdateFlakyTestStateResponse
18+
from datadog_api_client.v2.model.update_flaky_test_state_request import UpdateFlakyTestStateRequest
1719
from datadog_api_client.v2.model.flaky_tests_search_response import FlakyTestsSearchResponse
1820
from datadog_api_client.v2.model.flaky_tests_search_request import FlakyTestsSearchRequest
1921
from datadog_api_client.v2.model.flaky_test import FlakyTest
@@ -48,6 +50,26 @@ def __init__(self, api_client=None):
4850
api_client=api_client,
4951
)
5052

53+
self._update_flaky_test_state_endpoint = _Endpoint(
54+
settings={
55+
"response_type": (UpdateFlakyTestStateResponse,),
56+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
57+
"endpoint_path": "/api/v2/test/flaky-test-management/tests",
58+
"operation_id": "update_flaky_test_state",
59+
"http_method": "PATCH",
60+
"version": "v2",
61+
},
62+
params_map={
63+
"body": {
64+
"required": True,
65+
"openapi_types": (UpdateFlakyTestStateRequest,),
66+
"location": "body",
67+
},
68+
},
69+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
70+
api_client=api_client,
71+
)
72+
5173
def search_flaky_tests(
5274
self,
5375
*,
@@ -96,3 +118,19 @@ def search_flaky_tests_with_pagination(
96118
"kwargs": kwargs,
97119
}
98120
return endpoint.call_with_http_info_paginated(pagination)
121+
122+
def update_flaky_test_state(
123+
self,
124+
body: UpdateFlakyTestStateRequest,
125+
) -> UpdateFlakyTestStateResponse:
126+
"""Update flaky test states.
127+
128+
Update the state of multiple flaky tests in Flaky Test Management.
129+
130+
:type body: UpdateFlakyTestStateRequest
131+
:rtype: UpdateFlakyTestStateResponse
132+
"""
133+
kwargs: Dict[str, Any] = {}
134+
kwargs["body"] = body
135+
136+
return self._update_flaky_test_state_endpoint.call_with_http_info(**kwargs)

0 commit comments

Comments
 (0)