Skip to content

Commit 8e8c61a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Split the synthetics request port field into a oneOf (#2157)
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 436b666 commit 8e8c61a

File tree

29 files changed

+148
-89
lines changed

29 files changed

+148
-89
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-09-10 08:48:30.716171",
8-
"spec_repo_commit": "b32bee1b"
7+
"regenerated": "2024-09-11 19:15:20.742421",
8+
"spec_repo_commit": "3288a6f0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-10 08:48:30.742094",
13-
"spec_repo_commit": "b32bee1b"
12+
"regenerated": "2024-09-11 19:15:20.759805",
13+
"spec_repo_commit": "3288a6f0"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16352,8 +16352,7 @@ components:
1635216352
description: Persist cookies across redirects.
1635316353
type: boolean
1635416354
port:
16355-
description: Port to use when performing the test.
16356-
type: string
16355+
$ref: '#/components/schemas/SyntheticsTestRequestPort'
1635716356
proxy:
1635816357
$ref: '#/components/schemas/SyntheticsTestRequestProxy'
1635916358
query:
@@ -16457,6 +16456,15 @@ components:
1645716456
description: Date of update of the certificate or key, ISO format.
1645816457
type: string
1645916458
type: object
16459+
SyntheticsTestRequestNumericalPort:
16460+
description: Integer Port number to use when performing the test.
16461+
format: int64
16462+
type: integer
16463+
SyntheticsTestRequestPort:
16464+
description: Port to use when performing the test.
16465+
oneOf:
16466+
- $ref: '#/components/schemas/SyntheticsTestRequestNumericalPort'
16467+
- $ref: '#/components/schemas/SyntheticsTestRequestVariablePort'
1646016468
SyntheticsTestRequestProxy:
1646116469
description: The proxy to perform the test.
1646216470
properties:
@@ -16469,6 +16477,10 @@ components:
1646916477
required:
1647016478
- url
1647116479
type: object
16480+
SyntheticsTestRequestVariablePort:
16481+
description: String Port number to use when performing the test. Supports templated
16482+
variables.
16483+
type: string
1647216484
SyntheticsTiming:
1647316485
description: 'Object containing all metrics and their values collected for a
1647416486
Synthetic API test.

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4771,6 +4771,13 @@ datadog\_api\_client.v1.model.synthetics\_test\_request\_certificate\_item modul
47714771
:members:
47724772
:show-inheritance:
47734773

4774+
datadog\_api\_client.v1.model.synthetics\_test\_request\_port module
4775+
--------------------------------------------------------------------
4776+
4777+
.. automodule:: datadog_api_client.v1.model.synthetics_test_request_port
4778+
:members:
4779+
:show-inheritance:
4780+
47744781
datadog\_api\_client.v1.model.synthetics\_test\_request\_proxy module
47754782
---------------------------------------------------------------------
47764783

examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
request=SyntheticsTestRequest(
2727
host="datadoghq.com",
28-
port="443",
28+
port="{{ DATADOG_PORT }}",
2929
),
3030
),
3131
locations=[

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
],
100100
request=SyntheticsTestRequest(
101101
host="grpcbin.test.k6.io",
102-
port="9000",
102+
port=9000,
103103
service="grpcbin.GRPCBin",
104104
method="Index",
105105
message="{}",

examples/v1/synthetics/CreateSyntheticsAPITest_1402674167.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
],
3939
request=SyntheticsTestRequest(
4040
host="localhost",
41-
port="50051",
41+
port=50051,
4242
service="Hello",
4343
method="GET",
4444
message="",

examples/v1/synthetics/CreateSyntheticsAPITest_3829801148.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
request=SyntheticsTestRequest(
3434
host="https://datadoghq.com",
3535
message="message",
36-
port="443",
36+
port=443,
3737
),
3838
),
3939
locations=[

src/datadog_api_client/v1/model/synthetics_test_request.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
2323
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
2424
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
25+
from datadog_api_client.v1.model.synthetics_test_request_port import SyntheticsTestRequestPort
2526
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
2627
from datadog_api_client.v1.model.synthetics_basic_auth_web import SyntheticsBasicAuthWeb
2728
from datadog_api_client.v1.model.synthetics_basic_auth_sigv4 import SyntheticsBasicAuthSigv4
@@ -49,6 +50,7 @@ def openapi_types(_):
4950
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
5051
from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion
5152
from datadog_api_client.v1.model.synthetics_test_metadata import SyntheticsTestMetadata
53+
from datadog_api_client.v1.model.synthetics_test_request_port import SyntheticsTestRequestPort
5254
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
5355

5456
return {
@@ -74,7 +76,7 @@ def openapi_types(_):
7476
"no_saving_response_body": (bool,),
7577
"number_of_packets": (int,),
7678
"persist_cookies": (bool,),
77-
"port": (str,),
79+
"port": (SyntheticsTestRequestPort,),
7880
"proxy": (SyntheticsTestRequestProxy,),
7981
"query": (dict,),
8082
"servername": (str,),
@@ -150,7 +152,7 @@ def __init__(
150152
no_saving_response_body: Union[bool, UnsetType] = unset,
151153
number_of_packets: Union[int, UnsetType] = unset,
152154
persist_cookies: Union[bool, UnsetType] = unset,
153-
port: Union[str, UnsetType] = unset,
155+
port: Union[SyntheticsTestRequestPort, int, str, UnsetType] = unset,
154156
proxy: Union[SyntheticsTestRequestProxy, UnsetType] = unset,
155157
query: Union[dict, UnsetType] = unset,
156158
servername: Union[str, UnsetType] = unset,
@@ -230,7 +232,7 @@ def __init__(
230232
:type persist_cookies: bool, optional
231233
232234
:param port: Port to use when performing the test.
233-
:type port: str, optional
235+
:type port: SyntheticsTestRequestPort, optional
234236
235237
:param proxy: The proxy to perform the test.
236238
:type proxy: SyntheticsTestRequestProxy, optional
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 SyntheticsTestRequestPort(ModelComposed):
14+
def __init__(self, **kwargs):
15+
"""
16+
Port to use when performing the test.
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+
int,
32+
str,
33+
],
34+
}

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@
784784
from datadog_api_client.v1.model.synthetics_test_request_body_type import SyntheticsTestRequestBodyType
785785
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
786786
from datadog_api_client.v1.model.synthetics_test_request_certificate_item import SyntheticsTestRequestCertificateItem
787+
from datadog_api_client.v1.model.synthetics_test_request_port import SyntheticsTestRequestPort
787788
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
788789
from datadog_api_client.v1.model.synthetics_timing import SyntheticsTiming
789790
from datadog_api_client.v1.model.synthetics_trigger_body import SyntheticsTriggerBody
@@ -1676,6 +1677,7 @@
16761677
"SyntheticsTestRequestBodyType",
16771678
"SyntheticsTestRequestCertificate",
16781679
"SyntheticsTestRequestCertificateItem",
1680+
"SyntheticsTestRequestPort",
16791681
"SyntheticsTestRequestProxy",
16801682
"SyntheticsTiming",
16811683
"SyntheticsTriggerBody",

0 commit comments

Comments
 (0)