Skip to content

Update synthetics test to contain latest features #13

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

Merged
merged 1 commit into from
Jul 8, 2020
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.2.0",
"regenerated": "2020-07-02 22:52:51.104065",
"spec_repo_commit": "4d84e86"
"regenerated": "2020-07-08 07:59:25.271906",
"spec_repo_commit": "44c5568"
},
"v2": {
"apigentools_version": "1.2.0",
"regenerated": "2020-07-02 22:52:59.913708",
"spec_repo_commit": "4d84e86"
"regenerated": "2020-07-08 07:59:33.601210",
"spec_repo_commit": "44c5568"
}
}
}
108 changes: 81 additions & 27 deletions datadog_api_client/v1/model/synthetics_assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,33 @@
validate_get_composed_info,
)
try:
from datadog_api_client.v1.model import synthetics_assertion_operator
from datadog_api_client.v1.model import synthetics_assertion_json_path_operator
except ImportError:
synthetics_assertion_operator = sys.modules[
'datadog_api_client.v1.model.synthetics_assertion_operator']
synthetics_assertion_json_path_operator = sys.modules[
'datadog_api_client.v1.model.synthetics_assertion_json_path_operator']
try:
from datadog_api_client.v1.model import synthetics_assertion_json_path_target
except ImportError:
synthetics_assertion_json_path_target = sys.modules[
'datadog_api_client.v1.model.synthetics_assertion_json_path_target']
try:
from datadog_api_client.v1.model import synthetics_assertion_json_path_target_target
except ImportError:
synthetics_assertion_json_path_target_target = sys.modules[
'datadog_api_client.v1.model.synthetics_assertion_json_path_target_target']
try:
from datadog_api_client.v1.model import synthetics_assertion_target
except ImportError:
synthetics_assertion_target = sys.modules[
'datadog_api_client.v1.model.synthetics_assertion_target']
try:
from datadog_api_client.v1.model import synthetics_assertion_type
except ImportError:
synthetics_assertion_type = sys.modules[
'datadog_api_client.v1.model.synthetics_assertion_type']


class SyntheticsAssertion(ModelNormal):
class SyntheticsAssertion(ModelComposed):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand Down Expand Up @@ -70,7 +85,7 @@ class SyntheticsAssertion(ModelNormal):
validations = {
}

additional_properties_type = None
additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501

_nullable = False

Expand All @@ -84,25 +99,13 @@ def openapi_types():
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'operator': (synthetics_assertion_operator.SyntheticsAssertionOperator,), # noqa: E501
'type': (synthetics_assertion_type.SyntheticsAssertionType,), # noqa: E501
'_property': (str,), # noqa: E501
'target': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
}
return {}

@cached_property
def discriminator():
return None

attribute_map = {
'operator': 'operator', # noqa: E501
'type': 'type', # noqa: E501
'_property': 'property', # noqa: E501
'target': 'target', # noqa: E501
}

_composed_schemas = {}
attribute_map = {}

required_properties = set([
'_data_store',
Expand All @@ -111,17 +114,20 @@ def discriminator():
'_path_to_item',
'_configuration',
'_visited_composed_classes',
'_composed_instances',
'_var_name_to_model_instances',
'_additional_properties_model_instances',
])

@convert_js_args_to_python_args
def __init__(self, operator, type, *args, **kwargs): # noqa: E501
def __init__(self, *args, **kwargs): # noqa: E501
"""synthetics_assertion.SyntheticsAssertion - a model defined in OpenAPI

Args:
operator (synthetics_assertion_operator.SyntheticsAssertionOperator):
type (synthetics_assertion_type.SyntheticsAssertionType):

Keyword Args:
operator (synthetics_assertion_json_path_operator.SyntheticsAssertionJSONPathOperator): defaults to nulltype.Null, must be one of ["validatesJSONPath", ] # noqa: E501
type (synthetics_assertion_type.SyntheticsAssertionType): defaults to nulltype.Null, must be one of ["body", "header", "statusCode", "certificate", "responseTime", "property", ] # 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 @@ -153,9 +159,11 @@ def __init__(self, operator, type, *args, **kwargs): # noqa: E501
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
_property (str): The associated assertion property.. [optional] # noqa: E501
target ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Target to apply the assertion to. It can be a string, a number, or a Date.. [optional] # noqa: E501
target (synthetics_assertion_json_path_target_target.SyntheticsAssertionJSONPathTargetTarget): [optional] # noqa: E501
"""

operator = kwargs.get('operator', nulltype.Null)
type = kwargs.get('type', nulltype.Null)
_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 @@ -179,13 +187,59 @@ def __init__(self, operator, type, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.operator = operator
self.type = type
constant_args = {
'_check_type': _check_type,
'_path_to_item': _path_to_item,
'_spec_property_naming': _spec_property_naming,
'_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes,
}
required_args = {
'operator': operator,
'type': type,
}
# remove args whose value is Null because they are unset
required_arg_names = list(required_args.keys())
for required_arg_name in required_arg_names:
if required_args[required_arg_name] is nulltype.Null:
del required_args[required_arg_name]
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info(
constant_args, model_args, self)
self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3]

for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in six.iteritems(kwargs):
if var_name not in self.attribute_map and \
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
not self._additional_properties_model_instances:
# discard variable.
continue
setattr(self, var_name, var_value)

@cached_property
def _composed_schemas():
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error beause the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
return {
'anyOf': [
],
'allOf': [
],
'oneOf': [
synthetics_assertion_json_path_target.SyntheticsAssertionJSONPathTarget,
synthetics_assertion_target.SyntheticsAssertionTarget,
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# coding: utf-8

# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.


from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401

import six # noqa: F401
import nulltype # noqa: F401

from datadog_api_client.v1.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)


class SyntheticsAssertionJSONPathOperator(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Do not edit the class manually.

Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""

allowed_values = {
('value',): {
'VALIDATES_JSON_PATH': "validatesJSONPath",
},
}

validations = {
}

additional_properties_type = None

_nullable = False

@cached_property
def openapi_types():
"""
This must be a class method so a model may have properties that are
of type self, this ensures that we don't create a cyclic import

Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'value': (str,), # noqa: E501
}

@cached_property
def discriminator():
return None

attribute_map = {}

_composed_schemas = None

required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])

@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""synthetics_assertion_json_path_operator.SyntheticsAssertionJSONPathOperator - a model defined in OpenAPI

Args:

Keyword Args:
value (str): Assertion operator to apply.. defaults to 'validatesJSONPath', must be one of ["validatesJSONPath", ] # 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.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""

value = kwargs.get('value', 'validatesJSONPath')
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)

self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.value = value
for var_name, var_value in six.iteritems(kwargs):
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
Loading