Skip to content

Commit 0039d51

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make value be oneOf number or string (#2229)
* Regenerate client from commit e9cc5e6a of spec repo * pre-commit fixes --------- Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 54a0e47 commit 0039d51

8 files changed

+102
-46
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-10-31 14:20:03.543613",
8-
"spec_repo_commit": "47da2e01"
7+
"regenerated": "2024-10-31 14:51:16.444741",
8+
"spec_repo_commit": "e9cc5e6a"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-31 14:20:03.561286",
13-
"spec_repo_commit": "47da2e01"
12+
"regenerated": "2024-10-31 14:51:16.462544",
13+
"spec_repo_commit": "e9cc5e6a"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15530,7 +15530,7 @@ components:
1553015530
$ref: '#/components/schemas/SyntheticsMobileStepParamsDirection'
1553115531
element:
1553215532
$ref: '#/components/schemas/SyntheticsMobileStepParamsElement'
15533-
enable:
15533+
enabled:
1553415534
description: Boolean to change the state of the wifi for a `toggleWiFi`
1553515535
step type.
1553615536
type: boolean
@@ -15546,8 +15546,7 @@ components:
1554615546
step type.
1554715547
type: string
1554815548
value:
15549-
description: Values used in the step. Used in multiple step types.
15550-
type: string
15549+
$ref: '#/components/schemas/SyntheticsMobileStepParamsValue'
1555115550
variable:
1555215551
$ref: '#/components/schemas/SyntheticsMobileStepParamsVariable'
1555315552
withEnter:
@@ -15556,12 +15555,12 @@ components:
1555615555
type: boolean
1555715556
x:
1555815557
description: Amount to scroll by on the `x` axis for a `scroll` step type.
15559-
format: int64
15560-
type: integer
15558+
format: double
15559+
type: number
1556115560
y:
1556215561
description: Amount to scroll by on the `y` axis for a `scroll` step type.
15563-
format: int64
15564-
type: integer
15562+
format: double
15563+
type: number
1556515564
type: object
1556615565
SyntheticsMobileStepParamsDirection:
1556715566
description: The direction of the scroll for a `scrollToElement` step type.
@@ -15615,12 +15614,12 @@ components:
1561515614
properties:
1561615615
x:
1561715616
description: The `relativePosition` on the `x` axis for the element.
15618-
format: int64
15619-
type: integer
15617+
format: double
15618+
type: number
1562015619
y:
1562115620
description: The `relativePosition` on the `y` axis for the element.
15622-
format: int64
15623-
type: integer
15621+
format: double
15622+
type: number
1562415623
type: object
1562515624
SyntheticsMobileStepParamsElementUserLocator:
1562615625
description: User locator to find the element.
@@ -15670,13 +15669,25 @@ components:
1567015669
properties:
1567115670
x:
1567215671
description: The `x` position for the flick.
15673-
format: int64
15674-
type: integer
15672+
format: double
15673+
type: number
1567515674
y:
1567615675
description: The `y` position for the flick.
15677-
format: int64
15678-
type: integer
15676+
format: double
15677+
type: number
1567915678
type: object
15679+
SyntheticsMobileStepParamsValue:
15680+
description: Values used in the step for in multiple step types.
15681+
oneOf:
15682+
- $ref: '#/components/schemas/SyntheticsMobileStepParamsValueString'
15683+
- $ref: '#/components/schemas/SyntheticsMobileStepParamsValueNumber'
15684+
SyntheticsMobileStepParamsValueNumber:
15685+
description: Value used in the step for in multiple step types.
15686+
format: int64
15687+
type: integer
15688+
SyntheticsMobileStepParamsValueString:
15689+
description: Value used in the step for in multiple step types.
15690+
type: string
1568015691
SyntheticsMobileStepParamsVariable:
1568115692
description: Variable object for `extractVariable` step type.
1568215693
properties:

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,6 +4547,13 @@ datadog\_api\_client.v1.model.synthetics\_mobile\_step\_params\_positions\_items
45474547
:members:
45484548
:show-inheritance:
45494549

4550+
datadog\_api\_client.v1.model.synthetics\_mobile\_step\_params\_value module
4551+
----------------------------------------------------------------------------
4552+
4553+
.. automodule:: datadog_api_client.v1.model.synthetics_mobile_step_params_value
4554+
:members:
4555+
:show-inheritance:
4556+
45504557
datadog\_api\_client.v1.model.synthetics\_mobile\_step\_params\_variable module
45514558
-------------------------------------------------------------------------------
45524559

src/datadog_api_client/v1/model/synthetics_mobile_step_params.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from datadog_api_client.v1.model.synthetics_mobile_step_params_positions_items import (
2121
SyntheticsMobileStepParamsPositionsItems,
2222
)
23+
from datadog_api_client.v1.model.synthetics_mobile_step_params_value import SyntheticsMobileStepParamsValue
2324
from datadog_api_client.v1.model.synthetics_mobile_step_params_variable import SyntheticsMobileStepParamsVariable
2425

2526

@@ -41,6 +42,7 @@ def openapi_types(_):
4142
from datadog_api_client.v1.model.synthetics_mobile_step_params_positions_items import (
4243
SyntheticsMobileStepParamsPositionsItems,
4344
)
45+
from datadog_api_client.v1.model.synthetics_mobile_step_params_value import SyntheticsMobileStepParamsValue
4446
from datadog_api_client.v1.model.synthetics_mobile_step_params_variable import (
4547
SyntheticsMobileStepParamsVariable,
4648
)
@@ -50,23 +52,23 @@ def openapi_types(_):
5052
"delay": (int,),
5153
"direction": (SyntheticsMobileStepParamsDirection,),
5254
"element": (SyntheticsMobileStepParamsElement,),
53-
"enable": (bool,),
55+
"enabled": (bool,),
5456
"max_scrolls": (int,),
5557
"positions": ([SyntheticsMobileStepParamsPositionsItems],),
5658
"subtest_public_id": (str,),
57-
"value": (str,),
59+
"value": (SyntheticsMobileStepParamsValue,),
5860
"variable": (SyntheticsMobileStepParamsVariable,),
5961
"with_enter": (bool,),
60-
"x": (int,),
61-
"y": (int,),
62+
"x": (float,),
63+
"y": (float,),
6264
}
6365

6466
attribute_map = {
6567
"check": "check",
6668
"delay": "delay",
6769
"direction": "direction",
6870
"element": "element",
69-
"enable": "enable",
71+
"enabled": "enabled",
7072
"max_scrolls": "maxScrolls",
7173
"positions": "positions",
7274
"subtest_public_id": "subtestPublicId",
@@ -83,15 +85,15 @@ def __init__(
8385
delay: Union[int, UnsetType] = unset,
8486
direction: Union[SyntheticsMobileStepParamsDirection, UnsetType] = unset,
8587
element: Union[SyntheticsMobileStepParamsElement, UnsetType] = unset,
86-
enable: Union[bool, UnsetType] = unset,
88+
enabled: Union[bool, UnsetType] = unset,
8789
max_scrolls: Union[int, UnsetType] = unset,
8890
positions: Union[List[SyntheticsMobileStepParamsPositionsItems], UnsetType] = unset,
8991
subtest_public_id: Union[str, UnsetType] = unset,
90-
value: Union[str, UnsetType] = unset,
92+
value: Union[SyntheticsMobileStepParamsValue, str, int, UnsetType] = unset,
9193
variable: Union[SyntheticsMobileStepParamsVariable, UnsetType] = unset,
9294
with_enter: Union[bool, UnsetType] = unset,
93-
x: Union[int, UnsetType] = unset,
94-
y: Union[int, UnsetType] = unset,
95+
x: Union[float, UnsetType] = unset,
96+
y: Union[float, UnsetType] = unset,
9597
**kwargs,
9698
):
9799
"""
@@ -109,8 +111,8 @@ def __init__(
109111
:param element: Information about the element used for a step.
110112
:type element: SyntheticsMobileStepParamsElement, optional
111113
112-
:param enable: Boolean to change the state of the wifi for a ``toggleWiFi`` step type.
113-
:type enable: bool, optional
114+
:param enabled: Boolean to change the state of the wifi for a ``toggleWiFi`` step type.
115+
:type enabled: bool, optional
114116
115117
:param max_scrolls: Maximum number of scrolls to do for a ``scrollToElement`` step type.
116118
:type max_scrolls: int, optional
@@ -121,8 +123,8 @@ def __init__(
121123
:param subtest_public_id: Public ID of the test to be played as part of a ``playSubTest`` step type.
122124
:type subtest_public_id: str, optional
123125
124-
:param value: Values used in the step. Used in multiple step types.
125-
:type value: str, optional
126+
:param value: Values used in the step for in multiple step types.
127+
:type value: SyntheticsMobileStepParamsValue, optional
126128
127129
:param variable: Variable object for ``extractVariable`` step type.
128130
:type variable: SyntheticsMobileStepParamsVariable, optional
@@ -131,10 +133,10 @@ def __init__(
131133
:type with_enter: bool, optional
132134
133135
:param x: Amount to scroll by on the ``x`` axis for a ``scroll`` step type.
134-
:type x: int, optional
136+
:type x: float, optional
135137
136138
:param y: Amount to scroll by on the ``y`` axis for a ``scroll`` step type.
137-
:type y: int, optional
139+
:type y: float, optional
138140
"""
139141
if check is not unset:
140142
kwargs["check"] = check
@@ -144,8 +146,8 @@ def __init__(
144146
kwargs["direction"] = direction
145147
if element is not unset:
146148
kwargs["element"] = element
147-
if enable is not unset:
148-
kwargs["enable"] = enable
149+
if enabled is not unset:
150+
kwargs["enabled"] = enabled
149151
if max_scrolls is not unset:
150152
kwargs["max_scrolls"] = max_scrolls
151153
if positions is not unset:

src/datadog_api_client/v1/model/synthetics_mobile_step_params_element_relative_position.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ class SyntheticsMobileStepParamsElementRelativePosition(ModelNormal):
1717
@cached_property
1818
def openapi_types(_):
1919
return {
20-
"x": (int,),
21-
"y": (int,),
20+
"x": (float,),
21+
"y": (float,),
2222
}
2323

2424
attribute_map = {
2525
"x": "x",
2626
"y": "y",
2727
}
2828

29-
def __init__(self_, x: Union[int, UnsetType] = unset, y: Union[int, UnsetType] = unset, **kwargs):
29+
def __init__(self_, x: Union[float, UnsetType] = unset, y: Union[float, UnsetType] = unset, **kwargs):
3030
"""
3131
Position of the action relative to the element.
3232
3333
:param x: The ``relativePosition`` on the ``x`` axis for the element.
34-
:type x: int, optional
34+
:type x: float, optional
3535
3636
:param y: The ``relativePosition`` on the ``y`` axis for the element.
37-
:type y: int, optional
37+
:type y: float, optional
3838
"""
3939
if x is not unset:
4040
kwargs["x"] = x

src/datadog_api_client/v1/model/synthetics_mobile_step_params_positions_items.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ class SyntheticsMobileStepParamsPositionsItems(ModelNormal):
1717
@cached_property
1818
def openapi_types(_):
1919
return {
20-
"x": (int,),
21-
"y": (int,),
20+
"x": (float,),
21+
"y": (float,),
2222
}
2323

2424
attribute_map = {
2525
"x": "x",
2626
"y": "y",
2727
}
2828

29-
def __init__(self_, x: Union[int, UnsetType] = unset, y: Union[int, UnsetType] = unset, **kwargs):
29+
def __init__(self_, x: Union[float, UnsetType] = unset, y: Union[float, UnsetType] = unset, **kwargs):
3030
"""
3131
A description of a single position for a ``flick`` step type.
3232
3333
:param x: The ``x`` position for the flick.
34-
:type x: int, optional
34+
:type x: float, optional
3535
3636
:param y: The ``y`` position for the flick.
37-
:type y: int, optional
37+
:type y: float, optional
3838
"""
3939
if x is not unset:
4040
kwargs["x"] = x
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
ModelComposed,
9+
cached_property,
10+
)
11+
12+
13+
class SyntheticsMobileStepParamsValue(ModelComposed):
14+
def __init__(self, **kwargs):
15+
"""
16+
Values used in the step for in multiple step types.
17+
"""
18+
super().__init__(kwargs)
19+
20+
@cached_property
21+
def _composed_schemas(_):
22+
# we need this here to make our import statements work
23+
# we must store _composed_schemas in here so the code is only run
24+
# when we invoke this method. If we kept this at the class
25+
# level we would get an error because the class level
26+
# code would be run when this module is imported, and these composed
27+
# classes don't exist yet because their module has not finished
28+
# loading
29+
return {
30+
"oneOf": [
31+
str,
32+
int,
33+
],
34+
}

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@
753753
from datadog_api_client.v1.model.synthetics_mobile_step_params_positions_items import (
754754
SyntheticsMobileStepParamsPositionsItems,
755755
)
756+
from datadog_api_client.v1.model.synthetics_mobile_step_params_value import SyntheticsMobileStepParamsValue
756757
from datadog_api_client.v1.model.synthetics_mobile_step_params_variable import SyntheticsMobileStepParamsVariable
757758
from datadog_api_client.v1.model.synthetics_mobile_step_type import SyntheticsMobileStepType
758759
from datadog_api_client.v1.model.synthetics_mobile_test import SyntheticsMobileTest
@@ -1704,6 +1705,7 @@
17041705
"SyntheticsMobileStepParamsElementUserLocatorValuesItems",
17051706
"SyntheticsMobileStepParamsElementUserLocatorValuesItemsType",
17061707
"SyntheticsMobileStepParamsPositionsItems",
1708+
"SyntheticsMobileStepParamsValue",
17071709
"SyntheticsMobileStepParamsVariable",
17081710
"SyntheticsMobileStepType",
17091711
"SyntheticsMobileTest",

0 commit comments

Comments
 (0)