Skip to content

Commit 7b6fb69

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document force_delete_dependencies for synthetics test deletion (#2016)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 464e4be commit 7b6fb69

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

.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": "2024-07-02 18:17:59.207116",
8-
"spec_repo_commit": "464f0cec"
7+
"regenerated": "2024-07-02 18:50:20.936980",
8+
"spec_repo_commit": "fae9d797"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-02 18:17:59.224176",
13-
"spec_repo_commit": "464f0cec"
12+
"regenerated": "2024-07-02 18:50:20.953928",
13+
"spec_repo_commit": "fae9d797"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14944,6 +14944,13 @@ components:
1494414944

1494514945
to delete.'
1494614946
properties:
14947+
force_delete_dependencies:
14948+
description: 'Delete the Synthetic test even if it''s referenced by other
14949+
resources
14950+
14951+
(for example, SLOs and composite monitors).'
14952+
example: false
14953+
type: boolean
1494714954
public_ids:
1494814955
description: An array of Synthetic test IDs you want to delete.
1494914956
example: []

src/datadog_api_client/v1/model/synthetics_delete_tests_payload.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,34 @@ class SyntheticsDeleteTestsPayload(ModelNormal):
1717
@cached_property
1818
def openapi_types(_):
1919
return {
20+
"force_delete_dependencies": (bool,),
2021
"public_ids": ([str],),
2122
}
2223

2324
attribute_map = {
25+
"force_delete_dependencies": "force_delete_dependencies",
2426
"public_ids": "public_ids",
2527
}
2628

27-
def __init__(self_, public_ids: Union[List[str], UnsetType] = unset, **kwargs):
29+
def __init__(
30+
self_,
31+
force_delete_dependencies: Union[bool, UnsetType] = unset,
32+
public_ids: Union[List[str], UnsetType] = unset,
33+
**kwargs,
34+
):
2835
"""
2936
A JSON list of the ID or IDs of the Synthetic tests that you want
3037
to delete.
3138
39+
:param force_delete_dependencies: Delete the Synthetic test even if it's referenced by other resources
40+
(for example, SLOs and composite monitors).
41+
:type force_delete_dependencies: bool, optional
42+
3243
:param public_ids: An array of Synthetic test IDs you want to delete.
3344
:type public_ids: [str], optional
3445
"""
46+
if force_delete_dependencies is not unset:
47+
kwargs["force_delete_dependencies"] = force_delete_dependencies
3548
if public_ids is not unset:
3649
kwargs["public_ids"] = public_ids
3750
super().__init__(kwargs)

tests/v1/features/synthetics.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,14 @@ Feature: Synthetics
269269
@generated @skip @team:DataDog/synthetics-ct
270270
Scenario: Delete tests returns "- JSON format is wrong" response
271271
Given new "DeleteTests" request
272-
And body with value {"public_ids": []}
272+
And body with value {"force_delete_dependencies": false, "public_ids": []}
273273
When the request is sent
274274
Then the response status is 400 - JSON format is wrong
275275

276276
@generated @skip @team:DataDog/synthetics-ct
277277
Scenario: Delete tests returns "- Tests to be deleted can't be found" response
278278
Given new "DeleteTests" request
279-
And body with value {"public_ids": []}
279+
And body with value {"force_delete_dependencies": false, "public_ids": []}
280280
When the request is sent
281281
Then the response status is 404 - Tests to be deleted can't be found
282282

0 commit comments

Comments
 (0)