From 458191eef10d3dab99b73b76f5a75e1878287eec Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Sat, 30 May 2020 05:56:21 +0000 Subject: [PATCH] Generated from d422c1b17bd8b542f4c158eb0e2573691e598566 monitor readme fix --- .../mgmt/monitor/v2018_03_01/models/_models.py | 14 ++++++++++++-- .../monitor/v2018_03_01/models/_models_py3.py | 18 ++++++++++++++---- sdk/monitor/azure-mgmt-monitor/setup.py | 4 +++- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py index 0dade9eb98f5..f01772429af5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py @@ -674,6 +674,7 @@ class MetricAlertCriteria(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: MetricAlertSingleResourceMultipleMetricCriteria, + WebtestLocationAvailabilityCriteria, MetricAlertMultipleResourceMultipleMetricCriteria All required parameters must be populated in order to send to Azure. @@ -695,7 +696,7 @@ class MetricAlertCriteria(Model): } _subtype_map = { - 'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'} + 'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria': 'WebtestLocationAvailabilityCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'} } def __init__(self, **kwargs): @@ -1232,11 +1233,16 @@ def __init__(self, **kwargs): self.service_uri = kwargs.get('service_uri', None) -class WebtestLocationAvailabilityCriteria(Model): +class WebtestLocationAvailabilityCriteria(MetricAlertCriteria): """Specifies the metric alert rule criteria for a web test resource. All required parameters must be populated in order to send to Azure. + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str :param web_test_id: Required. The Application Insights web test Id. :type web_test_id: str :param component_id: Required. The Application Insights resource Id. @@ -1246,12 +1252,15 @@ class WebtestLocationAvailabilityCriteria(Model): """ _validation = { + 'odatatype': {'required': True}, 'web_test_id': {'required': True}, 'component_id': {'required': True}, 'failed_location_count': {'required': True}, } _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, 'web_test_id': {'key': 'webTestId', 'type': 'str'}, 'component_id': {'key': 'componentId', 'type': 'str'}, 'failed_location_count': {'key': 'failedLocationCount', 'type': 'float'}, @@ -1262,3 +1271,4 @@ def __init__(self, **kwargs): self.web_test_id = kwargs.get('web_test_id', None) self.component_id = kwargs.get('component_id', None) self.failed_location_count = kwargs.get('failed_location_count', None) + self.odatatype = 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py index 93f1496b3162..2e6beeff0eca 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py @@ -674,6 +674,7 @@ class MetricAlertCriteria(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: MetricAlertSingleResourceMultipleMetricCriteria, + WebtestLocationAvailabilityCriteria, MetricAlertMultipleResourceMultipleMetricCriteria All required parameters must be populated in order to send to Azure. @@ -695,7 +696,7 @@ class MetricAlertCriteria(Model): } _subtype_map = { - 'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'} + 'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria': 'WebtestLocationAvailabilityCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'} } def __init__(self, *, additional_properties=None, **kwargs) -> None: @@ -1232,11 +1233,16 @@ def __init__(self, *, name: str, service_uri: str, **kwargs) -> None: self.service_uri = service_uri -class WebtestLocationAvailabilityCriteria(Model): +class WebtestLocationAvailabilityCriteria(MetricAlertCriteria): """Specifies the metric alert rule criteria for a web test resource. All required parameters must be populated in order to send to Azure. + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odatatype: Required. Constant filled by server. + :type odatatype: str :param web_test_id: Required. The Application Insights web test Id. :type web_test_id: str :param component_id: Required. The Application Insights resource Id. @@ -1246,19 +1252,23 @@ class WebtestLocationAvailabilityCriteria(Model): """ _validation = { + 'odatatype': {'required': True}, 'web_test_id': {'required': True}, 'component_id': {'required': True}, 'failed_location_count': {'required': True}, } _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odatatype': {'key': 'odata\\.type', 'type': 'str'}, 'web_test_id': {'key': 'webTestId', 'type': 'str'}, 'component_id': {'key': 'componentId', 'type': 'str'}, 'failed_location_count': {'key': 'failedLocationCount', 'type': 'float'}, } - def __init__(self, *, web_test_id: str, component_id: str, failed_location_count: float, **kwargs) -> None: - super(WebtestLocationAvailabilityCriteria, self).__init__(**kwargs) + def __init__(self, *, web_test_id: str, component_id: str, failed_location_count: float, additional_properties=None, **kwargs) -> None: + super(WebtestLocationAvailabilityCriteria, self).__init__(additional_properties=additional_properties, **kwargs) self.web_test_id = web_test_id self.component_id = component_id self.failed_location_count = failed_location_count + self.odatatype = 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' diff --git a/sdk/monitor/azure-mgmt-monitor/setup.py b/sdk/monitor/azure-mgmt-monitor/setup.py index 23cbb6fe9a57..33e75a62d8f8 100644 --- a/sdk/monitor/azure-mgmt-monitor/setup.py +++ b/sdk/monitor/azure-mgmt-monitor/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)