Skip to content

Commit f3d7186

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix VFTs and extracted local variables enum types (#2078)
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 9221073 commit f3d7186

9 files changed

+109
-26
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-08-29 20:02:03.124770",
8-
"spec_repo_commit": "518ca9df"
7+
"regenerated": "2024-09-03 13:58:40.388311",
8+
"spec_repo_commit": "ff772101"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-29 20:02:03.141872",
13-
"spec_repo_commit": "518ca9df"
12+
"regenerated": "2024-09-03 13:58:40.405077",
13+
"spec_repo_commit": "ff772101"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15267,17 +15267,18 @@ components:
1526715267
- type
1526815268
type: object
1526915269
SyntheticsGlobalVariableParseTestOptionsType:
15270-
description: Property of the Synthetic Test Response to use for a Synthetic
15271-
global variable.
15270+
description: Type of value to extract from a test for a Synthetic global variable.
1527215271
enum:
1527315272
- http_body
1527415273
- http_header
15274+
- http_status_code
1527515275
- local_variable
1527615276
example: http_body
1527715277
type: string
1527815278
x-enum-varnames:
1527915279
- HTTP_BODY
1528015280
- HTTP_HEADER
15281+
- HTTP_STATUS_CODE
1528115282
- LOCAL_VARIABLE
1528215283
SyntheticsGlobalVariableParserType:
1528315284
description: Type of parser for a Synthetic global variable from a synthetics
@@ -15396,6 +15397,23 @@ components:
1539615397
$ref: '#/components/schemas/SyntheticsTestDetails'
1539715398
type: array
1539815399
type: object
15400+
SyntheticsLocalVariableParsingOptionsType:
15401+
description: Property of the Synthetic Test Response to extract into a local
15402+
variable.
15403+
enum:
15404+
- grpc_message
15405+
- grpc_metadata
15406+
- http_body
15407+
- http_header
15408+
- http_status_code
15409+
example: http_body
15410+
type: string
15411+
x-enum-varnames:
15412+
- GRPC_MESSAGE
15413+
- GRPC_METADATA
15414+
- HTTP_BODY
15415+
- HTTP_HEADER
15416+
- HTTP_STATUS_CODE
1539915417
SyntheticsLocation:
1540015418
description: 'Synthetic location that can be used when creating or editing a
1540115419

@@ -15422,8 +15440,8 @@ components:
1542215440
example: {}
1542315441
properties:
1542415442
field:
15425-
description: When type is `http_header`, name of the header to use to extract
15426-
the value.
15443+
description: When type is `http_header` or `grpc_metadata`, name of the
15444+
header or metadatum to extract.
1542715445
example: content-type
1542815446
type: string
1542915447
name:
@@ -15435,7 +15453,7 @@ components:
1543515453
description: Determines whether or not the extracted value will be obfuscated.
1543615454
type: boolean
1543715455
type:
15438-
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType'
15456+
$ref: '#/components/schemas/SyntheticsLocalVariableParsingOptionsType'
1543915457
type: object
1544015458
SyntheticsPatchTestBody:
1544115459
description: Wrapper around an array of [JSON Patch](https://jsonpatch.com)
@@ -16010,7 +16028,7 @@ components:
1601016028
type: object
1601116029
SyntheticsTestMetadata:
1601216030
additionalProperties:
16013-
description: A single Metadatum.
16031+
description: A single metadatum.
1601416032
type: string
1601516033
description: Metadata to include when performing the gRPC test.
1601616034
type: object

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4435,6 +4435,13 @@ datadog\_api\_client.v1.model.synthetics\_list\_tests\_response module
44354435
:members:
44364436
:show-inheritance:
44374437

4438+
datadog\_api\_client.v1.model.synthetics\_local\_variable\_parsing\_options\_type module
4439+
----------------------------------------------------------------------------------------
4440+
4441+
.. automodule:: datadog_api_client.v1.model.synthetics_local_variable_parsing_options_type
4442+
:members:
4443+
:show-inheritance:
4444+
44384445
datadog\_api\_client.v1.model.synthetics\_location module
44394446
---------------------------------------------------------
44404447

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
1717
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
1818
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
19-
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options_type import (
20-
SyntheticsGlobalVariableParseTestOptionsType,
21-
)
2219
from datadog_api_client.v1.model.synthetics_global_variable_parser_type import SyntheticsGlobalVariableParserType
20+
from datadog_api_client.v1.model.synthetics_local_variable_parsing_options_type import (
21+
SyntheticsLocalVariableParsingOptionsType,
22+
)
2323
from datadog_api_client.v1.model.synthetics_parsing_options import SyntheticsParsingOptions
2424
from datadog_api_client.v1.model.synthetics_test_call_type import SyntheticsTestCallType
2525
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
@@ -57,7 +57,7 @@
5757
parser=SyntheticsVariableParser(
5858
type=SyntheticsGlobalVariableParserType.RAW,
5959
),
60-
type=SyntheticsGlobalVariableParseTestOptionsType.HTTP_HEADER,
60+
type=SyntheticsLocalVariableParsingOptionsType.HTTP_HEADER,
6161
secure=True,
6262
),
6363
],

src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
:param parser: Details of the parser to use for the global variable.
6363
:type parser: SyntheticsVariableParser, optional
6464
65-
:param type: Property of the Synthetic Test Response to use for a Synthetic global variable.
65+
:param type: Type of value to extract from a test for a Synthetic global variable.
6666
:type type: SyntheticsGlobalVariableParseTestOptionsType
6767
"""
6868
if field is not unset:

src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options_type.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@
1414

1515
class SyntheticsGlobalVariableParseTestOptionsType(ModelSimple):
1616
"""
17-
Property of the Synthetic Test Response to use for a Synthetic global variable.
17+
Type of value to extract from a test for a Synthetic global variable.
1818
19-
:param value: Must be one of ["http_body", "http_header", "local_variable"].
19+
:param value: Must be one of ["http_body", "http_header", "http_status_code", "local_variable"].
2020
:type value: str
2121
"""
2222

2323
allowed_values = {
2424
"http_body",
2525
"http_header",
26+
"http_status_code",
2627
"local_variable",
2728
}
2829
HTTP_BODY: ClassVar["SyntheticsGlobalVariableParseTestOptionsType"]
2930
HTTP_HEADER: ClassVar["SyntheticsGlobalVariableParseTestOptionsType"]
31+
HTTP_STATUS_CODE: ClassVar["SyntheticsGlobalVariableParseTestOptionsType"]
3032
LOCAL_VARIABLE: ClassVar["SyntheticsGlobalVariableParseTestOptionsType"]
3133

3234
@cached_property
@@ -38,6 +40,9 @@ def openapi_types(_):
3840

3941
SyntheticsGlobalVariableParseTestOptionsType.HTTP_BODY = SyntheticsGlobalVariableParseTestOptionsType("http_body")
4042
SyntheticsGlobalVariableParseTestOptionsType.HTTP_HEADER = SyntheticsGlobalVariableParseTestOptionsType("http_header")
43+
SyntheticsGlobalVariableParseTestOptionsType.HTTP_STATUS_CODE = SyntheticsGlobalVariableParseTestOptionsType(
44+
"http_status_code"
45+
)
4146
SyntheticsGlobalVariableParseTestOptionsType.LOCAL_VARIABLE = SyntheticsGlobalVariableParseTestOptionsType(
4247
"local_variable"
4348
)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 SyntheticsLocalVariableParsingOptionsType(ModelSimple):
16+
"""
17+
Property of the Synthetic Test Response to extract into a local variable.
18+
19+
:param value: Must be one of ["grpc_message", "grpc_metadata", "http_body", "http_header", "http_status_code"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"grpc_message",
25+
"grpc_metadata",
26+
"http_body",
27+
"http_header",
28+
"http_status_code",
29+
}
30+
GRPC_MESSAGE: ClassVar["SyntheticsLocalVariableParsingOptionsType"]
31+
GRPC_METADATA: ClassVar["SyntheticsLocalVariableParsingOptionsType"]
32+
HTTP_BODY: ClassVar["SyntheticsLocalVariableParsingOptionsType"]
33+
HTTP_HEADER: ClassVar["SyntheticsLocalVariableParsingOptionsType"]
34+
HTTP_STATUS_CODE: ClassVar["SyntheticsLocalVariableParsingOptionsType"]
35+
36+
@cached_property
37+
def openapi_types(_):
38+
return {
39+
"value": (str,),
40+
}
41+
42+
43+
SyntheticsLocalVariableParsingOptionsType.GRPC_MESSAGE = SyntheticsLocalVariableParsingOptionsType("grpc_message")
44+
SyntheticsLocalVariableParsingOptionsType.GRPC_METADATA = SyntheticsLocalVariableParsingOptionsType("grpc_metadata")
45+
SyntheticsLocalVariableParsingOptionsType.HTTP_BODY = SyntheticsLocalVariableParsingOptionsType("http_body")
46+
SyntheticsLocalVariableParsingOptionsType.HTTP_HEADER = SyntheticsLocalVariableParsingOptionsType("http_header")
47+
SyntheticsLocalVariableParsingOptionsType.HTTP_STATUS_CODE = SyntheticsLocalVariableParsingOptionsType(
48+
"http_status_code"
49+
)

src/datadog_api_client/v1/model/synthetics_parsing_options.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515

1616
if TYPE_CHECKING:
1717
from datadog_api_client.v1.model.synthetics_variable_parser import SyntheticsVariableParser
18-
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options_type import (
19-
SyntheticsGlobalVariableParseTestOptionsType,
18+
from datadog_api_client.v1.model.synthetics_local_variable_parsing_options_type import (
19+
SyntheticsLocalVariableParsingOptionsType,
2020
)
2121

2222

2323
class SyntheticsParsingOptions(ModelNormal):
2424
@cached_property
2525
def openapi_types(_):
2626
from datadog_api_client.v1.model.synthetics_variable_parser import SyntheticsVariableParser
27-
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options_type import (
28-
SyntheticsGlobalVariableParseTestOptionsType,
27+
from datadog_api_client.v1.model.synthetics_local_variable_parsing_options_type import (
28+
SyntheticsLocalVariableParsingOptionsType,
2929
)
3030

3131
return {
3232
"field": (str,),
3333
"name": (str,),
3434
"parser": (SyntheticsVariableParser,),
3535
"secure": (bool,),
36-
"type": (SyntheticsGlobalVariableParseTestOptionsType,),
36+
"type": (SyntheticsLocalVariableParsingOptionsType,),
3737
}
3838

3939
attribute_map = {
@@ -50,13 +50,13 @@ def __init__(
5050
name: Union[str, UnsetType] = unset,
5151
parser: Union[SyntheticsVariableParser, UnsetType] = unset,
5252
secure: Union[bool, UnsetType] = unset,
53-
type: Union[SyntheticsGlobalVariableParseTestOptionsType, UnsetType] = unset,
53+
type: Union[SyntheticsLocalVariableParsingOptionsType, UnsetType] = unset,
5454
**kwargs,
5555
):
5656
"""
5757
Parsing options for variables to extract.
5858
59-
:param field: When type is ``http_header`` , name of the header to use to extract the value.
59+
:param field: When type is ``http_header`` or ``grpc_metadata`` , name of the header or metadatum to extract.
6060
:type field: str, optional
6161
6262
:param name: Name of the variable to extract.
@@ -68,8 +68,8 @@ def __init__(
6868
:param secure: Determines whether or not the extracted value will be obfuscated.
6969
:type secure: bool, optional
7070
71-
:param type: Property of the Synthetic Test Response to use for a Synthetic global variable.
72-
:type type: SyntheticsGlobalVariableParseTestOptionsType, optional
71+
:param type: Property of the Synthetic Test Response to extract into a local variable.
72+
:type type: SyntheticsLocalVariableParsingOptionsType, optional
7373
"""
7474
if field is not unset:
7575
kwargs["field"] = field

src/datadog_api_client/v1/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@
723723
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue
724724
from datadog_api_client.v1.model.synthetics_list_global_variables_response import SyntheticsListGlobalVariablesResponse
725725
from datadog_api_client.v1.model.synthetics_list_tests_response import SyntheticsListTestsResponse
726+
from datadog_api_client.v1.model.synthetics_local_variable_parsing_options_type import (
727+
SyntheticsLocalVariableParsingOptionsType,
728+
)
726729
from datadog_api_client.v1.model.synthetics_location import SyntheticsLocation
727730
from datadog_api_client.v1.model.synthetics_locations import SyntheticsLocations
728731
from datadog_api_client.v1.model.synthetics_parsing_options import SyntheticsParsingOptions
@@ -1616,6 +1619,7 @@
16161619
"SyntheticsGlobalVariableValue",
16171620
"SyntheticsListGlobalVariablesResponse",
16181621
"SyntheticsListTestsResponse",
1622+
"SyntheticsLocalVariableParsingOptionsType",
16191623
"SyntheticsLocation",
16201624
"SyntheticsLocations",
16211625
"SyntheticsParsingOptions",

0 commit comments

Comments
 (0)