From 8358e4f0bd7977f623313cd5750fa2d50e3990ab Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 12 Nov 2018 17:02:21 +0000 Subject: [PATCH 1/7] Generated from d2181a423ecf171166a45e375e3ea6fb022d617d Fix example format --- .../mgmt/workloadmonitor/models/__init__.py | 6 ++ .../models/notification_setting.py | 11 +-- .../models/notification_setting_properties.py | 36 +++++++++ .../notification_setting_properties_py3.py | 36 +++++++++ .../models/notification_setting_py3.py | 11 +-- .../notification_settings_collection.py | 41 ++++++++++ .../notification_settings_collection_py3.py | 41 ++++++++++ .../notification_settings_operations.py | 76 +++++++++++++++++++ 8 files changed, 248 insertions(+), 10 deletions(-) create mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py create mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py create mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py create mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py index 2be1bc82819f..14328db0738d 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py @@ -15,7 +15,9 @@ from .component_py3 import Component from .health_state_change_py3 import HealthStateChange from .monitor_instance_py3 import MonitorInstance + from .notification_setting_properties_py3 import NotificationSettingProperties from .notification_setting_py3 import NotificationSetting + from .notification_settings_collection_py3 import NotificationSettingsCollection from .operation_properties_py3 import OperationProperties from .operation_py3 import Operation from .error_field_contract_py3 import ErrorFieldContract @@ -30,7 +32,9 @@ from .component import Component from .health_state_change import HealthStateChange from .monitor_instance import MonitorInstance + from .notification_setting_properties import NotificationSettingProperties from .notification_setting import NotificationSetting + from .notification_settings_collection import NotificationSettingsCollection from .operation_properties import OperationProperties from .operation import Operation from .error_field_contract import ErrorFieldContract @@ -61,7 +65,9 @@ 'Component', 'HealthStateChange', 'MonitorInstance', + 'NotificationSettingProperties', 'NotificationSetting', + 'NotificationSettingsCollection', 'OperationProperties', 'Operation', 'ErrorFieldContract', diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py index 6ca8525806e2..66903b10ed1d 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py @@ -28,8 +28,9 @@ class NotificationSetting(ProxyResource): :vartype type: str :ivar etag: For optimistic concurrency control. :vartype etag: str - :ivar action_groups: List of action group resource ids to be notified - :vartype action_groups: list[str] + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] """ _validation = { @@ -37,7 +38,7 @@ class NotificationSetting(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, - 'action_groups': {'readonly': True}, + 'action_group_resource_ids': {'readonly': True}, } _attribute_map = { @@ -45,10 +46,10 @@ class NotificationSetting(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'action_groups': {'key': 'properties.actionGroups', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'properties.ActionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs): super(NotificationSetting, self).__init__(**kwargs) self.etag = None - self.action_groups = None + self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py new file mode 100644 index 000000000000..29271fe3ec34 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NotificationSettingProperties(Model): + """Model for properties of a NotificationSetting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] + """ + + _validation = { + 'action_group_resource_ids': {'readonly': True}, + } + + _attribute_map = { + 'action_group_resource_ids': {'key': 'ActionGroupResourceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(NotificationSettingProperties, self).__init__(**kwargs) + self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py new file mode 100644 index 000000000000..e38c7c67dbc8 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NotificationSettingProperties(Model): + """Model for properties of a NotificationSetting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] + """ + + _validation = { + 'action_group_resource_ids': {'readonly': True}, + } + + _attribute_map = { + 'action_group_resource_ids': {'key': 'ActionGroupResourceIds', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(NotificationSettingProperties, self).__init__(**kwargs) + self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py index 4d77a3bcf948..5d2797941d6e 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py @@ -28,8 +28,9 @@ class NotificationSetting(ProxyResource): :vartype type: str :ivar etag: For optimistic concurrency control. :vartype etag: str - :ivar action_groups: List of action group resource ids to be notified - :vartype action_groups: list[str] + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] """ _validation = { @@ -37,7 +38,7 @@ class NotificationSetting(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, - 'action_groups': {'readonly': True}, + 'action_group_resource_ids': {'readonly': True}, } _attribute_map = { @@ -45,10 +46,10 @@ class NotificationSetting(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'action_groups': {'key': 'properties.actionGroups', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'properties.ActionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: super(NotificationSetting, self).__init__(**kwargs) self.etag = None - self.action_groups = None + self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py new file mode 100644 index 000000000000..7bc595190028 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NotificationSettingsCollection(Model): + """Model for collection of notificationSettings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar next_link: URL to the next set of results. + :vartype next_link: str + :ivar value: Collection of components. + :vartype value: + list[~azure.mgmt.workloadmonitor.models.NotificationSetting] + """ + + _validation = { + 'next_link': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[NotificationSetting]'}, + } + + def __init__(self, **kwargs): + super(NotificationSettingsCollection, self).__init__(**kwargs) + self.next_link = None + self.value = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py new file mode 100644 index 000000000000..6518366566f5 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NotificationSettingsCollection(Model): + """Model for collection of notificationSettings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar next_link: URL to the next set of results. + :vartype next_link: str + :ivar value: Collection of components. + :vartype value: + list[~azure.mgmt.workloadmonitor.models.NotificationSetting] + """ + + _validation = { + 'next_link': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[NotificationSetting]'}, + } + + def __init__(self, **kwargs) -> None: + super(NotificationSettingsCollection, self).__init__(**kwargs) + self.next_link = None + self.value = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py index 9f87e33d0e13..30977338f9f9 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py @@ -116,3 +116,79 @@ def internal_paging(next_link=None, raw=False): return deserialized list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} + + def update( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Update notification settings for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NotificationSettingsCollection or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.workloadmonitor.models.NotificationSettingsCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + body = None + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'NotificationSettingProperties') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NotificationSettingsCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} From 59a61e494a0b201474f9cdf5d1c566ea6b8b2bb0 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Mon, 12 Nov 2018 17:10:40 +0000 Subject: [PATCH 2/7] Packaging update of azure-mgmt-workloadmonitor --- azure-mgmt-workloadmonitor/MANIFEST.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-mgmt-workloadmonitor/MANIFEST.in b/azure-mgmt-workloadmonitor/MANIFEST.in index bb37a2723dae..6ceb27f7a96e 100644 --- a/azure-mgmt-workloadmonitor/MANIFEST.in +++ b/azure-mgmt-workloadmonitor/MANIFEST.in @@ -1 +1,4 @@ include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + From 1b2e11e7d97caddafa66b02ff36373670cdbab6e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 12 Nov 2018 18:20:16 +0000 Subject: [PATCH 3/7] Generated from 73fd95cab2de8de203920c290c1d8641fb80e854 fix validation error --- .../mgmt/workloadmonitor/models/notification_setting.py | 2 +- .../models/notification_setting_properties.py | 2 +- .../models/notification_setting_properties_py3.py | 2 +- .../mgmt/workloadmonitor/models/notification_setting_py3.py | 2 +- .../models/notification_settings_collection.py | 5 ----- .../models/notification_settings_collection_py3.py | 5 ----- 6 files changed, 4 insertions(+), 14 deletions(-) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py index 66903b10ed1d..95229909289b 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py @@ -46,7 +46,7 @@ class NotificationSetting(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'properties.ActionGroupResourceIds', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py index 29271fe3ec34..0c9f966df2e8 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py @@ -28,7 +28,7 @@ class NotificationSettingProperties(Model): } _attribute_map = { - 'action_group_resource_ids': {'key': 'ActionGroupResourceIds', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py index e38c7c67dbc8..e7dbefdaf1f0 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py @@ -28,7 +28,7 @@ class NotificationSettingProperties(Model): } _attribute_map = { - 'action_group_resource_ids': {'key': 'ActionGroupResourceIds', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py index 5d2797941d6e..2b9229478d07 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py @@ -46,7 +46,7 @@ class NotificationSetting(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'properties.ActionGroupResourceIds', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py index 7bc595190028..c12b1443bc6f 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py @@ -18,24 +18,19 @@ class NotificationSettingsCollection(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar next_link: URL to the next set of results. - :vartype next_link: str :ivar value: Collection of components. :vartype value: list[~azure.mgmt.workloadmonitor.models.NotificationSetting] """ _validation = { - 'next_link': {'readonly': True}, 'value': {'readonly': True}, } _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, 'value': {'key': 'value', 'type': '[NotificationSetting]'}, } def __init__(self, **kwargs): super(NotificationSettingsCollection, self).__init__(**kwargs) - self.next_link = None self.value = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py index 6518366566f5..9aa8ecd4a275 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py @@ -18,24 +18,19 @@ class NotificationSettingsCollection(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar next_link: URL to the next set of results. - :vartype next_link: str :ivar value: Collection of components. :vartype value: list[~azure.mgmt.workloadmonitor.models.NotificationSetting] """ _validation = { - 'next_link': {'readonly': True}, 'value': {'readonly': True}, } _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, 'value': {'key': 'value', 'type': '[NotificationSetting]'}, } def __init__(self, **kwargs) -> None: super(NotificationSettingsCollection, self).__init__(**kwargs) - self.next_link = None self.value = None From a7fabb48d925e9c5bdd61981ff8100d6aa29d4da Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 12 Nov 2018 19:08:41 +0000 Subject: [PATCH 4/7] Generated from da2f1ad979da5da4ed94824dfe533a8e55dd6fe7 fix validation error --- .../mgmt/workloadmonitor/models/__init__.py | 5 --- .../models/notification_setting.py | 9 ++--- .../models/notification_setting_paged.py | 27 -------------- .../models/notification_setting_properties.py | 36 ------------------- .../notification_setting_properties_py3.py | 36 ------------------- .../models/notification_setting_py3.py | 9 ++--- .../notification_settings_collection.py | 16 +++------ .../notification_settings_collection_py3.py | 18 +++------- .../notification_settings_operations.py | 10 +++--- 9 files changed, 18 insertions(+), 148 deletions(-) delete mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py delete mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py delete mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py index 14328db0738d..892e2b3b81ea 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py @@ -15,7 +15,6 @@ from .component_py3 import Component from .health_state_change_py3 import HealthStateChange from .monitor_instance_py3 import MonitorInstance - from .notification_setting_properties_py3 import NotificationSettingProperties from .notification_setting_py3 import NotificationSetting from .notification_settings_collection_py3 import NotificationSettingsCollection from .operation_properties_py3 import OperationProperties @@ -32,7 +31,6 @@ from .component import Component from .health_state_change import HealthStateChange from .monitor_instance import MonitorInstance - from .notification_setting_properties import NotificationSettingProperties from .notification_setting import NotificationSetting from .notification_settings_collection import NotificationSettingsCollection from .operation_properties import OperationProperties @@ -46,7 +44,6 @@ from .monitor_paged import MonitorPaged from .component_paged import ComponentPaged from .monitor_instance_paged import MonitorInstancePaged -from .notification_setting_paged import NotificationSettingPaged from .operation_paged import OperationPaged from .workload_monitor_api_enums import ( MonitorType, @@ -65,7 +62,6 @@ 'Component', 'HealthStateChange', 'MonitorInstance', - 'NotificationSettingProperties', 'NotificationSetting', 'NotificationSettingsCollection', 'OperationProperties', @@ -79,7 +75,6 @@ 'MonitorPaged', 'ComponentPaged', 'MonitorInstancePaged', - 'NotificationSettingPaged', 'OperationPaged', 'MonitorType', 'MonitorCategory', diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py index 95229909289b..8392096f6464 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py @@ -13,7 +13,7 @@ class NotificationSetting(ProxyResource): - """Model for component. + """Model for properties of a NotificationSetting. Variables are only populated by the server, and will be ignored when sending a request. @@ -26,8 +26,6 @@ class NotificationSetting(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :ivar etag: For optimistic concurrency control. - :vartype etag: str :ivar action_group_resource_ids: List of action group resource ids to be notified :vartype action_group_resource_ids: list[str] @@ -37,7 +35,6 @@ class NotificationSetting(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'etag': {'readonly': True}, 'action_group_resource_ids': {'readonly': True}, } @@ -45,11 +42,9 @@ class NotificationSetting(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs): super(NotificationSetting, self).__init__(**kwargs) - self.etag = None self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py deleted file mode 100644 index 3a9cfa14ee57..000000000000 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class NotificationSettingPaged(Paged): - """ - A paging container for iterating over a list of :class:`NotificationSetting ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[NotificationSetting]'} - } - - def __init__(self, *args, **kwargs): - - super(NotificationSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py deleted file mode 100644 index 0c9f966df2e8..000000000000 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class NotificationSettingProperties(Model): - """Model for properties of a NotificationSetting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar action_group_resource_ids: List of action group resource ids to be - notified - :vartype action_group_resource_ids: list[str] - """ - - _validation = { - 'action_group_resource_ids': {'readonly': True}, - } - - _attribute_map = { - 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(NotificationSettingProperties, self).__init__(**kwargs) - self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py deleted file mode 100644 index e7dbefdaf1f0..000000000000 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class NotificationSettingProperties(Model): - """Model for properties of a NotificationSetting. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar action_group_resource_ids: List of action group resource ids to be - notified - :vartype action_group_resource_ids: list[str] - """ - - _validation = { - 'action_group_resource_ids': {'readonly': True}, - } - - _attribute_map = { - 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, - } - - def __init__(self, **kwargs) -> None: - super(NotificationSettingProperties, self).__init__(**kwargs) - self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py index 2b9229478d07..2081c2eb9f9b 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py @@ -13,7 +13,7 @@ class NotificationSetting(ProxyResource): - """Model for component. + """Model for properties of a NotificationSetting. Variables are only populated by the server, and will be ignored when sending a request. @@ -26,8 +26,6 @@ class NotificationSetting(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :ivar etag: For optimistic concurrency control. - :vartype etag: str :ivar action_group_resource_ids: List of action group resource ids to be notified :vartype action_group_resource_ids: list[str] @@ -37,7 +35,6 @@ class NotificationSetting(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'etag': {'readonly': True}, 'action_group_resource_ids': {'readonly': True}, } @@ -45,11 +42,9 @@ class NotificationSetting(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, + 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: super(NotificationSetting, self).__init__(**kwargs) - self.etag = None self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py index c12b1443bc6f..d1890b3bf88e 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py @@ -15,22 +15,14 @@ class NotificationSettingsCollection(Model): """Model for collection of notificationSettings. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Collection of components. - :vartype value: - list[~azure.mgmt.workloadmonitor.models.NotificationSetting] + :param properties: + :type properties: ~azure.mgmt.workloadmonitor.models.NotificationSetting """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[NotificationSetting]'}, + 'properties': {'key': 'properties', 'type': 'NotificationSetting'}, } def __init__(self, **kwargs): super(NotificationSettingsCollection, self).__init__(**kwargs) - self.value = None + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py index 9aa8ecd4a275..0a2f55372bf2 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py @@ -15,22 +15,14 @@ class NotificationSettingsCollection(Model): """Model for collection of notificationSettings. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Collection of components. - :vartype value: - list[~azure.mgmt.workloadmonitor.models.NotificationSetting] + :param properties: + :type properties: ~azure.mgmt.workloadmonitor.models.NotificationSetting """ - _validation = { - 'value': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[NotificationSetting]'}, + 'properties': {'key': 'properties', 'type': 'NotificationSetting'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, properties=None, **kwargs) -> None: super(NotificationSettingsCollection, self).__init__(**kwargs) - self.value = None + self.properties = properties diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py index 30977338f9f9..4ff438837457 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py @@ -57,9 +57,9 @@ def list_by_resource( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of NotificationSetting + :return: An iterator like instance of None :rtype: - ~azure.mgmt.workloadmonitor.models.NotificationSettingPaged[~azure.mgmt.workloadmonitor.models.NotificationSetting] + ~azure.mgmt.workloadmonitor.models.NotificationSettingsCollection[None] :raises: :class:`ErrorResponseException` """ @@ -107,11 +107,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.NotificationSettingPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.NotificationSettingsCollection(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.NotificationSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.NotificationSettingsCollection(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -172,7 +172,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(body, 'NotificationSettingProperties') + body_content = self._serialize.body(body, 'NotificationSetting') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) From c9dd95fe6562cf7cbba303c0c1246700559ea8b5 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 13 Nov 2018 17:09:50 +0000 Subject: [PATCH 5/7] Generated from 93b0f7bc041824d76c1cb67f094cc95589717e54 validation error fix --- .../notification_settings_collection.py | 49 +++++++++- .../notification_settings_collection_py3.py | 51 +++++++++- .../notification_settings_operations.py | 95 ++++++++----------- 3 files changed, 133 insertions(+), 62 deletions(-) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py index d1890b3bf88e..11c0ffce9b71 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py @@ -15,14 +15,55 @@ class NotificationSettingsCollection(Model): """Model for collection of notificationSettings. - :param properties: - :type properties: ~azure.mgmt.workloadmonitor.models.NotificationSetting + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar notification_setting_id: Fully qualified resource Id for the + resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype notification_setting_id: str + :ivar notification_setting_name: The name of the resource + :vartype notification_setting_name: str + :ivar notification_setting_type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype notification_setting_type: str + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] + :ivar name: Resource name of NotificationSettings + :vartype name: str + :ivar id: ARM resource ID of notification settings + :vartype id: str + :ivar type: Resource type of NotificationSettings + :vartype type: str """ + _validation = { + 'notification_setting_id': {'readonly': True}, + 'notification_setting_name': {'readonly': True}, + 'notification_setting_type': {'readonly': True}, + 'action_group_resource_ids': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'properties': {'key': 'properties', 'type': 'NotificationSetting'}, + 'notification_setting_id': {'key': 'properties.id', 'type': 'str'}, + 'notification_setting_name': {'key': 'properties.name', 'type': 'str'}, + 'notification_setting_type': {'key': 'properties.type', 'type': 'str'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, **kwargs): super(NotificationSettingsCollection, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + self.notification_setting_id = None + self.notification_setting_name = None + self.notification_setting_type = None + self.action_group_resource_ids = None + self.name = None + self.id = None + self.type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py index 0a2f55372bf2..cc9b4f0c822f 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py @@ -15,14 +15,55 @@ class NotificationSettingsCollection(Model): """Model for collection of notificationSettings. - :param properties: - :type properties: ~azure.mgmt.workloadmonitor.models.NotificationSetting + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar notification_setting_id: Fully qualified resource Id for the + resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype notification_setting_id: str + :ivar notification_setting_name: The name of the resource + :vartype notification_setting_name: str + :ivar notification_setting_type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype notification_setting_type: str + :ivar action_group_resource_ids: List of action group resource ids to be + notified + :vartype action_group_resource_ids: list[str] + :ivar name: Resource name of NotificationSettings + :vartype name: str + :ivar id: ARM resource ID of notification settings + :vartype id: str + :ivar type: Resource type of NotificationSettings + :vartype type: str """ + _validation = { + 'notification_setting_id': {'readonly': True}, + 'notification_setting_name': {'readonly': True}, + 'notification_setting_type': {'readonly': True}, + 'action_group_resource_ids': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'properties': {'key': 'properties', 'type': 'NotificationSetting'}, + 'notification_setting_id': {'key': 'properties.id', 'type': 'str'}, + 'notification_setting_name': {'key': 'properties.name', 'type': 'str'}, + 'notification_setting_type': {'key': 'properties.type', 'type': 'str'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, properties=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(NotificationSettingsCollection, self).__init__(**kwargs) - self.properties = properties + self.notification_setting_id = None + self.notification_setting_name = None + self.notification_setting_type = None + self.action_group_resource_ids = None + self.name = None + self.id = None + self.type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py index 4ff438837457..51a3370d7846 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_by_resource( - self, resource_group_name, resource_namespace, resource_type, resource_name, skiptoken=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): """Get list of notification settings for a resource. :param resource_group_name: The name of the resource group. The name @@ -49,69 +49,58 @@ def list_by_resource( :type resource_type: str :param resource_name: Name of the resource. :type resource_name: str - :param skiptoken: The page-continuation token to use with a paged - version of this API. - :type skiptoken: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of None + :return: NotificationSettingsCollection or ClientRawResponse if + raw=true :rtype: - ~azure.mgmt.workloadmonitor.models.NotificationSettingsCollection[None] + ~azure.mgmt.workloadmonitor.models.NotificationSettingsCollection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), - 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.NotificationSettingsCollection(internal_paging, self._deserialize.dependencies) + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NotificationSettingsCollection', response) if raw: - header_dict = {} - client_raw_response = models.NotificationSettingsCollection(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized From 2b55fedea7ca1377ee78cd7bab47ca7314274aa0 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 27 Nov 2018 17:02:51 +0000 Subject: [PATCH 6/7] Generated from 1592500eb7724b71831dd31a0dc2d7da62a8a8ec Restoring Python sdk in readme.md --- .../mgmt/workloadmonitor/models/__init__.py | 5 +- .../models/notification_setting.py | 9 +- .../models/notification_setting_paged.py | 27 ++++ .../models/notification_setting_py3.py | 9 +- .../notification_settings_collection.py | 69 ----------- .../notification_settings_collection_py3.py | 69 ----------- .../notification_settings_operations.py | 115 +++++++++++++++--- 7 files changed, 142 insertions(+), 161 deletions(-) create mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py delete mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py delete mode 100644 azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py index 892e2b3b81ea..2be1bc82819f 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/__init__.py @@ -16,7 +16,6 @@ from .health_state_change_py3 import HealthStateChange from .monitor_instance_py3 import MonitorInstance from .notification_setting_py3 import NotificationSetting - from .notification_settings_collection_py3 import NotificationSettingsCollection from .operation_properties_py3 import OperationProperties from .operation_py3 import Operation from .error_field_contract_py3 import ErrorFieldContract @@ -32,7 +31,6 @@ from .health_state_change import HealthStateChange from .monitor_instance import MonitorInstance from .notification_setting import NotificationSetting - from .notification_settings_collection import NotificationSettingsCollection from .operation_properties import OperationProperties from .operation import Operation from .error_field_contract import ErrorFieldContract @@ -44,6 +42,7 @@ from .monitor_paged import MonitorPaged from .component_paged import ComponentPaged from .monitor_instance_paged import MonitorInstancePaged +from .notification_setting_paged import NotificationSettingPaged from .operation_paged import OperationPaged from .workload_monitor_api_enums import ( MonitorType, @@ -63,7 +62,6 @@ 'HealthStateChange', 'MonitorInstance', 'NotificationSetting', - 'NotificationSettingsCollection', 'OperationProperties', 'Operation', 'ErrorFieldContract', @@ -75,6 +73,7 @@ 'MonitorPaged', 'ComponentPaged', 'MonitorInstancePaged', + 'NotificationSettingPaged', 'OperationPaged', 'MonitorType', 'MonitorCategory', diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py index 8392096f6464..22cd1ae5d8bd 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting.py @@ -13,7 +13,7 @@ class NotificationSetting(ProxyResource): - """Model for properties of a NotificationSetting. + """Model for NotificationSetting. Variables are only populated by the server, and will be ignored when sending a request. @@ -26,6 +26,8 @@ class NotificationSetting(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str :ivar action_group_resource_ids: List of action group resource ids to be notified :vartype action_group_resource_ids: list[str] @@ -35,6 +37,7 @@ class NotificationSetting(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'action_group_resource_ids': {'readonly': True}, } @@ -42,9 +45,11 @@ class NotificationSetting(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs): super(NotificationSetting, self).__init__(**kwargs) + self.etag = None self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py new file mode 100644 index 000000000000..3a9cfa14ee57 --- /dev/null +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class NotificationSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`NotificationSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NotificationSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(NotificationSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py index 2081c2eb9f9b..7401a2f5799c 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_setting_py3.py @@ -13,7 +13,7 @@ class NotificationSetting(ProxyResource): - """Model for properties of a NotificationSetting. + """Model for NotificationSetting. Variables are only populated by the server, and will be ignored when sending a request. @@ -26,6 +26,8 @@ class NotificationSetting(ProxyResource): :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str + :ivar etag: For optimistic concurrency control. + :vartype etag: str :ivar action_group_resource_ids: List of action group resource ids to be notified :vartype action_group_resource_ids: list[str] @@ -35,6 +37,7 @@ class NotificationSetting(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'etag': {'readonly': True}, 'action_group_resource_ids': {'readonly': True}, } @@ -42,9 +45,11 @@ class NotificationSetting(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'actionGroupResourceIds', 'type': '[str]'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: super(NotificationSetting, self).__init__(**kwargs) + self.etag = None self.action_group_resource_ids = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py deleted file mode 100644 index 11c0ffce9b71..000000000000 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class NotificationSettingsCollection(Model): - """Model for collection of notificationSettings. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar notification_setting_id: Fully qualified resource Id for the - resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype notification_setting_id: str - :ivar notification_setting_name: The name of the resource - :vartype notification_setting_name: str - :ivar notification_setting_type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype notification_setting_type: str - :ivar action_group_resource_ids: List of action group resource ids to be - notified - :vartype action_group_resource_ids: list[str] - :ivar name: Resource name of NotificationSettings - :vartype name: str - :ivar id: ARM resource ID of notification settings - :vartype id: str - :ivar type: Resource type of NotificationSettings - :vartype type: str - """ - - _validation = { - 'notification_setting_id': {'readonly': True}, - 'notification_setting_name': {'readonly': True}, - 'notification_setting_type': {'readonly': True}, - 'action_group_resource_ids': {'readonly': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'notification_setting_id': {'key': 'properties.id', 'type': 'str'}, - 'notification_setting_name': {'key': 'properties.name', 'type': 'str'}, - 'notification_setting_type': {'key': 'properties.type', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(NotificationSettingsCollection, self).__init__(**kwargs) - self.notification_setting_id = None - self.notification_setting_name = None - self.notification_setting_type = None - self.action_group_resource_ids = None - self.name = None - self.id = None - self.type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py deleted file mode 100644 index cc9b4f0c822f..000000000000 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/models/notification_settings_collection_py3.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class NotificationSettingsCollection(Model): - """Model for collection of notificationSettings. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar notification_setting_id: Fully qualified resource Id for the - resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype notification_setting_id: str - :ivar notification_setting_name: The name of the resource - :vartype notification_setting_name: str - :ivar notification_setting_type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype notification_setting_type: str - :ivar action_group_resource_ids: List of action group resource ids to be - notified - :vartype action_group_resource_ids: list[str] - :ivar name: Resource name of NotificationSettings - :vartype name: str - :ivar id: ARM resource ID of notification settings - :vartype id: str - :ivar type: Resource type of NotificationSettings - :vartype type: str - """ - - _validation = { - 'notification_setting_id': {'readonly': True}, - 'notification_setting_name': {'readonly': True}, - 'notification_setting_type': {'readonly': True}, - 'action_group_resource_ids': {'readonly': True}, - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'notification_setting_id': {'key': 'properties.id', 'type': 'str'}, - 'notification_setting_name': {'key': 'properties.name', 'type': 'str'}, - 'notification_setting_type': {'key': 'properties.type', 'type': 'str'}, - 'action_group_resource_ids': {'key': 'properties.actionGroupResourceIds', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(NotificationSettingsCollection, self).__init__(**kwargs) - self.notification_setting_id = None - self.notification_setting_name = None - self.notification_setting_type = None - self.action_group_resource_ids = None - self.name = None - self.id = None - self.type = None diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py index 51a3370d7846..0b0cdd294a33 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_by_resource( - self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_namespace, resource_type, resource_name, skiptoken=None, custom_headers=None, raw=False, **operation_config): """Get list of notification settings for a resource. :param resource_group_name: The name of the resource group. The name @@ -49,27 +49,109 @@ def list_by_resource( :type resource_type: str :param resource_name: Name of the resource. :type resource_name: str + :param skiptoken: The page-continuation token to use with a paged + version of this API. + :type skiptoken: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: NotificationSettingsCollection or ClientRawResponse if - raw=true + :return: An iterator like instance of NotificationSetting :rtype: - ~azure.mgmt.workloadmonitor.models.NotificationSettingsCollection or + ~azure.mgmt.workloadmonitor.models.NotificationSettingPaged[~azure.mgmt.workloadmonitor.models.NotificationSetting] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.NotificationSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NotificationSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, notification_setting_name, custom_headers=None, raw=False, **operation_config): + """Get a of notification setting for a resource. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param notification_setting_name: Name of the notificationSetting + :type notification_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NotificationSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.NotificationSetting or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list_by_resource.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'notificationSettingName': self._serialize.url("notification_setting_name", notification_setting_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -97,17 +179,17 @@ def list_by_resource( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotificationSettingsCollection', response) + deserialized = self._deserialize('NotificationSetting', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName}'} def update( - self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_namespace, resource_type, resource_name, notification_setting_name, custom_headers=None, raw=False, **operation_config): """Update notification settings for a resource. :param resource_group_name: The name of the resource group. The name @@ -119,15 +201,15 @@ def update( :type resource_type: str :param resource_name: Name of the resource. :type resource_name: str + :param notification_setting_name: Name of the notificationSetting + :type notification_setting_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: NotificationSettingsCollection or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.workloadmonitor.models.NotificationSettingsCollection or + :return: NotificationSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.workloadmonitor.models.NotificationSetting or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -141,7 +223,8 @@ def update( 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'notificationSettingName': self._serialize.url("notification_setting_name", notification_setting_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -173,11 +256,11 @@ def update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('NotificationSettingsCollection', response) + deserialized = self._deserialize('NotificationSetting', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName}'} From afdb9225def583403bd03886484eaf56b089ad8a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 27 Nov 2018 17:58:30 +0000 Subject: [PATCH 7/7] Generated from 305f074c9d23cc9b56d817ccfe930886423deb19 manual edit to refer to default parameter --- .../operations/notification_settings_operations.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py index 0b0cdd294a33..27af9b065e5b 100644 --- a/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py +++ b/azure-mgmt-workloadmonitor/azure/mgmt/workloadmonitor/operations/notification_settings_operations.py @@ -23,6 +23,7 @@ class NotificationSettingsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar api_version: The API version to use for this operation. Constant value: "2018-08-31-preview". + :ivar notification_setting_name: Default string modeled as parameter for URL to work correctly. Constant value: "default". """ models = models @@ -33,6 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.api_version = "2018-08-31-preview" + self.notification_setting_name = "default" self.config = config @@ -118,7 +120,7 @@ def internal_paging(next_link=None, raw=False): list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings'} def get( - self, resource_group_name, resource_namespace, resource_type, resource_name, notification_setting_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): """Get a of notification setting for a resource. :param resource_group_name: The name of the resource group. The name @@ -130,8 +132,6 @@ def get( :type resource_type: str :param resource_name: Name of the resource. :type resource_name: str - :param notification_setting_name: Name of the notificationSetting - :type notification_setting_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -151,7 +151,7 @@ def get( 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'notificationSettingName': self._serialize.url("notification_setting_name", notification_setting_name, 'str') + 'notificationSettingName': self._serialize.url("self.notification_setting_name", self.notification_setting_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -189,7 +189,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName}'} def update( - self, resource_group_name, resource_namespace, resource_type, resource_name, notification_setting_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): """Update notification settings for a resource. :param resource_group_name: The name of the resource group. The name @@ -201,8 +201,6 @@ def update( :type resource_type: str :param resource_name: Name of the resource. :type resource_name: str - :param notification_setting_name: Name of the notificationSetting - :type notification_setting_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -224,7 +222,7 @@ def update( 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'notificationSettingName': self._serialize.url("notification_setting_name", notification_setting_name, 'str') + 'notificationSettingName': self._serialize.url("self.notification_setting_name", self.notification_setting_name, 'str') } url = self._client.format_url(url, **path_format_arguments)