Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for synthetics multistep tests #457

Merged
merged 2 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-05-27 08:31:12.667336",
"spec_repo_commit": "0167d3f"
"regenerated": "2021-05-27 15:02:08.337074",
"spec_repo_commit": "5311d4c"
},
"v2": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-05-27 08:31:41.291570",
"spec_repo_commit": "0167d3f"
"regenerated": "2021-05-27 15:02:36.422686",
"spec_repo_commit": "5311d4c"
}
}
}
2 changes: 1 addition & 1 deletion docs/v1/SyntheticsAPITestConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Configuration object for a Synthetic API test.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | defaults to []
**assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | [optional] if omitted the server will use the default value of []
**config_variables** | [**[SyntheticsConfigVariable]**](SyntheticsConfigVariable.md) | Array of variables used for the test. | [optional]
**request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | [optional]
**steps** | [**[SyntheticsAPIStep]**](SyntheticsAPIStep.md) | When the test subtype is `multi`, the steps of the test. | [optional]
Expand Down
6 changes: 4 additions & 2 deletions docs/v1/SyntheticsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@ with ApiClient(configuration) as api_client:
config_variables=[
SyntheticsConfigVariable(
example="example_example",
id="id_example",
name="VARIABLE_NAME",
pattern="pattern_example",
type=SyntheticsConfigVariableType("text"),
type=SyntheticsConfigVariableType("global"),
),
],
request=SyntheticsTestRequest(
Expand Down Expand Up @@ -1728,9 +1729,10 @@ with ApiClient(configuration) as api_client:
config_variables=[
SyntheticsConfigVariable(
example="example_example",
id="id_example",
name="VARIABLE_NAME",
pattern="pattern_example",
type=SyntheticsConfigVariableType("text"),
type=SyntheticsConfigVariableType("global"),
),
],
request=SyntheticsTestRequest(
Expand Down
3 changes: 2 additions & 1 deletion docs/v1/SyntheticsConfigVariable.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Object defining a variable that can be used in your test configuration.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**example** | **str** | Example for the variable. |
**name** | **str** | Name of the variable. |
**type** | [**SyntheticsConfigVariableType**](SyntheticsConfigVariableType.md) | |
**example** | **str** | Example for the variable. | [optional]
**id** | **str** | ID of the variable for global variables. | [optional]
**pattern** | **str** | Pattern of the variable. | [optional]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/SyntheticsConfigVariableType.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Type of the configuration variable.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | Type of the configuration variable. | defaults to "text", must be one of ["text", ]
**value** | **str** | Type of the configuration variable. | must be one of ["global", "text", ]

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/v1/SyntheticsTestConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Configuration object for a Synthetic test.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | defaults to []
**assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | [optional] if omitted the server will use the default value of []
**config_variables** | [**[SyntheticsConfigVariable]**](SyntheticsConfigVariable.md) | API tests only - array of variables used for the test. | [optional]
**request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | [optional]
**variables** | [**[SyntheticsBrowserVariable]**](SyntheticsBrowserVariable.md) | Browser tests only - array of variables used for the test steps. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ def discriminator():
def __init__(self, *args, **kwargs): # noqa: E501
"""SyntheticsAPITestConfig - a model defined in OpenAPI

Args:

Keyword Args:
assertions ([SyntheticsAssertion]): Array of assertions used for the test.. defaults to [] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Expand Down Expand Up @@ -146,12 +143,12 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
assertions ([SyntheticsAssertion]): Array of assertions used for the test.. [optional] if omitted the server will use the default value of [] # noqa: E501
config_variables ([SyntheticsConfigVariable]): Array of variables used for the test.. [optional] # noqa: E501
request (SyntheticsTestRequest): [optional] # noqa: E501
steps ([SyntheticsAPIStep]): When the test subtype is `multi`, the steps of the test.. [optional] # noqa: E501
"""

assertions = kwargs.get("assertions", [])
_check_type = kwargs.pop("_check_type", True)
_spec_property_naming = kwargs.pop("_spec_property_naming", False)
_path_to_item = kwargs.pop("_path_to_item", ())
Expand All @@ -176,7 +173,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.assertions = assertions
for var_name, var_value in kwargs.items():
if (
var_name not in self.attribute_map
Expand Down
12 changes: 7 additions & 5 deletions src/datadog_api_client/v1/model/synthetics_config_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ def openapi_types():
"""
lazy_import()
return {
"example": (str,), # noqa: E501
"name": (str,), # noqa: E501
"type": (SyntheticsConfigVariableType,), # noqa: E501
"example": (str,), # noqa: E501
"id": (str,), # noqa: E501
"pattern": (str,), # noqa: E501
}

Expand All @@ -83,9 +84,10 @@ def discriminator():
return None

attribute_map = {
"example": "example", # noqa: E501
"name": "name", # noqa: E501
"type": "type", # noqa: E501
"example": "example", # noqa: E501
"id": "id", # noqa: E501
"pattern": "pattern", # noqa: E501
}

Expand All @@ -103,11 +105,10 @@ def discriminator():
)

@convert_js_args_to_python_args
def __init__(self, example, name, type, *args, **kwargs): # noqa: E501
def __init__(self, name, type, *args, **kwargs): # noqa: E501
"""SyntheticsConfigVariable - a model defined in OpenAPI

Args:
example (str): Example for the variable.
name (str): Name of the variable.
type (SyntheticsConfigVariableType):

Expand Down Expand Up @@ -142,6 +143,8 @@ def __init__(self, example, name, type, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
example (str): Example for the variable.. [optional] # noqa: E501
id (str): ID of the variable for global variables.. [optional] # noqa: E501
pattern (str): Pattern of the variable.. [optional] # noqa: E501
"""

Expand Down Expand Up @@ -169,7 +172,6 @@ def __init__(self, example, name, type, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.example = example
self.name = name
self.type = type
for var_name, var_value in kwargs.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class SyntheticsConfigVariableType(ModelSimple):

allowed_values = {
("value",): {
"GLOBAL": "global",
"TEXT": "text",
},
}
Expand Down Expand Up @@ -94,10 +95,10 @@ def __init__(self, *args, **kwargs):
Note that value can be passed either in args or in kwargs, but not in both.

Args:
args[0] (str): Type of the configuration variable.. if omitted defaults to "text", must be one of ["text", ] # noqa: E501
args[0] (str): Type of the configuration variable.., must be one of ["global", "text", ] # noqa: E501

Keyword Args:
value (str): Type of the configuration variable.. if omitted defaults to "text", must be one of ["text", ] # noqa: E501
value (str): Type of the configuration variable.., must be one of ["global", "text", ] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Expand Down Expand Up @@ -138,7 +139,11 @@ def __init__(self, *args, **kwargs):
args = list(args)
value = args.pop(0)
else:
value = "text"
raise ApiTypeError(
"value is required, but not passed in args or kwargs and doesn't have default",
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)

_check_type = kwargs.pop("_check_type", True)
_spec_property_naming = kwargs.pop("_spec_property_naming", False)
Expand Down
6 changes: 1 addition & 5 deletions src/datadog_api_client/v1/model/synthetics_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ def discriminator():
def __init__(self, *args, **kwargs): # noqa: E501
"""SyntheticsTestConfig - a model defined in OpenAPI

Args:

Keyword Args:
assertions ([SyntheticsAssertion]): Array of assertions used for the test.. defaults to [] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Expand Down Expand Up @@ -146,12 +143,12 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
assertions ([SyntheticsAssertion]): Array of assertions used for the test.. [optional] if omitted the server will use the default value of [] # noqa: E501
config_variables ([SyntheticsConfigVariable]): API tests only - array of variables used for the test.. [optional] # noqa: E501
request (SyntheticsTestRequest): [optional] # noqa: E501
variables ([SyntheticsBrowserVariable]): Browser tests only - array of variables used for the test steps.. [optional] # noqa: E501
"""

assertions = kwargs.get("assertions", [])
_check_type = kwargs.pop("_check_type", True)
_spec_property_naming = kwargs.pop("_spec_property_naming", False)
_path_to_item = kwargs.pop("_path_to_item", ())
Expand All @@ -176,7 +173,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.assertions = assertions
for var_name, var_value in kwargs.items():
if (
var_name not in self.attribute_map
Expand Down
10 changes: 5 additions & 5 deletions src/datadog_api_client/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8340,8 +8340,6 @@ components:
items:
$ref: '#/components/schemas/SyntheticsAPIStep'
type: array
required:
- assertions
type: object
SyntheticsAPITestResultData:
description: Object containing results for your Synthetic API test.
Expand Down Expand Up @@ -8974,6 +8972,9 @@ components:
example:
description: Example for the variable.
type: string
id:
description: ID of the variable for global variables.
type: string
name:
description: Name of the variable.
example: VARIABLE_NAME
Expand All @@ -8984,16 +8985,17 @@ components:
type:
$ref: '#/components/schemas/SyntheticsConfigVariableType'
required:
- example
- type
- name
type: object
SyntheticsConfigVariableType:
description: Type of the configuration variable.
enum:
- global
- text
type: string
x-enum-varnames:
- GLOBAL
- TEXT
SyntheticsCoreWebVitals:
description: Core Web Vitals attached to a browser test step.
Expand Down Expand Up @@ -9635,8 +9637,6 @@ components:
items:
$ref: '#/components/schemas/SyntheticsBrowserVariable'
type: array
required:
- assertions
type: object
SyntheticsTestDetails:
description: Object containing details about your Synthetic test.
Expand Down
Loading