Skip to content

Commit 028b8a4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 60eadc2 of spec repo
1 parent 3d77f00 commit 028b8a4

12 files changed

Lines changed: 457 additions & 1 deletion

.generator/schemas/v1/openapi.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14597,6 +14597,61 @@ components:
1459714597
oneOf:
1459814598
- $ref: '#/components/schemas/SyntheticsAPITestStep'
1459914599
- $ref: '#/components/schemas/SyntheticsAPIWaitStep'
14600+
- $ref: '#/components/schemas/SyntheticsAPISubtestStep'
14601+
SyntheticsAPISubtestStep:
14602+
description: The subtest step used in a Synthetics multi-step API test.
14603+
properties:
14604+
allowFailure:
14605+
description: Determines whether or not to continue with test if this step
14606+
fails.
14607+
type: boolean
14608+
alwaysExecute:
14609+
description: A boolean set to always execute this step even if the previous
14610+
step failed or was skipped.
14611+
type: boolean
14612+
exitIfSucceed:
14613+
description: Determines whether or not to exit the test if the step succeeds.
14614+
type: boolean
14615+
extractedValuesFromScript:
14616+
description: Generate variables using JavaScript.
14617+
type: string
14618+
id:
14619+
description: ID of the step.
14620+
example: abc-def-123
14621+
readOnly: true
14622+
type: string
14623+
isCritical:
14624+
description: 'Determines whether or not to consider the entire test as failed
14625+
if this step fails.
14626+
14627+
Can be used only if `allowFailure` is `true`.'
14628+
type: boolean
14629+
name:
14630+
description: The name of the step.
14631+
example: Example step name
14632+
type: string
14633+
retry:
14634+
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
14635+
subtestPublicId:
14636+
description: Public ID of the test to be played as part of a `playSubTest`
14637+
step type.
14638+
example: ''
14639+
type: string
14640+
subtype:
14641+
$ref: '#/components/schemas/SyntheticsAPISubtestStepSubtype'
14642+
required:
14643+
- name
14644+
- subtype
14645+
- subtestPublicId
14646+
type: object
14647+
SyntheticsAPISubtestStepSubtype:
14648+
description: The subtype of the Synthetic multi-step API subtest step.
14649+
enum:
14650+
- playSubTest
14651+
example: playSubTest
14652+
type: string
14653+
x-enum-varnames:
14654+
- PLAY_SUB_TEST
1460014655
SyntheticsAPITest:
1460114656
description: Object containing details about a Synthetic API test.
1460214657
properties:

docs/datadog_api_client.v1.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4106,6 +4106,20 @@ datadog\_api\_client.v1.model.synthetics\_api\_step module
41064106
:members:
41074107
:show-inheritance:
41084108

4109+
datadog\_api\_client.v1.model.synthetics\_api\_subtest\_step module
4110+
-------------------------------------------------------------------
4111+
4112+
.. automodule:: datadog_api_client.v1.model.synthetics_api_subtest_step
4113+
:members:
4114+
:show-inheritance:
4115+
4116+
datadog\_api\_client.v1.model.synthetics\_api\_subtest\_step\_subtype module
4117+
----------------------------------------------------------------------------
4118+
4119+
.. automodule:: datadog_api_client.v1.model.synthetics_api_subtest_step_subtype
4120+
:members:
4121+
:show-inheritance:
4122+
41094123
datadog\_api\_client.v1.model.synthetics\_api\_test module
41104124
----------------------------------------------------------
41114125

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
"""
2+
Create a multistep test with subtest returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
8+
from datadog_api_client.v1.model.synthetics_api_subtest_step import SyntheticsAPISubtestStep
9+
from datadog_api_client.v1.model.synthetics_api_subtest_step_subtype import SyntheticsAPISubtestStepSubtype
10+
from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest
11+
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
12+
from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep
13+
from datadog_api_client.v1.model.synthetics_api_test_step_subtype import SyntheticsAPITestStepSubtype
14+
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
15+
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
16+
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
17+
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
18+
from datadog_api_client.v1.model.synthetics_basic_auth_web import SyntheticsBasicAuthWeb
19+
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
20+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
21+
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
22+
23+
# there is a valid "synthetics_api_test" in the system
24+
SYNTHETICS_API_TEST_PUBLIC_ID = environ["SYNTHETICS_API_TEST_PUBLIC_ID"]
25+
26+
body = SyntheticsAPITest(
27+
config=SyntheticsAPITestConfig(
28+
steps=[
29+
SyntheticsAPITestStep(
30+
assertions=[
31+
SyntheticsAssertionTarget(
32+
operator=SyntheticsAssertionOperator.IS,
33+
type=SyntheticsAssertionType.STATUS_CODE,
34+
target=200,
35+
),
36+
],
37+
name="request is sent",
38+
request=SyntheticsTestRequest(
39+
url="https://httpbin.org/status/200",
40+
method="GET",
41+
basic_auth=SyntheticsBasicAuthWeb(
42+
password="password",
43+
username="username",
44+
),
45+
),
46+
subtype=SyntheticsAPITestStepSubtype.HTTP,
47+
),
48+
SyntheticsAPISubtestStep(
49+
subtype=SyntheticsAPISubtestStepSubtype.PLAY_SUB_TEST,
50+
subtest_public_id=SYNTHETICS_API_TEST_PUBLIC_ID,
51+
name="subtest step",
52+
),
53+
],
54+
),
55+
locations=[
56+
"aws:us-east-2",
57+
],
58+
message="BDD test payload: synthetics_api_test_multi_step_with_subtest.json",
59+
name="Example-Synthetic",
60+
options=SyntheticsTestOptions(
61+
tick_every=60,
62+
),
63+
subtype=SyntheticsTestDetailsSubType.MULTI,
64+
type=SyntheticsAPITestType.API,
65+
)
66+
67+
configuration = Configuration()
68+
with ApiClient(configuration) as api_client:
69+
api_instance = SyntheticsApi(api_client)
70+
response = api_instance.create_synthetics_api_test(body=body)
71+
72+
print(response)

src/datadog_api_client/v1/model/synthetics_api_step.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def __init__(self, **kwargs):
5151
5252
:param value: The time to wait in seconds. Minimum value: 0. Maximum value: 180.
5353
:type value: int
54+
55+
:param always_execute: A boolean set to always execute this step even if the previous step failed or was skipped.
56+
:type always_execute: bool, optional
57+
58+
:param subtest_public_id: Public ID of the test to be played as part of a `playSubTest` step type.
59+
:type subtest_public_id: str
5460
"""
5561
super().__init__(kwargs)
5662

@@ -65,10 +71,12 @@ def _composed_schemas(_):
6571
# loading
6672
from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep
6773
from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep
74+
from datadog_api_client.v1.model.synthetics_api_subtest_step import SyntheticsAPISubtestStep
6875

6976
return {
7077
"oneOf": [
7178
SyntheticsAPITestStep,
7279
SyntheticsAPIWaitStep,
80+
SyntheticsAPISubtestStep,
7381
],
7482
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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 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_options_retry import SyntheticsTestOptionsRetry
18+
from datadog_api_client.v1.model.synthetics_api_subtest_step_subtype import SyntheticsAPISubtestStepSubtype
19+
20+
21+
class SyntheticsAPISubtestStep(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
25+
from datadog_api_client.v1.model.synthetics_api_subtest_step_subtype import SyntheticsAPISubtestStepSubtype
26+
27+
return {
28+
"allow_failure": (bool,),
29+
"always_execute": (bool,),
30+
"exit_if_succeed": (bool,),
31+
"extracted_values_from_script": (str,),
32+
"id": (str,),
33+
"is_critical": (bool,),
34+
"name": (str,),
35+
"retry": (SyntheticsTestOptionsRetry,),
36+
"subtest_public_id": (str,),
37+
"subtype": (SyntheticsAPISubtestStepSubtype,),
38+
}
39+
40+
attribute_map = {
41+
"allow_failure": "allowFailure",
42+
"always_execute": "alwaysExecute",
43+
"exit_if_succeed": "exitIfSucceed",
44+
"extracted_values_from_script": "extractedValuesFromScript",
45+
"id": "id",
46+
"is_critical": "isCritical",
47+
"name": "name",
48+
"retry": "retry",
49+
"subtest_public_id": "subtestPublicId",
50+
"subtype": "subtype",
51+
}
52+
read_only_vars = {
53+
"id",
54+
}
55+
56+
def __init__(
57+
self_,
58+
name: str,
59+
subtest_public_id: str,
60+
subtype: SyntheticsAPISubtestStepSubtype,
61+
allow_failure: Union[bool, UnsetType] = unset,
62+
always_execute: Union[bool, UnsetType] = unset,
63+
exit_if_succeed: Union[bool, UnsetType] = unset,
64+
extracted_values_from_script: Union[str, UnsetType] = unset,
65+
id: Union[str, UnsetType] = unset,
66+
is_critical: Union[bool, UnsetType] = unset,
67+
retry: Union[SyntheticsTestOptionsRetry, UnsetType] = unset,
68+
**kwargs,
69+
):
70+
"""
71+
The subtest step used in a Synthetics multi-step API test.
72+
73+
:param allow_failure: Determines whether or not to continue with test if this step fails.
74+
:type allow_failure: bool, optional
75+
76+
:param always_execute: A boolean set to always execute this step even if the previous step failed or was skipped.
77+
:type always_execute: bool, optional
78+
79+
:param exit_if_succeed: Determines whether or not to exit the test if the step succeeds.
80+
:type exit_if_succeed: bool, optional
81+
82+
:param extracted_values_from_script: Generate variables using JavaScript.
83+
:type extracted_values_from_script: str, optional
84+
85+
:param id: ID of the step.
86+
:type id: str, optional
87+
88+
:param is_critical: Determines whether or not to consider the entire test as failed if this step fails.
89+
Can be used only if ``allowFailure`` is ``true``.
90+
:type is_critical: bool, optional
91+
92+
:param name: The name of the step.
93+
:type name: str
94+
95+
:param retry: Object describing the retry strategy to apply to a Synthetic test.
96+
:type retry: SyntheticsTestOptionsRetry, optional
97+
98+
:param subtest_public_id: Public ID of the test to be played as part of a ``playSubTest`` step type.
99+
:type subtest_public_id: str
100+
101+
:param subtype: The subtype of the Synthetic multi-step API subtest step.
102+
:type subtype: SyntheticsAPISubtestStepSubtype
103+
"""
104+
if allow_failure is not unset:
105+
kwargs["allow_failure"] = allow_failure
106+
if always_execute is not unset:
107+
kwargs["always_execute"] = always_execute
108+
if exit_if_succeed is not unset:
109+
kwargs["exit_if_succeed"] = exit_if_succeed
110+
if extracted_values_from_script is not unset:
111+
kwargs["extracted_values_from_script"] = extracted_values_from_script
112+
if id is not unset:
113+
kwargs["id"] = id
114+
if is_critical is not unset:
115+
kwargs["is_critical"] = is_critical
116+
if retry is not unset:
117+
kwargs["retry"] = retry
118+
super().__init__(kwargs)
119+
120+
self_.name = name
121+
self_.subtest_public_id = subtest_public_id
122+
self_.subtype = subtype
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class SyntheticsAPISubtestStepSubtype(ModelSimple):
16+
"""
17+
The subtype of the Synthetic multi-step API subtest step.
18+
19+
:param value: If omitted defaults to "playSubTest". Must be one of ["playSubTest"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"playSubTest",
25+
}
26+
PLAY_SUB_TEST: ClassVar["SyntheticsAPISubtestStepSubtype"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
SyntheticsAPISubtestStepSubtype.PLAY_SUB_TEST = SyntheticsAPISubtestStepSubtype("playSubTest")

src/datadog_api_client/v1/model/synthetics_api_test_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from datadog_api_client.v1.model.synthetics_assertion_javascript import SyntheticsAssertionJavascript
2727
from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep
2828
from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep
29+
from datadog_api_client.v1.model.synthetics_api_subtest_step import SyntheticsAPISubtestStep
2930

3031

3132
class SyntheticsAPITestConfig(ModelNormal):
@@ -70,7 +71,10 @@ def __init__(
7071
] = unset,
7172
config_variables: Union[List[SyntheticsConfigVariable], UnsetType] = unset,
7273
request: Union[SyntheticsTestRequest, UnsetType] = unset,
73-
steps: Union[List[Union[SyntheticsAPIStep, SyntheticsAPITestStep, SyntheticsAPIWaitStep]], UnsetType] = unset,
74+
steps: Union[
75+
List[Union[SyntheticsAPIStep, SyntheticsAPITestStep, SyntheticsAPIWaitStep, SyntheticsAPISubtestStep]],
76+
UnsetType,
77+
] = unset,
7478
variables_from_script: Union[str, UnsetType] = unset,
7579
**kwargs,
7680
):

src/datadog_api_client/v1/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,8 @@
666666
from datadog_api_client.v1.model.sunburst_widget_legend_table_type import SunburstWidgetLegendTableType
667667
from datadog_api_client.v1.model.sunburst_widget_request import SunburstWidgetRequest
668668
from datadog_api_client.v1.model.synthetics_api_step import SyntheticsAPIStep
669+
from datadog_api_client.v1.model.synthetics_api_subtest_step import SyntheticsAPISubtestStep
670+
from datadog_api_client.v1.model.synthetics_api_subtest_step_subtype import SyntheticsAPISubtestStepSubtype
669671
from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest
670672
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
671673
from datadog_api_client.v1.model.synthetics_api_test_result_data import SyntheticsAPITestResultData
@@ -1709,6 +1711,8 @@
17091711
"SunburstWidgetLegendTableType",
17101712
"SunburstWidgetRequest",
17111713
"SyntheticsAPIStep",
1714+
"SyntheticsAPISubtestStep",
1715+
"SyntheticsAPISubtestStepSubtype",
17121716
"SyntheticsAPITest",
17131717
"SyntheticsAPITestConfig",
17141718
"SyntheticsAPITestResultData",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-12-26T15:22:45.114Z

0 commit comments

Comments
 (0)