Skip to content

Commit 3a21ffd

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove steps from certain expected synthetics api response (#3051)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1889cb0 commit 3a21ffd

File tree

7 files changed

+222
-15
lines changed

7 files changed

+222
-15
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16582,7 +16582,7 @@ components:
1658216582
tests:
1658316583
description: Array of Synthetic tests configuration.
1658416584
items:
16585-
$ref: '#/components/schemas/SyntheticsTestDetails'
16585+
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
1658616586
type: array
1658716587
type: object
1658816588
SyntheticsLocalVariableParsingOptionsType:
@@ -17613,7 +17613,7 @@ components:
1761317613
status:
1761417614
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
1761517615
steps:
17616-
description: For browser test, the steps of the test.
17616+
description: The steps of the test if they exist.
1761717617
items:
1761817618
$ref: '#/components/schemas/SyntheticsStep'
1761917619
type: array
@@ -17665,6 +17665,52 @@ components:
1766517665
- API
1766617666
- BROWSER
1766717667
- MOBILE
17668+
SyntheticsTestDetailsWithoutSteps:
17669+
description: Object containing details about your Synthetic test, without test
17670+
steps.
17671+
properties:
17672+
config:
17673+
$ref: '#/components/schemas/SyntheticsTestConfig'
17674+
creator:
17675+
$ref: '#/components/schemas/Creator'
17676+
locations:
17677+
description: Array of locations used to run the test.
17678+
example:
17679+
- aws:eu-west-3
17680+
items:
17681+
description: A location from which the test was run.
17682+
type: string
17683+
type: array
17684+
message:
17685+
description: Notification message associated with the test.
17686+
type: string
17687+
monitor_id:
17688+
description: The associated monitor ID.
17689+
format: int64
17690+
readOnly: true
17691+
type: integer
17692+
name:
17693+
description: Name of the test.
17694+
type: string
17695+
options:
17696+
$ref: '#/components/schemas/SyntheticsTestOptions'
17697+
public_id:
17698+
description: The test public ID.
17699+
readOnly: true
17700+
type: string
17701+
status:
17702+
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
17703+
subtype:
17704+
$ref: '#/components/schemas/SyntheticsTestDetailsSubType'
17705+
tags:
17706+
description: Array of tags attached to the test.
17707+
items:
17708+
description: A tag attached to the test.
17709+
type: string
17710+
type: array
17711+
type:
17712+
$ref: '#/components/schemas/SyntheticsTestDetailsType'
17713+
type: object
1766817714
SyntheticsTestExecutionRule:
1766917715
description: Execution rule for a Synthetic test.
1767017716
enum:
@@ -35257,7 +35303,7 @@ paths:
3525735303
content:
3525835304
application/json:
3525935305
schema:
35260-
$ref: '#/components/schemas/SyntheticsTestDetails'
35306+
$ref: '#/components/schemas/SyntheticsTestDetailsWithoutSteps'
3526135307
description: OK
3526235308
'403':
3526335309
content:

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5128,6 +5128,13 @@ datadog\_api\_client.v1.model.synthetics\_test\_details\_type module
51285128
:members:
51295129
:show-inheritance:
51305130

5131+
datadog\_api\_client.v1.model.synthetics\_test\_details\_without\_steps module
5132+
------------------------------------------------------------------------------
5133+
5134+
.. automodule:: datadog_api_client.v1.model.synthetics_test_details_without_steps
5135+
:members:
5136+
:show-inheritance:
5137+
51315138
datadog\_api\_client.v1.model.synthetics\_test\_execution\_rule module
51325139
----------------------------------------------------------------------
51335140

src/datadog_api_client/v1/api/synthetics_api.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from datadog_api_client.v1.model.synthetics_private_location import SyntheticsPrivateLocation
2323
from datadog_api_client.v1.model.synthetics_list_tests_response import SyntheticsListTestsResponse
24-
from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails
24+
from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps
2525
from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest
2626
from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest
2727
from datadog_api_client.v1.model.synthetics_get_browser_test_latest_results_response import (
@@ -36,6 +36,7 @@
3636
from datadog_api_client.v1.model.synthetics_ci_test_body import SyntheticsCITestBody
3737
from datadog_api_client.v1.model.synthetics_test_uptime import SyntheticsTestUptime
3838
from datadog_api_client.v1.model.synthetics_fetch_uptimes_payload import SyntheticsFetchUptimesPayload
39+
from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails
3940
from datadog_api_client.v1.model.synthetics_patch_test_body import SyntheticsPatchTestBody
4041
from datadog_api_client.v1.model.synthetics_get_api_test_latest_results_response import (
4142
SyntheticsGetAPITestLatestResultsResponse,
@@ -569,7 +570,7 @@ def __init__(self, api_client=None):
569570

570571
self._get_test_endpoint = _Endpoint(
571572
settings={
572-
"response_type": (SyntheticsTestDetails,),
573+
"response_type": (SyntheticsTestDetailsWithoutSteps,),
573574
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
574575
"endpoint_path": "/api/v1/synthetics/tests/{public_id}",
575576
"operation_id": "get_test",
@@ -1305,14 +1306,14 @@ def get_synthetics_default_locations(
13051306
def get_test(
13061307
self,
13071308
public_id: str,
1308-
) -> SyntheticsTestDetails:
1309+
) -> SyntheticsTestDetailsWithoutSteps:
13091310
"""Get a test configuration.
13101311
13111312
Get the detailed configuration associated with a Synthetic test.
13121313
13131314
:param public_id: The public ID of the test to get details from.
13141315
:type public_id: str
1315-
:rtype: SyntheticsTestDetails
1316+
:rtype: SyntheticsTestDetailsWithoutSteps
13161317
"""
13171318
kwargs: Dict[str, Any] = {}
13181319
kwargs["public_id"] = public_id
@@ -1374,7 +1375,7 @@ def list_tests_with_pagination(
13741375
*,
13751376
page_size: Union[int, UnsetType] = unset,
13761377
page_number: Union[int, UnsetType] = unset,
1377-
) -> collections.abc.Iterable[SyntheticsTestDetails]:
1378+
) -> collections.abc.Iterable[SyntheticsTestDetailsWithoutSteps]:
13781379
"""Get the list of all Synthetic tests.
13791380
13801381
Provide a paginated version of :meth:`list_tests`, returning all items.
@@ -1385,7 +1386,7 @@ def list_tests_with_pagination(
13851386
:type page_number: int, optional
13861387
13871388
:return: A generator of paginated results.
1388-
:rtype: collections.abc.Iterable[SyntheticsTestDetails]
1389+
:rtype: collections.abc.Iterable[SyntheticsTestDetailsWithoutSteps]
13891390
"""
13901391
kwargs: Dict[str, Any] = {}
13911392
if page_size is not unset:

src/datadog_api_client/v1/model/synthetics_list_tests_response.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@
1414

1515

1616
if TYPE_CHECKING:
17-
from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails
17+
from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps
1818

1919

2020
class SyntheticsListTestsResponse(ModelNormal):
2121
@cached_property
2222
def openapi_types(_):
23-
from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails
23+
from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps
2424

2525
return {
26-
"tests": ([SyntheticsTestDetails],),
26+
"tests": ([SyntheticsTestDetailsWithoutSteps],),
2727
}
2828

2929
attribute_map = {
3030
"tests": "tests",
3131
}
3232

33-
def __init__(self_, tests: Union[List[SyntheticsTestDetails], UnsetType] = unset, **kwargs):
33+
def __init__(self_, tests: Union[List[SyntheticsTestDetailsWithoutSteps], UnsetType] = unset, **kwargs):
3434
"""
3535
Object containing an array of Synthetic tests configuration.
3636
3737
:param tests: Array of Synthetic tests configuration.
38-
:type tests: [SyntheticsTestDetails], optional
38+
:type tests: [SyntheticsTestDetailsWithoutSteps], optional
3939
"""
4040
if tests is not unset:
4141
kwargs["tests"] = tests

src/datadog_api_client/v1/model/synthetics_test_details.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(
119119
Synthetic test.
120120
:type status: SyntheticsTestPauseStatus, optional
121121
122-
:param steps: For browser test, the steps of the test.
122+
:param steps: The steps of the test if they exist.
123123
:type steps: [SyntheticsStep], optional
124124
125125
:param subtype: The subtype of the Synthetic API test, ``http`` , ``ssl`` , ``tcp`` ,
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v1.model.synthetics_test_config import SyntheticsTestConfig
18+
from datadog_api_client.v1.model.creator import Creator
19+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
20+
from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus
21+
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
22+
from datadog_api_client.v1.model.synthetics_test_details_type import SyntheticsTestDetailsType
23+
24+
25+
class SyntheticsTestDetailsWithoutSteps(ModelNormal):
26+
@cached_property
27+
def openapi_types(_):
28+
from datadog_api_client.v1.model.synthetics_test_config import SyntheticsTestConfig
29+
from datadog_api_client.v1.model.creator import Creator
30+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
31+
from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus
32+
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
33+
from datadog_api_client.v1.model.synthetics_test_details_type import SyntheticsTestDetailsType
34+
35+
return {
36+
"config": (SyntheticsTestConfig,),
37+
"creator": (Creator,),
38+
"locations": ([str],),
39+
"message": (str,),
40+
"monitor_id": (int,),
41+
"name": (str,),
42+
"options": (SyntheticsTestOptions,),
43+
"public_id": (str,),
44+
"status": (SyntheticsTestPauseStatus,),
45+
"subtype": (SyntheticsTestDetailsSubType,),
46+
"tags": ([str],),
47+
"type": (SyntheticsTestDetailsType,),
48+
}
49+
50+
attribute_map = {
51+
"config": "config",
52+
"creator": "creator",
53+
"locations": "locations",
54+
"message": "message",
55+
"monitor_id": "monitor_id",
56+
"name": "name",
57+
"options": "options",
58+
"public_id": "public_id",
59+
"status": "status",
60+
"subtype": "subtype",
61+
"tags": "tags",
62+
"type": "type",
63+
}
64+
read_only_vars = {
65+
"creator",
66+
"monitor_id",
67+
"public_id",
68+
}
69+
70+
def __init__(
71+
self_,
72+
config: Union[SyntheticsTestConfig, UnsetType] = unset,
73+
creator: Union[Creator, UnsetType] = unset,
74+
locations: Union[List[str], UnsetType] = unset,
75+
message: Union[str, UnsetType] = unset,
76+
monitor_id: Union[int, UnsetType] = unset,
77+
name: Union[str, UnsetType] = unset,
78+
options: Union[SyntheticsTestOptions, UnsetType] = unset,
79+
public_id: Union[str, UnsetType] = unset,
80+
status: Union[SyntheticsTestPauseStatus, UnsetType] = unset,
81+
subtype: Union[SyntheticsTestDetailsSubType, UnsetType] = unset,
82+
tags: Union[List[str], UnsetType] = unset,
83+
type: Union[SyntheticsTestDetailsType, UnsetType] = unset,
84+
**kwargs,
85+
):
86+
"""
87+
Object containing details about your Synthetic test, without test steps.
88+
89+
:param config: Configuration object for a Synthetic test.
90+
:type config: SyntheticsTestConfig, optional
91+
92+
:param creator: Object describing the creator of the shared element.
93+
:type creator: Creator, optional
94+
95+
:param locations: Array of locations used to run the test.
96+
:type locations: [str], optional
97+
98+
:param message: Notification message associated with the test.
99+
:type message: str, optional
100+
101+
:param monitor_id: The associated monitor ID.
102+
:type monitor_id: int, optional
103+
104+
:param name: Name of the test.
105+
:type name: str, optional
106+
107+
:param options: Object describing the extra options for a Synthetic test.
108+
:type options: SyntheticsTestOptions, optional
109+
110+
:param public_id: The test public ID.
111+
:type public_id: str, optional
112+
113+
:param status: Define whether you want to start ( ``live`` ) or pause ( ``paused`` ) a
114+
Synthetic test.
115+
:type status: SyntheticsTestPauseStatus, optional
116+
117+
:param subtype: The subtype of the Synthetic API test, ``http`` , ``ssl`` , ``tcp`` ,
118+
``dns`` , ``icmp`` , ``udp`` , ``websocket`` , ``grpc`` or ``multi``.
119+
:type subtype: SyntheticsTestDetailsSubType, optional
120+
121+
:param tags: Array of tags attached to the test.
122+
:type tags: [str], optional
123+
124+
:param type: Type of the Synthetic test, either ``api`` or ``browser``.
125+
:type type: SyntheticsTestDetailsType, optional
126+
"""
127+
if config is not unset:
128+
kwargs["config"] = config
129+
if creator is not unset:
130+
kwargs["creator"] = creator
131+
if locations is not unset:
132+
kwargs["locations"] = locations
133+
if message is not unset:
134+
kwargs["message"] = message
135+
if monitor_id is not unset:
136+
kwargs["monitor_id"] = monitor_id
137+
if name is not unset:
138+
kwargs["name"] = name
139+
if options is not unset:
140+
kwargs["options"] = options
141+
if public_id is not unset:
142+
kwargs["public_id"] = public_id
143+
if status is not unset:
144+
kwargs["status"] = status
145+
if subtype is not unset:
146+
kwargs["subtype"] = subtype
147+
if tags is not unset:
148+
kwargs["tags"] = tags
149+
if type is not unset:
150+
kwargs["type"] = type
151+
super().__init__(kwargs)

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@
860860
from datadog_api_client.v1.model.synthetics_test_details import SyntheticsTestDetails
861861
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
862862
from datadog_api_client.v1.model.synthetics_test_details_type import SyntheticsTestDetailsType
863+
from datadog_api_client.v1.model.synthetics_test_details_without_steps import SyntheticsTestDetailsWithoutSteps
863864
from datadog_api_client.v1.model.synthetics_test_execution_rule import SyntheticsTestExecutionRule
864865
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
865866
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
@@ -1855,6 +1856,7 @@
18551856
"SyntheticsTestDetails",
18561857
"SyntheticsTestDetailsSubType",
18571858
"SyntheticsTestDetailsType",
1859+
"SyntheticsTestDetailsWithoutSteps",
18581860
"SyntheticsTestExecutionRule",
18591861
"SyntheticsTestHeaders",
18601862
"SyntheticsTestMetadata",

0 commit comments

Comments
 (0)