diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py index 210f8cfcbcc6..040e7669b667 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'azure-mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py index 4514d1bbbc92..780c93b52583 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py @@ -47,7 +47,7 @@ class MonitorClient(MultiApiClientMixin, _SDKClient): """ DEFAULT_API_VERSION = '2019-10-17-preview' - _PROFILE_TAG = "azure.mgmt.eventhub.MonitorClient" + _PROFILE_TAG = "azure.mgmt.monitor.MonitorClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, @@ -107,25 +107,27 @@ def _models_dict(cls, api_version): def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: - * 2015-04-01: :mod:`v2015_04_01.models` - * 2015-07-01: :mod:`v2015_07_01.models` - * 2016-03-01: :mod:`v2016_03_01.models` - * 2016-09-01: :mod:`v2016_09_01.models` - * 2017-03-01-preview: :mod:`v2017_03_01_preview.models` - * 2017-04-01: :mod:`v2017_04_01.models` - * 2017-05-01-preview: :mod:`v2017_05_01_preview.models` - * 2017-11-01-preview: :mod:`v2017_11_01_preview.models` - * 2017-12-01-preview: :mod:`v2017_12_01_preview.models` - * 2018-01-01: :mod:`v2018_01_01.models` - * 2018-03-01: :mod:`v2018_03_01.models` - * 2018-04-16: :mod:`v2018_04_16.models` - * 2018-06-01-preview: :mod:`v2018_06_01_preview.models` - * 2018-09-01: :mod:`v2018_09_01.models` - * 2018-11-27-preview: :mod:`v2018_11_27_preview.models` - * 2019-03-01: :mod:`v2019_03_01.models` - * 2019-06-01: :mod:`v2019_06_01.models` - * 2019-10-17-preview: :mod:`v2019_10_17.models` - * 2020-01-01-preview: :mod:`v2020_01_01_preview.models` + * 2015-04-01: :mod:`v2015_04_01.models` + * 2015-07-01: :mod:`v2015_07_01.models` + * 2016-03-01: :mod:`v2016_03_01.models` + * 2016-09-01: :mod:`v2016_09_01.models` + * 2017-03-01-preview: :mod:`v2017_03_01_preview.models` + * 2017-04-01: :mod:`v2017_04_01.models` + * 2017-05-01-preview: :mod:`v2017_05_01_preview.models` + * 2017-11-01-preview: :mod:`v2017_11_01_preview.models` + * 2017-12-01-preview: :mod:`v2017_12_01_preview.models` + * 2018-01-01: :mod:`v2018_01_01.models` + * 2018-03-01: :mod:`v2018_03_01.models` + * 2018-04-16: :mod:`v2018_04_16.models` + * 2018-06-01-preview: :mod:`v2018_06_01_preview.models` + * 2018-09-01: :mod:`v2018_09_01.models` + * 2018-11-27-preview: :mod:`v2018_11_27_preview.models` + * 2019-03-01: :mod:`v2019_03_01.models` + * 2019-06-01: :mod:`v2019_06_01.models` + * 2019-10-17-preview: :mod:`v2019_10_17.models` + * 2019-11-01-preview: :mod:`v2019_11_01_preview.models` + * 2020-01-01-preview: :mod:`v2020_01_01_preview.models` + * 2020-05-01-preview: :mod:`v2020_05_01_preview.models` """ if api_version == '2015-04-01': from .v2015_04_01 import models @@ -181,20 +183,26 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-10-17-preview': from .v2019_10_17 import models return models + elif api_version == '2019-11-01-preview': + from .v2019_11_01_preview import models + return models elif api_version == '2020-01-01-preview': from .v2020_01_01_preview import models return models + elif api_version == '2020-05-01-preview': + from .v2020_05_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property def action_groups(self): """Instance depends on the API version: - * 2017-04-01: :class:`ActionGroupsOperations` - * 2018-03-01: :class:`ActionGroupsOperations` - * 2018-09-01: :class:`ActionGroupsOperations` - * 2019-03-01: :class:`ActionGroupsOperations` - * 2019-06-01: :class:`ActionGroupsOperations` + * 2017-04-01: :class:`ActionGroupsOperations` + * 2018-03-01: :class:`ActionGroupsOperations` + * 2018-09-01: :class:`ActionGroupsOperations` + * 2019-03-01: :class:`ActionGroupsOperations` + * 2019-06-01: :class:`ActionGroupsOperations` """ api_version = self._get_api_version('action_groups') if api_version == '2017-04-01': @@ -215,8 +223,8 @@ def action_groups(self): def activity_log_alerts(self): """Instance depends on the API version: - * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` - * 2017-04-01: :class:`ActivityLogAlertsOperations` + * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` + * 2017-04-01: :class:`ActivityLogAlertsOperations` """ api_version = self._get_api_version('activity_log_alerts') if api_version == '2017-03-01-preview': @@ -231,7 +239,7 @@ def activity_log_alerts(self): def activity_logs(self): """Instance depends on the API version: - * 2015-04-01: :class:`ActivityLogsOperations` + * 2015-04-01: :class:`ActivityLogsOperations` """ api_version = self._get_api_version('activity_logs') if api_version == '2015-04-01': @@ -244,7 +252,7 @@ def activity_logs(self): def alert_rule_incidents(self): """Instance depends on the API version: - * 2016-03-01: :class:`AlertRuleIncidentsOperations` + * 2016-03-01: :class:`AlertRuleIncidentsOperations` """ api_version = self._get_api_version('alert_rule_incidents') if api_version == '2016-03-01': @@ -257,7 +265,7 @@ def alert_rule_incidents(self): def alert_rules(self): """Instance depends on the API version: - * 2016-03-01: :class:`AlertRulesOperations` + * 2016-03-01: :class:`AlertRulesOperations` """ api_version = self._get_api_version('alert_rules') if api_version == '2016-03-01': @@ -270,7 +278,7 @@ def alert_rules(self): def autoscale_settings(self): """Instance depends on the API version: - * 2015-04-01: :class:`AutoscaleSettingsOperations` + * 2015-04-01: :class:`AutoscaleSettingsOperations` """ api_version = self._get_api_version('autoscale_settings') if api_version == '2015-04-01': @@ -283,7 +291,7 @@ def autoscale_settings(self): def baseline(self): """Instance depends on the API version: - * 2018-09-01: :class:`BaselineOperations` + * 2018-09-01: :class:`BaselineOperations` """ api_version = self._get_api_version('baseline') if api_version == '2018-09-01': @@ -296,7 +304,7 @@ def baseline(self): def baselines(self): """Instance depends on the API version: - * 2019-03-01: :class:`BaselinesOperations` + * 2019-03-01: :class:`BaselinesOperations` """ api_version = self._get_api_version('baselines') if api_version == '2019-03-01': @@ -305,11 +313,37 @@ def baselines(self): raise ValueError("API version {} does not have operation group 'baselines'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def data_collection_rule_associations(self): + """Instance depends on the API version: + + * 2019-11-01-preview: :class:`DataCollectionRuleAssociationsOperations` + """ + api_version = self._get_api_version('data_collection_rule_associations') + if api_version == '2019-11-01-preview': + from .v2019_11_01_preview.operations import DataCollectionRuleAssociationsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'data_collection_rule_associations'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def data_collection_rules(self): + """Instance depends on the API version: + + * 2019-11-01-preview: :class:`DataCollectionRulesOperations` + """ + api_version = self._get_api_version('data_collection_rules') + if api_version == '2019-11-01-preview': + from .v2019_11_01_preview.operations import DataCollectionRulesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'data_collection_rules'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def diagnostic_settings(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`DiagnosticSettingsOperations` + * 2017-05-01-preview: :class:`DiagnosticSettingsOperations` """ api_version = self._get_api_version('diagnostic_settings') if api_version == '2017-05-01-preview': @@ -322,7 +356,7 @@ def diagnostic_settings(self): def diagnostic_settings_category(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations` + * 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations` """ api_version = self._get_api_version('diagnostic_settings_category') if api_version == '2017-05-01-preview': @@ -335,7 +369,7 @@ def diagnostic_settings_category(self): def event_categories(self): """Instance depends on the API version: - * 2015-04-01: :class:`EventCategoriesOperations` + * 2015-04-01: :class:`EventCategoriesOperations` """ api_version = self._get_api_version('event_categories') if api_version == '2015-04-01': @@ -348,7 +382,7 @@ def event_categories(self): def guest_diagnostics_settings(self): """Instance depends on the API version: - * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` """ api_version = self._get_api_version('guest_diagnostics_settings') if api_version == '2018-06-01-preview': @@ -361,7 +395,7 @@ def guest_diagnostics_settings(self): def guest_diagnostics_settings_association(self): """Instance depends on the API version: - * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` """ api_version = self._get_api_version('guest_diagnostics_settings_association') if api_version == '2018-06-01-preview': @@ -374,7 +408,7 @@ def guest_diagnostics_settings_association(self): def log_profiles(self): """Instance depends on the API version: - * 2016-03-01: :class:`LogProfilesOperations` + * 2016-03-01: :class:`LogProfilesOperations` """ api_version = self._get_api_version('log_profiles') if api_version == '2016-03-01': @@ -387,7 +421,7 @@ def log_profiles(self): def management_group_diagnostic_settings(self): """Instance depends on the API version: - * 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations` + * 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations` """ api_version = self._get_api_version('management_group_diagnostic_settings') if api_version == '2020-01-01-preview': @@ -400,7 +434,7 @@ def management_group_diagnostic_settings(self): def metric_alerts(self): """Instance depends on the API version: - * 2018-03-01: :class:`MetricAlertsOperations` + * 2018-03-01: :class:`MetricAlertsOperations` """ api_version = self._get_api_version('metric_alerts') if api_version == '2018-03-01': @@ -413,7 +447,7 @@ def metric_alerts(self): def metric_alerts_status(self): """Instance depends on the API version: - * 2018-03-01: :class:`MetricAlertsStatusOperations` + * 2018-03-01: :class:`MetricAlertsStatusOperations` """ api_version = self._get_api_version('metric_alerts_status') if api_version == '2018-03-01': @@ -426,8 +460,8 @@ def metric_alerts_status(self): def metric_baseline(self): """Instance depends on the API version: - * 2017-11-01-preview: :class:`MetricBaselineOperations` - * 2018-09-01: :class:`MetricBaselineOperations` + * 2017-11-01-preview: :class:`MetricBaselineOperations` + * 2018-09-01: :class:`MetricBaselineOperations` """ api_version = self._get_api_version('metric_baseline') if api_version == '2017-11-01-preview': @@ -442,9 +476,9 @@ def metric_baseline(self): def metric_definitions(self): """Instance depends on the API version: - * 2016-03-01: :class:`MetricDefinitionsOperations` - * 2017-05-01-preview: :class:`MetricDefinitionsOperations` - * 2018-01-01: :class:`MetricDefinitionsOperations` + * 2016-03-01: :class:`MetricDefinitionsOperations` + * 2017-05-01-preview: :class:`MetricDefinitionsOperations` + * 2018-01-01: :class:`MetricDefinitionsOperations` """ api_version = self._get_api_version('metric_definitions') if api_version == '2016-03-01': @@ -461,7 +495,7 @@ def metric_definitions(self): def metric_namespaces(self): """Instance depends on the API version: - * 2017-12-01-preview: :class:`MetricNamespacesOperations` + * 2017-12-01-preview: :class:`MetricNamespacesOperations` """ api_version = self._get_api_version('metric_namespaces') if api_version == '2017-12-01-preview': @@ -474,9 +508,9 @@ def metric_namespaces(self): def metrics(self): """Instance depends on the API version: - * 2016-09-01: :class:`MetricsOperations` - * 2017-05-01-preview: :class:`MetricsOperations` - * 2018-01-01: :class:`MetricsOperations` + * 2016-09-01: :class:`MetricsOperations` + * 2017-05-01-preview: :class:`MetricsOperations` + * 2018-01-01: :class:`MetricsOperations` """ api_version = self._get_api_version('metrics') if api_version == '2016-09-01': @@ -493,7 +527,7 @@ def metrics(self): def operations(self): """Instance depends on the API version: - * 2015-04-01: :class:`Operations` + * 2015-04-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-04-01': @@ -506,7 +540,7 @@ def operations(self): def private_endpoint_connections(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` + * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-10-17-preview': @@ -519,7 +553,7 @@ def private_endpoint_connections(self): def private_link_resources(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` + * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-10-17-preview': @@ -532,7 +566,7 @@ def private_link_resources(self): def private_link_scope_operation_status(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` """ api_version = self._get_api_version('private_link_scope_operation_status') if api_version == '2019-10-17-preview': @@ -545,7 +579,7 @@ def private_link_scope_operation_status(self): def private_link_scoped_resources(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` """ api_version = self._get_api_version('private_link_scoped_resources') if api_version == '2019-10-17-preview': @@ -558,7 +592,7 @@ def private_link_scoped_resources(self): def private_link_scopes(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` """ api_version = self._get_api_version('private_link_scopes') if api_version == '2019-10-17-preview': @@ -571,11 +605,14 @@ def private_link_scopes(self): def scheduled_query_rules(self): """Instance depends on the API version: - * 2018-04-16: :class:`ScheduledQueryRulesOperations` + * 2018-04-16: :class:`ScheduledQueryRulesOperations` + * 2020-05-01-preview: :class:`ScheduledQueryRulesOperations` """ api_version = self._get_api_version('scheduled_query_rules') if api_version == '2018-04-16': from .v2018_04_16.operations import ScheduledQueryRulesOperations as OperationClass + elif api_version == '2020-05-01-preview': + from .v2020_05_01_preview.operations import ScheduledQueryRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'scheduled_query_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -584,8 +621,8 @@ def scheduled_query_rules(self): def service_diagnostic_settings(self): """Instance depends on the API version: - * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` - * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` + * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` + * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` """ api_version = self._get_api_version('service_diagnostic_settings') if api_version == '2015-07-01': @@ -600,7 +637,7 @@ def service_diagnostic_settings(self): def subscription_diagnostic_settings(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations` + * 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations` """ api_version = self._get_api_version('subscription_diagnostic_settings') if api_version == '2017-05-01-preview': @@ -613,7 +650,7 @@ def subscription_diagnostic_settings(self): def tenant_activity_logs(self): """Instance depends on the API version: - * 2015-04-01: :class:`TenantActivityLogsOperations` + * 2015-04-01: :class:`TenantActivityLogsOperations` """ api_version = self._get_api_version('tenant_activity_logs') if api_version == '2015-04-01': @@ -626,7 +663,7 @@ def tenant_activity_logs(self): def vm_insights(self): """Instance depends on the API version: - * 2018-11-27-preview: :class:`VMInsightsOperations` + * 2018-11-27-preview: :class:`VMInsightsOperations` """ api_version = self._get_api_version('vm_insights') if api_version == '2018-11-27-preview': diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py index fe15f823d1a5..92cc931fa7a5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py @@ -44,7 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'azure-mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py index 0eee1823d96e..0b232c56ec35 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py @@ -47,7 +47,7 @@ class MonitorClient(MultiApiClientMixin, _SDKClient): """ DEFAULT_API_VERSION = '2019-10-17-preview' - _PROFILE_TAG = "azure.mgmt.eventhub.MonitorClient" + _PROFILE_TAG = "azure.mgmt.monitor.MonitorClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, @@ -107,25 +107,27 @@ def _models_dict(cls, api_version): def models(cls, api_version=DEFAULT_API_VERSION): """Module depends on the API version: - * 2015-04-01: :mod:`v2015_04_01.models` - * 2015-07-01: :mod:`v2015_07_01.models` - * 2016-03-01: :mod:`v2016_03_01.models` - * 2016-09-01: :mod:`v2016_09_01.models` - * 2017-03-01-preview: :mod:`v2017_03_01_preview.models` - * 2017-04-01: :mod:`v2017_04_01.models` - * 2017-05-01-preview: :mod:`v2017_05_01_preview.models` - * 2017-11-01-preview: :mod:`v2017_11_01_preview.models` - * 2017-12-01-preview: :mod:`v2017_12_01_preview.models` - * 2018-01-01: :mod:`v2018_01_01.models` - * 2018-03-01: :mod:`v2018_03_01.models` - * 2018-04-16: :mod:`v2018_04_16.models` - * 2018-06-01-preview: :mod:`v2018_06_01_preview.models` - * 2018-09-01: :mod:`v2018_09_01.models` - * 2018-11-27-preview: :mod:`v2018_11_27_preview.models` - * 2019-03-01: :mod:`v2019_03_01.models` - * 2019-06-01: :mod:`v2019_06_01.models` - * 2019-10-17-preview: :mod:`v2019_10_17.models` - * 2020-01-01-preview: :mod:`v2020_01_01_preview.models` + * 2015-04-01: :mod:`v2015_04_01.models` + * 2015-07-01: :mod:`v2015_07_01.models` + * 2016-03-01: :mod:`v2016_03_01.models` + * 2016-09-01: :mod:`v2016_09_01.models` + * 2017-03-01-preview: :mod:`v2017_03_01_preview.models` + * 2017-04-01: :mod:`v2017_04_01.models` + * 2017-05-01-preview: :mod:`v2017_05_01_preview.models` + * 2017-11-01-preview: :mod:`v2017_11_01_preview.models` + * 2017-12-01-preview: :mod:`v2017_12_01_preview.models` + * 2018-01-01: :mod:`v2018_01_01.models` + * 2018-03-01: :mod:`v2018_03_01.models` + * 2018-04-16: :mod:`v2018_04_16.models` + * 2018-06-01-preview: :mod:`v2018_06_01_preview.models` + * 2018-09-01: :mod:`v2018_09_01.models` + * 2018-11-27-preview: :mod:`v2018_11_27_preview.models` + * 2019-03-01: :mod:`v2019_03_01.models` + * 2019-06-01: :mod:`v2019_06_01.models` + * 2019-10-17-preview: :mod:`v2019_10_17.models` + * 2019-11-01-preview: :mod:`v2019_11_01_preview.models` + * 2020-01-01-preview: :mod:`v2020_01_01_preview.models` + * 2020-05-01-preview: :mod:`v2020_05_01_preview.models` """ if api_version == '2015-04-01': from ..v2015_04_01 import models @@ -181,20 +183,26 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-10-17-preview': from ..v2019_10_17 import models return models + elif api_version == '2019-11-01-preview': + from ..v2019_11_01_preview import models + return models elif api_version == '2020-01-01-preview': from ..v2020_01_01_preview import models return models + elif api_version == '2020-05-01-preview': + from ..v2020_05_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property def action_groups(self): """Instance depends on the API version: - * 2017-04-01: :class:`ActionGroupsOperations` - * 2018-03-01: :class:`ActionGroupsOperations` - * 2018-09-01: :class:`ActionGroupsOperations` - * 2019-03-01: :class:`ActionGroupsOperations` - * 2019-06-01: :class:`ActionGroupsOperations` + * 2017-04-01: :class:`ActionGroupsOperations` + * 2018-03-01: :class:`ActionGroupsOperations` + * 2018-09-01: :class:`ActionGroupsOperations` + * 2019-03-01: :class:`ActionGroupsOperations` + * 2019-06-01: :class:`ActionGroupsOperations` """ api_version = self._get_api_version('action_groups') if api_version == '2017-04-01': @@ -215,8 +223,8 @@ def action_groups(self): def activity_log_alerts(self): """Instance depends on the API version: - * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` - * 2017-04-01: :class:`ActivityLogAlertsOperations` + * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` + * 2017-04-01: :class:`ActivityLogAlertsOperations` """ api_version = self._get_api_version('activity_log_alerts') if api_version == '2017-03-01-preview': @@ -231,7 +239,7 @@ def activity_log_alerts(self): def activity_logs(self): """Instance depends on the API version: - * 2015-04-01: :class:`ActivityLogsOperations` + * 2015-04-01: :class:`ActivityLogsOperations` """ api_version = self._get_api_version('activity_logs') if api_version == '2015-04-01': @@ -244,7 +252,7 @@ def activity_logs(self): def alert_rule_incidents(self): """Instance depends on the API version: - * 2016-03-01: :class:`AlertRuleIncidentsOperations` + * 2016-03-01: :class:`AlertRuleIncidentsOperations` """ api_version = self._get_api_version('alert_rule_incidents') if api_version == '2016-03-01': @@ -257,7 +265,7 @@ def alert_rule_incidents(self): def alert_rules(self): """Instance depends on the API version: - * 2016-03-01: :class:`AlertRulesOperations` + * 2016-03-01: :class:`AlertRulesOperations` """ api_version = self._get_api_version('alert_rules') if api_version == '2016-03-01': @@ -270,7 +278,7 @@ def alert_rules(self): def autoscale_settings(self): """Instance depends on the API version: - * 2015-04-01: :class:`AutoscaleSettingsOperations` + * 2015-04-01: :class:`AutoscaleSettingsOperations` """ api_version = self._get_api_version('autoscale_settings') if api_version == '2015-04-01': @@ -283,7 +291,7 @@ def autoscale_settings(self): def baseline(self): """Instance depends on the API version: - * 2018-09-01: :class:`BaselineOperations` + * 2018-09-01: :class:`BaselineOperations` """ api_version = self._get_api_version('baseline') if api_version == '2018-09-01': @@ -296,7 +304,7 @@ def baseline(self): def baselines(self): """Instance depends on the API version: - * 2019-03-01: :class:`BaselinesOperations` + * 2019-03-01: :class:`BaselinesOperations` """ api_version = self._get_api_version('baselines') if api_version == '2019-03-01': @@ -305,11 +313,37 @@ def baselines(self): raise ValueError("API version {} does not have operation group 'baselines'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def data_collection_rule_associations(self): + """Instance depends on the API version: + + * 2019-11-01-preview: :class:`DataCollectionRuleAssociationsOperations` + """ + api_version = self._get_api_version('data_collection_rule_associations') + if api_version == '2019-11-01-preview': + from ..v2019_11_01_preview.aio.operations import DataCollectionRuleAssociationsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'data_collection_rule_associations'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def data_collection_rules(self): + """Instance depends on the API version: + + * 2019-11-01-preview: :class:`DataCollectionRulesOperations` + """ + api_version = self._get_api_version('data_collection_rules') + if api_version == '2019-11-01-preview': + from ..v2019_11_01_preview.aio.operations import DataCollectionRulesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'data_collection_rules'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def diagnostic_settings(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`DiagnosticSettingsOperations` + * 2017-05-01-preview: :class:`DiagnosticSettingsOperations` """ api_version = self._get_api_version('diagnostic_settings') if api_version == '2017-05-01-preview': @@ -322,7 +356,7 @@ def diagnostic_settings(self): def diagnostic_settings_category(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations` + * 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations` """ api_version = self._get_api_version('diagnostic_settings_category') if api_version == '2017-05-01-preview': @@ -335,7 +369,7 @@ def diagnostic_settings_category(self): def event_categories(self): """Instance depends on the API version: - * 2015-04-01: :class:`EventCategoriesOperations` + * 2015-04-01: :class:`EventCategoriesOperations` """ api_version = self._get_api_version('event_categories') if api_version == '2015-04-01': @@ -348,7 +382,7 @@ def event_categories(self): def guest_diagnostics_settings(self): """Instance depends on the API version: - * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` """ api_version = self._get_api_version('guest_diagnostics_settings') if api_version == '2018-06-01-preview': @@ -361,7 +395,7 @@ def guest_diagnostics_settings(self): def guest_diagnostics_settings_association(self): """Instance depends on the API version: - * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` """ api_version = self._get_api_version('guest_diagnostics_settings_association') if api_version == '2018-06-01-preview': @@ -374,7 +408,7 @@ def guest_diagnostics_settings_association(self): def log_profiles(self): """Instance depends on the API version: - * 2016-03-01: :class:`LogProfilesOperations` + * 2016-03-01: :class:`LogProfilesOperations` """ api_version = self._get_api_version('log_profiles') if api_version == '2016-03-01': @@ -387,7 +421,7 @@ def log_profiles(self): def management_group_diagnostic_settings(self): """Instance depends on the API version: - * 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations` + * 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations` """ api_version = self._get_api_version('management_group_diagnostic_settings') if api_version == '2020-01-01-preview': @@ -400,7 +434,7 @@ def management_group_diagnostic_settings(self): def metric_alerts(self): """Instance depends on the API version: - * 2018-03-01: :class:`MetricAlertsOperations` + * 2018-03-01: :class:`MetricAlertsOperations` """ api_version = self._get_api_version('metric_alerts') if api_version == '2018-03-01': @@ -413,7 +447,7 @@ def metric_alerts(self): def metric_alerts_status(self): """Instance depends on the API version: - * 2018-03-01: :class:`MetricAlertsStatusOperations` + * 2018-03-01: :class:`MetricAlertsStatusOperations` """ api_version = self._get_api_version('metric_alerts_status') if api_version == '2018-03-01': @@ -426,8 +460,8 @@ def metric_alerts_status(self): def metric_baseline(self): """Instance depends on the API version: - * 2017-11-01-preview: :class:`MetricBaselineOperations` - * 2018-09-01: :class:`MetricBaselineOperations` + * 2017-11-01-preview: :class:`MetricBaselineOperations` + * 2018-09-01: :class:`MetricBaselineOperations` """ api_version = self._get_api_version('metric_baseline') if api_version == '2017-11-01-preview': @@ -442,9 +476,9 @@ def metric_baseline(self): def metric_definitions(self): """Instance depends on the API version: - * 2016-03-01: :class:`MetricDefinitionsOperations` - * 2017-05-01-preview: :class:`MetricDefinitionsOperations` - * 2018-01-01: :class:`MetricDefinitionsOperations` + * 2016-03-01: :class:`MetricDefinitionsOperations` + * 2017-05-01-preview: :class:`MetricDefinitionsOperations` + * 2018-01-01: :class:`MetricDefinitionsOperations` """ api_version = self._get_api_version('metric_definitions') if api_version == '2016-03-01': @@ -461,7 +495,7 @@ def metric_definitions(self): def metric_namespaces(self): """Instance depends on the API version: - * 2017-12-01-preview: :class:`MetricNamespacesOperations` + * 2017-12-01-preview: :class:`MetricNamespacesOperations` """ api_version = self._get_api_version('metric_namespaces') if api_version == '2017-12-01-preview': @@ -474,9 +508,9 @@ def metric_namespaces(self): def metrics(self): """Instance depends on the API version: - * 2016-09-01: :class:`MetricsOperations` - * 2017-05-01-preview: :class:`MetricsOperations` - * 2018-01-01: :class:`MetricsOperations` + * 2016-09-01: :class:`MetricsOperations` + * 2017-05-01-preview: :class:`MetricsOperations` + * 2018-01-01: :class:`MetricsOperations` """ api_version = self._get_api_version('metrics') if api_version == '2016-09-01': @@ -493,7 +527,7 @@ def metrics(self): def operations(self): """Instance depends on the API version: - * 2015-04-01: :class:`Operations` + * 2015-04-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-04-01': @@ -506,7 +540,7 @@ def operations(self): def private_endpoint_connections(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` + * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-10-17-preview': @@ -519,7 +553,7 @@ def private_endpoint_connections(self): def private_link_resources(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` + * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-10-17-preview': @@ -532,7 +566,7 @@ def private_link_resources(self): def private_link_scope_operation_status(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` """ api_version = self._get_api_version('private_link_scope_operation_status') if api_version == '2019-10-17-preview': @@ -545,7 +579,7 @@ def private_link_scope_operation_status(self): def private_link_scoped_resources(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` """ api_version = self._get_api_version('private_link_scoped_resources') if api_version == '2019-10-17-preview': @@ -558,7 +592,7 @@ def private_link_scoped_resources(self): def private_link_scopes(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` """ api_version = self._get_api_version('private_link_scopes') if api_version == '2019-10-17-preview': @@ -571,11 +605,14 @@ def private_link_scopes(self): def scheduled_query_rules(self): """Instance depends on the API version: - * 2018-04-16: :class:`ScheduledQueryRulesOperations` + * 2018-04-16: :class:`ScheduledQueryRulesOperations` + * 2020-05-01-preview: :class:`ScheduledQueryRulesOperations` """ api_version = self._get_api_version('scheduled_query_rules') if api_version == '2018-04-16': from ..v2018_04_16.aio.operations import ScheduledQueryRulesOperations as OperationClass + elif api_version == '2020-05-01-preview': + from ..v2020_05_01_preview.aio.operations import ScheduledQueryRulesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'scheduled_query_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -584,8 +621,8 @@ def scheduled_query_rules(self): def service_diagnostic_settings(self): """Instance depends on the API version: - * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` - * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` + * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` + * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` """ api_version = self._get_api_version('service_diagnostic_settings') if api_version == '2015-07-01': @@ -600,7 +637,7 @@ def service_diagnostic_settings(self): def subscription_diagnostic_settings(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations` + * 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations` """ api_version = self._get_api_version('subscription_diagnostic_settings') if api_version == '2017-05-01-preview': @@ -613,7 +650,7 @@ def subscription_diagnostic_settings(self): def tenant_activity_logs(self): """Instance depends on the API version: - * 2015-04-01: :class:`TenantActivityLogsOperations` + * 2015-04-01: :class:`TenantActivityLogsOperations` """ api_version = self._get_api_version('tenant_activity_logs') if api_version == '2015-04-01': @@ -626,7 +663,7 @@ def tenant_activity_logs(self): def vm_insights(self): """Instance depends on the API version: - * 2018-11-27-preview: :class:`VMInsightsOperations` + * 2018-11-27-preview: :class:`VMInsightsOperations` """ api_version = self._get_api_version('vm_insights') if api_version == '2018-11-27-preview': diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py index bf2db0f8d6c6..ae292817b926 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2015-04-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json index ac34301c5de6..1bfad01ebaf8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py index ad2470ff3b5c..12c17c0e5640 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py @@ -61,7 +61,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_logs = ActivityLogsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py index 4ea79ca49ff1..42ccbe294fe8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2015-04-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py index aa5072375263..49a3d51d351f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py @@ -58,7 +58,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_logs = ActivityLogsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py index 23732a644d20..7891b73a9d1e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActivityLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( filter: str, select: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.EventDataCollection"]: + ) -> AsyncIterable["_models.EventDataCollection"]: """Provides the list of records from the activity logs. :param filter: Reduces the set of data collected.:code:`
`This argument is required and it @@ -77,7 +77,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -125,7 +125,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py index 6f9308cb7616..8b6c08b0d51a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AutoscaleSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AutoscaleSettingResourceCollection"]: + ) -> AsyncIterable["_models.AutoscaleSettingResourceCollection"]: """Lists the autoscale settings for a resource group. :param resource_group_name: The name of the resource group. @@ -55,7 +55,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,7 +101,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -116,9 +116,9 @@ async def create_or_update( self, resource_group_name: str, autoscale_setting_name: str, - parameters: "models.AutoscaleSettingResource", + parameters: "_models.AutoscaleSettingResource", **kwargs - ) -> "models.AutoscaleSettingResource": + ) -> "_models.AutoscaleSettingResource": """Creates or updates an autoscale setting. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -231,7 +231,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -244,7 +244,7 @@ async def get( resource_group_name: str, autoscale_setting_name: str, **kwargs - ) -> "models.AutoscaleSettingResource": + ) -> "_models.AutoscaleSettingResource": """Gets an autoscale setting. :param resource_group_name: The name of the resource group. @@ -256,7 +256,7 @@ async def get( :rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +287,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response) @@ -302,9 +302,9 @@ async def update( self, resource_group_name: str, autoscale_setting_name: str, - autoscale_setting_resource: "models.AutoscaleSettingResourcePatch", + autoscale_setting_resource: "_models.AutoscaleSettingResourcePatch", **kwargs - ) -> "models.AutoscaleSettingResource": + ) -> "_models.AutoscaleSettingResource": """Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. @@ -319,7 +319,7 @@ async def update( :rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -355,7 +355,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response) @@ -369,7 +369,7 @@ async def update( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.AutoscaleSettingResourceCollection"]: + ) -> AsyncIterable["_models.AutoscaleSettingResourceCollection"]: """Lists the autoscale settings for a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -377,7 +377,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py index 2d89bb1788a9..5ec63467bb15 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EventCategoriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.EventCategoryCollection"]: + ) -> AsyncIterable["_models.EventCategoryCollection"]: """Get the list of available event categories supported in the Activity Logs Service.:code:`
`The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventCategoryCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventCategoryCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventCategoryCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -95,7 +95,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py index e7b2c8a4ab23..ba5eac551697 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, **kwargs - ) -> "models.OperationListResult": + ) -> "_models.OperationListResult": """Lists all of the available operations from Microsoft.Insights provider. :keyword callable cls: A custom type or function that will be passed the direct response @@ -51,7 +51,7 @@ async def list( :rtype: ~$(python-base-namespace).v2015_04_01.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py index ccc43fec7b3a..605d7a793407 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class TenantActivityLogsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( filter: Optional[str] = None, select: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.EventDataCollection"]: + ) -> AsyncIterable["_models.EventDataCollection"]: """Gets the Activity Logs for the Tenant.:code:`
`Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).:code:`
`One thing to point out here is that this API does *not* retrieve the logs at @@ -81,7 +81,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py index 8a391fdfaba6..96a18678e754 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActivityLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( select=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.EventDataCollection"] + # type: (...) -> Iterable["_models.EventDataCollection"] """Provides the list of records from the activity logs. :param filter: Reduces the set of data collected.:code:`
`This argument is required and it @@ -82,7 +82,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -130,7 +130,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py index 3a8c481762d8..0d0d541a15c5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AutoscaleSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoscaleSettingResourceCollection"] + # type: (...) -> Iterable["_models.AutoscaleSettingResourceCollection"] """Lists the autoscale settings for a resource group. :param resource_group_name: The name of the resource group. @@ -60,7 +60,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -121,10 +121,10 @@ def create_or_update( self, resource_group_name, # type: str autoscale_setting_name, # type: str - parameters, # type: "models.AutoscaleSettingResource" + parameters, # type: "_models.AutoscaleSettingResource" **kwargs # type: Any ): - # type: (...) -> "models.AutoscaleSettingResource" + # type: (...) -> "_models.AutoscaleSettingResource" """Creates or updates an autoscale setting. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -238,7 +238,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -252,7 +252,7 @@ def get( autoscale_setting_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AutoscaleSettingResource" + # type: (...) -> "_models.AutoscaleSettingResource" """Gets an autoscale setting. :param resource_group_name: The name of the resource group. @@ -264,7 +264,7 @@ def get( :rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +295,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response) @@ -310,10 +310,10 @@ def update( self, resource_group_name, # type: str autoscale_setting_name, # type: str - autoscale_setting_resource, # type: "models.AutoscaleSettingResourcePatch" + autoscale_setting_resource, # type: "_models.AutoscaleSettingResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.AutoscaleSettingResource" + # type: (...) -> "_models.AutoscaleSettingResource" """Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. @@ -328,7 +328,7 @@ def update( :rtype: ~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response) @@ -379,7 +379,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AutoscaleSettingResourceCollection"] + # type: (...) -> Iterable["_models.AutoscaleSettingResourceCollection"] """Lists the autoscale settings for a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -387,7 +387,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2015_04_01.models.AutoscaleSettingResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AutoscaleSettingResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -432,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py index 1ee3dc853cc2..a694d451cfc9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EventCategoriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.EventCategoryCollection"] + # type: (...) -> Iterable["_models.EventCategoryCollection"] """Get the list of available event categories supported in the Activity Logs Service.:code:`
`The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2015_04_01.models.EventCategoryCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventCategoryCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventCategoryCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py index 97f40d98c276..6135ddd2958a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,7 +48,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> "models.OperationListResult" + # type: (...) -> "_models.OperationListResult" """Lists all of the available operations from Microsoft.Insights provider. :keyword callable cls: A custom type or function that will be passed the direct response @@ -56,7 +56,7 @@ def list( :rtype: ~$(python-base-namespace).v2015_04_01.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py index 63bddb7997c6..b16eb5426291 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class TenantActivityLogsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( select=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.EventDataCollection"] + # type: (...) -> Iterable["_models.EventDataCollection"] """Gets the Activity Logs for the Tenant.:code:`
`Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).:code:`
`One thing to point out here is that this API does *not* retrieve the logs at @@ -86,7 +86,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -131,7 +131,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py index 8caff7d56cc6..4f0397e71c6c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2015-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json index a1b4338f57bb..bf81eebe53ac 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py index 5e9c7e79f9fc..6c1e84062442 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py index 5ab782355f00..c960e2b75614 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2015-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py index 769c111b861a..6d9cad39ce90 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py @@ -43,7 +43,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py index a0b7bc888b53..6032168120e4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceDiagnosticSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def get( self, resource_uri: str, **kwargs - ) -> "models.ServiceDiagnosticSettingsResource": + ) -> "_models.ServiceDiagnosticSettingsResource": """Gets the active diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -54,7 +54,7 @@ async def get( :rtype: ~$(python-base-namespace).v2015_07_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -83,7 +83,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ServiceDiagnosticSettingsResource', pipeline_response) @@ -97,9 +97,9 @@ async def get( async def create_or_update( self, resource_uri: str, - parameters: "models.ServiceDiagnosticSettingsResource", + parameters: "_models.ServiceDiagnosticSettingsResource", **kwargs - ) -> "models.ServiceDiagnosticSettingsResource": + ) -> "_models.ServiceDiagnosticSettingsResource": """Create or update new diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -111,7 +111,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2015_07_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py index 34b3c8e99fd8..b5d62a28a532 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceDiagnosticSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get( resource_uri, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceDiagnosticSettingsResource" + # type: (...) -> "_models.ServiceDiagnosticSettingsResource" """Gets the active diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -59,7 +59,7 @@ def get( :rtype: ~$(python-base-namespace).v2015_07_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ServiceDiagnosticSettingsResource', pipeline_response) @@ -102,10 +102,10 @@ def get( def create_or_update( self, resource_uri, # type: str - parameters, # type: "models.ServiceDiagnosticSettingsResource" + parameters, # type: "_models.ServiceDiagnosticSettingsResource" **kwargs # type: Any ): - # type: (...) -> "models.ServiceDiagnosticSettingsResource" + # type: (...) -> "_models.ServiceDiagnosticSettingsResource" """Create or update new diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -117,7 +117,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2015_07_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py index 49690a03aabb..517bbc592374 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2016-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json index e835b0d273c5..ab51cc29b338 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py index bdaa63669345..196a6787f78e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py @@ -58,7 +58,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.alert_rule_incidents = AlertRuleIncidentsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py index b656b9a5b462..f93b57ada19a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2016-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py index b4decfae27d6..47a25adf7d78 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py @@ -55,7 +55,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.alert_rule_incidents = AlertRuleIncidentsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py index bb6896d7def2..55c06f896b2b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AlertRuleIncidentsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( rule_name: str, incident_name: str, **kwargs - ) -> "models.Incident": + ) -> "_models.Incident": """Gets an incident associated to an alert rule. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def get( :rtype: ~$(python-base-namespace).v2016_03_01.models.Incident :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Incident"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Incident"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Incident', pipeline_response) @@ -109,7 +109,7 @@ def list_by_alert_rule( resource_group_name: str, rule_name: str, **kwargs - ) -> AsyncIterable["models.IncidentListResult"]: + ) -> AsyncIterable["_models.IncidentListResult"]: """Gets a list of incidents associated to an alert rule. :param resource_group_name: The name of the resource group. @@ -121,7 +121,7 @@ def list_by_alert_rule( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2016_03_01.models.IncidentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IncidentListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IncidentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py index 7c88bc63ec65..eaae66796a3a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AlertRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, rule_name: str, - parameters: "models.AlertRuleResource", + parameters: "_models.AlertRuleResource", **kwargs - ) -> "models.AlertRuleResource": + ) -> "_models.AlertRuleResource": """Creates or updates a classic metric alert rule. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2016_03_01.models.AlertRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -170,7 +170,7 @@ async def get( resource_group_name: str, rule_name: str, **kwargs - ) -> "models.AlertRuleResource": + ) -> "_models.AlertRuleResource": """Gets a classic metric alert rule. :param resource_group_name: The name of the resource group. @@ -182,7 +182,7 @@ async def get( :rtype: ~$(python-base-namespace).v2016_03_01.models.AlertRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,9 +227,9 @@ async def update( self, resource_group_name: str, rule_name: str, - alert_rules_resource: "models.AlertRuleResourcePatch", + alert_rules_resource: "_models.AlertRuleResourcePatch", **kwargs - ) -> "models.AlertRuleResource": + ) -> "_models.AlertRuleResource": """Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. @@ -244,7 +244,7 @@ async def update( :rtype: ~$(python-base-namespace).v2016_03_01.models.AlertRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -280,7 +280,7 @@ async def update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -299,7 +299,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AlertRuleResourceCollection"]: + ) -> AsyncIterable["_models.AlertRuleResourceCollection"]: """List the classic metric alert rules within a resource group. :param resource_group_name: The name of the resource group. @@ -309,7 +309,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2016_03_01.models.AlertRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,7 +368,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.AlertRuleResourceCollection"]: + ) -> AsyncIterable["_models.AlertRuleResourceCollection"]: """List the classic metric alert rules within a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -376,7 +376,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2016_03_01.models.AlertRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py index c8d95ea6e079..786981108d81 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class LogProfilesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -94,7 +94,7 @@ async def get( self, log_profile_name: str, **kwargs - ) -> "models.LogProfileResource": + ) -> "_models.LogProfileResource": """Gets the log profile. :param log_profile_name: The name of the log profile. @@ -104,7 +104,7 @@ async def get( :rtype: ~$(python-base-namespace).v2016_03_01.models.LogProfileResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogProfileResource', pipeline_response) @@ -148,9 +148,9 @@ async def get( async def create_or_update( self, log_profile_name: str, - parameters: "models.LogProfileResource", + parameters: "_models.LogProfileResource", **kwargs - ) -> "models.LogProfileResource": + ) -> "_models.LogProfileResource": """Create or update a log profile in Azure Monitoring REST API. :param log_profile_name: The name of the log profile. @@ -162,7 +162,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2016_03_01.models.LogProfileResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -210,9 +210,9 @@ async def create_or_update( async def update( self, log_profile_name: str, - log_profiles_resource: "models.LogProfileResourcePatch", + log_profiles_resource: "_models.LogProfileResourcePatch", **kwargs - ) -> "models.LogProfileResource": + ) -> "_models.LogProfileResource": """Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. :param log_profile_name: The name of the log profile. @@ -224,7 +224,7 @@ async def update( :rtype: ~$(python-base-namespace).v2016_03_01.models.LogProfileResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -259,7 +259,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogProfileResource', pipeline_response) @@ -273,7 +273,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.LogProfileCollection"]: + ) -> AsyncIterable["_models.LogProfileCollection"]: """List the log profiles. :keyword callable cls: A custom type or function that will be passed the direct response @@ -281,7 +281,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2016_03_01.models.LogProfileCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py index d788e2c65ddd..c4dbe2449afe 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_uri: str, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.MetricDefinitionCollection"]: + ) -> AsyncIterable["_models.MetricDefinitionCollection"]: """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2016_03_01.models.MetricDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py index 71471635a72b..054934826b31 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AlertRuleIncidentsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( incident_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Incident" + # type: (...) -> "_models.Incident" """Gets an incident associated to an alert rule. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def get( :rtype: ~$(python-base-namespace).v2016_03_01.models.Incident :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Incident"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Incident"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Incident', pipeline_response) @@ -115,7 +115,7 @@ def list_by_alert_rule( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IncidentListResult"] + # type: (...) -> Iterable["_models.IncidentListResult"] """Gets a list of incidents associated to an alert rule. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ def list_by_alert_rule( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2016_03_01.models.IncidentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IncidentListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IncidentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py index 16ce47ce66af..4193d89ea525 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AlertRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str rule_name, # type: str - parameters, # type: "models.AlertRuleResource" + parameters, # type: "_models.AlertRuleResource" **kwargs # type: Any ): - # type: (...) -> "models.AlertRuleResource" + # type: (...) -> "_models.AlertRuleResource" """Creates or updates a classic metric alert rule. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2016_03_01.models.AlertRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -177,7 +177,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AlertRuleResource" + # type: (...) -> "_models.AlertRuleResource" """Gets a classic metric alert rule. :param resource_group_name: The name of the resource group. @@ -189,7 +189,7 @@ def get( :rtype: ~$(python-base-namespace).v2016_03_01.models.AlertRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,10 +234,10 @@ def update( self, resource_group_name, # type: str rule_name, # type: str - alert_rules_resource, # type: "models.AlertRuleResourcePatch" + alert_rules_resource, # type: "_models.AlertRuleResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.AlertRuleResource" + # type: (...) -> "_models.AlertRuleResource" """Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. @@ -252,7 +252,7 @@ def update( :rtype: ~$(python-base-namespace).v2016_03_01.models.AlertRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -308,7 +308,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AlertRuleResourceCollection"] + # type: (...) -> Iterable["_models.AlertRuleResourceCollection"] """List the classic metric alert rules within a resource group. :param resource_group_name: The name of the resource group. @@ -318,7 +318,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2016_03_01.models.AlertRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -378,7 +378,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AlertRuleResourceCollection"] + # type: (...) -> Iterable["_models.AlertRuleResourceCollection"] """List the classic metric alert rules within a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -386,7 +386,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2016_03_01.models.AlertRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py index ee2669c3ce8f..742c69dc8f22 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class LogProfilesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -100,7 +100,7 @@ def get( log_profile_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LogProfileResource" + # type: (...) -> "_models.LogProfileResource" """Gets the log profile. :param log_profile_name: The name of the log profile. @@ -110,7 +110,7 @@ def get( :rtype: ~$(python-base-namespace).v2016_03_01.models.LogProfileResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -140,7 +140,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogProfileResource', pipeline_response) @@ -154,10 +154,10 @@ def get( def create_or_update( self, log_profile_name, # type: str - parameters, # type: "models.LogProfileResource" + parameters, # type: "_models.LogProfileResource" **kwargs # type: Any ): - # type: (...) -> "models.LogProfileResource" + # type: (...) -> "_models.LogProfileResource" """Create or update a log profile in Azure Monitoring REST API. :param log_profile_name: The name of the log profile. @@ -169,7 +169,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2016_03_01.models.LogProfileResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -217,10 +217,10 @@ def create_or_update( def update( self, log_profile_name, # type: str - log_profiles_resource, # type: "models.LogProfileResourcePatch" + log_profiles_resource, # type: "_models.LogProfileResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.LogProfileResource" + # type: (...) -> "_models.LogProfileResource" """Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. :param log_profile_name: The name of the log profile. @@ -232,7 +232,7 @@ def update( :rtype: ~$(python-base-namespace).v2016_03_01.models.LogProfileResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,7 +267,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogProfileResource', pipeline_response) @@ -282,7 +282,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.LogProfileCollection"] + # type: (...) -> Iterable["_models.LogProfileCollection"] """List the log profiles. :keyword callable cls: A custom type or function that will be passed the direct response @@ -290,7 +290,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2016_03_01.models.LogProfileCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogProfileCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py index 2e0ed174ea4d..dd1a67a25320 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricDefinitionCollection"] + # type: (...) -> Iterable["_models.MetricDefinitionCollection"] """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. @@ -68,7 +68,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2016_03_01.models.MetricDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,7 +115,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py index 06cfd9215638..c3607ad334d1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2016-09-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json index 9d418ad87650..a9ebbe9478d4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py index bab11451938d..3b7995ae4a4c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metrics = MetricsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py index 556fbaa2c95d..e4edee68690c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2016-09-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py index 46a3165ac3e5..9cfa6badc4d0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metrics = MetricsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py index d22879a77d72..a16847bb3ecd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_uri: str, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.MetricCollection"]: + ) -> AsyncIterable["_models.MetricCollection"]: """Lists the metric values for a resource. :param resource_uri: The identifier of the resource. @@ -75,7 +75,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2016_09_01.models.MetricCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py index b95f7509def4..44549740b556 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ServiceDiagnosticSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def get( self, resource_uri: str, **kwargs - ) -> "models.ServiceDiagnosticSettingsResource": + ) -> "_models.ServiceDiagnosticSettingsResource": """Gets the active diagnostic settings for the specified resource. **WARNING**\ : This method will be deprecated in future releases. @@ -55,7 +55,7 @@ async def get( :rtype: ~$(python-base-namespace).v2016_09_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ServiceDiagnosticSettingsResource', pipeline_response) @@ -98,9 +98,9 @@ async def get( async def create_or_update( self, resource_uri: str, - parameters: "models.ServiceDiagnosticSettingsResource", + parameters: "_models.ServiceDiagnosticSettingsResource", **kwargs - ) -> "models.ServiceDiagnosticSettingsResource": + ) -> "_models.ServiceDiagnosticSettingsResource": """Create or update new diagnostic settings for the specified resource. **WARNING**\ : This method will be deprecated in future releases. @@ -113,7 +113,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2016_09_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,9 +160,9 @@ async def create_or_update( async def update( self, resource_uri: str, - service_diagnostic_settings_resource: "models.ServiceDiagnosticSettingsResourcePatch", + service_diagnostic_settings_resource: "_models.ServiceDiagnosticSettingsResourcePatch", **kwargs - ) -> "models.ServiceDiagnosticSettingsResource": + ) -> "_models.ServiceDiagnosticSettingsResource": """Updates an existing ServiceDiagnosticSettingsResource. To update other fields use the CreateOrUpdate method. **WARNING**\ : This method will be deprecated in future releases. @@ -175,7 +175,7 @@ async def update( :rtype: ~$(python-base-namespace).v2016_09_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -209,7 +209,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ServiceDiagnosticSettingsResource', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py index 07de5370bc39..cdf6a8557a8d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricCollection"] + # type: (...) -> Iterable["_models.MetricCollection"] """Lists the metric values for a resource. :param resource_uri: The identifier of the resource. @@ -80,7 +80,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2016_09_01.models.MetricCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py index 9d3dceb5e785..4bf7526dd8b1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ServiceDiagnosticSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get( resource_uri, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ServiceDiagnosticSettingsResource" + # type: (...) -> "_models.ServiceDiagnosticSettingsResource" """Gets the active diagnostic settings for the specified resource. **WARNING**\ : This method will be deprecated in future releases. @@ -60,7 +60,7 @@ def get( :rtype: ~$(python-base-namespace).v2016_09_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -89,7 +89,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ServiceDiagnosticSettingsResource', pipeline_response) @@ -103,10 +103,10 @@ def get( def create_or_update( self, resource_uri, # type: str - parameters, # type: "models.ServiceDiagnosticSettingsResource" + parameters, # type: "_models.ServiceDiagnosticSettingsResource" **kwargs # type: Any ): - # type: (...) -> "models.ServiceDiagnosticSettingsResource" + # type: (...) -> "_models.ServiceDiagnosticSettingsResource" """Create or update new diagnostic settings for the specified resource. **WARNING**\ : This method will be deprecated in future releases. @@ -119,7 +119,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2016_09_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,10 +166,10 @@ def create_or_update( def update( self, resource_uri, # type: str - service_diagnostic_settings_resource, # type: "models.ServiceDiagnosticSettingsResourcePatch" + service_diagnostic_settings_resource, # type: "_models.ServiceDiagnosticSettingsResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.ServiceDiagnosticSettingsResource" + # type: (...) -> "_models.ServiceDiagnosticSettingsResource" """Updates an existing ServiceDiagnosticSettingsResource. To update other fields use the CreateOrUpdate method. **WARNING**\ : This method will be deprecated in future releases. @@ -182,7 +182,7 @@ def update( :rtype: ~$(python-base-namespace).v2016_09_01.models.ServiceDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +216,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ServiceDiagnosticSettingsResource', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py index 6779035b4e49..f7358b431d1d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2017-03-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json index 23a85011ca53..2a0c69aff8a2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py index e39815a810f4..a085c41c4c29 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_log_alerts = ActivityLogAlertsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py index a83bda6bfbcf..3c63ff90dabb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2017-03-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py index 77a618a91249..076e74ef740a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_log_alerts = ActivityLogAlertsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py index e52db335da2e..292f6ebc7657 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActivityLogAlertsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, activity_log_alert_name: str, - activity_log_alert: "models.ActivityLogAlertResource", + activity_log_alert: "_models.ActivityLogAlertResource", **kwargs - ) -> "models.ActivityLogAlertResource": + ) -> "_models.ActivityLogAlertResource": """Create a new activity log alert or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, activity_log_alert_name: str, **kwargs - ) -> "models.ActivityLogAlertResource": + ) -> "_models.ActivityLogAlertResource": """Get an activity log alert. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, activity_log_alert_name: str, - activity_log_alert_patch: "models.ActivityLogAlertResourcePatch", + activity_log_alert_patch: "_models.ActivityLogAlertResourcePatch", **kwargs - ) -> "models.ActivityLogAlertResource": + ) -> "_models.ActivityLogAlertResource": """Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. @@ -248,7 +248,7 @@ async def update( :rtype: ~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -284,7 +284,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -298,7 +298,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActivityLogAlertList"]: + ) -> AsyncIterable["_models.ActivityLogAlertList"]: """Get a list of all activity log alerts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -306,7 +306,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +351,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -366,7 +366,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActivityLogAlertList"]: + ) -> AsyncIterable["_models.ActivityLogAlertList"]: """Get a list of all activity log alerts in a resource group. :param resource_group_name: The name of the resource group. @@ -376,7 +376,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py index 1020ef2bd8a5..94da74734c8c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActivityLogAlertsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str activity_log_alert_name, # type: str - activity_log_alert, # type: "models.ActivityLogAlertResource" + activity_log_alert, # type: "_models.ActivityLogAlertResource" **kwargs # type: Any ): - # type: (...) -> "models.ActivityLogAlertResource" + # type: (...) -> "_models.ActivityLogAlertResource" """Create a new activity log alert or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( activity_log_alert_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActivityLogAlertResource" + # type: (...) -> "_models.ActivityLogAlertResource" """Get an activity log alert. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str activity_log_alert_name, # type: str - activity_log_alert_patch, # type: "models.ActivityLogAlertResourcePatch" + activity_log_alert_patch, # type: "_models.ActivityLogAlertResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.ActivityLogAlertResource" + # type: (...) -> "_models.ActivityLogAlertResource" """Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. @@ -256,7 +256,7 @@ def update( :rtype: ~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,7 +292,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -307,7 +307,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActivityLogAlertList"] + # type: (...) -> Iterable["_models.ActivityLogAlertList"] """Get a list of all activity log alerts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -315,7 +315,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -376,7 +376,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActivityLogAlertList"] + # type: (...) -> Iterable["_models.ActivityLogAlertList"] """Get a list of all activity log alerts in a resource group. :param resource_group_name: The name of the resource group. @@ -386,7 +386,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_03_01_preview.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -432,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py index 1a5aecea0642..88765cc0c820 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2017-04-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json index baad6b31e0ee..313e083a0c8e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py index 2c4ba50d209c..d5369325df20 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py @@ -52,7 +52,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py index e55bc4d5c7da..baf2b3d3f2ba 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2017-04-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py index c7575510e441..bbca6e598171 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py index 91b5b91f906a..353ce2bc2223 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, action_group_name: str, - action_group: "models.ActionGroupResource", + action_group: "_models.ActionGroupResource", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, action_group_name: str, **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Get an action group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, action_group_name: str, - action_group_patch: "models.ActionGroupPatchBody", + action_group_patch: "_models.ActionGroupPatchBody", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +283,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -297,7 +297,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_04_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,7 +350,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -365,7 +365,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -375,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_04_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +421,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -436,7 +436,7 @@ async def enable_receiver( self, resource_group_name: str, action_group_name: str, - enable_request: "models.EnableRequest", + enable_request: "_models.EnableRequest", **kwargs ) -> None: """Enable a receiver in an action group. This changes the receiver's status from Disabled to @@ -489,7 +489,7 @@ async def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py index 2e889f8bcc58..9b26a1bb6b0b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActivityLogAlertsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, activity_log_alert_name: str, - activity_log_alert: "models.ActivityLogAlertResource", + activity_log_alert: "_models.ActivityLogAlertResource", **kwargs - ) -> "models.ActivityLogAlertResource": + ) -> "_models.ActivityLogAlertResource": """Create a new activity log alert or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, activity_log_alert_name: str, **kwargs - ) -> "models.ActivityLogAlertResource": + ) -> "_models.ActivityLogAlertResource": """Get an activity log alert. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, activity_log_alert_name: str, - activity_log_alert_patch: "models.ActivityLogAlertPatchBody", + activity_log_alert_patch: "_models.ActivityLogAlertPatchBody", **kwargs - ) -> "models.ActivityLogAlertResource": + ) -> "_models.ActivityLogAlertResource": """Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. @@ -248,7 +248,7 @@ async def update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -284,7 +284,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -298,7 +298,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActivityLogAlertList"]: + ) -> AsyncIterable["_models.ActivityLogAlertList"]: """Get a list of all activity log alerts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -306,7 +306,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +351,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -366,7 +366,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActivityLogAlertList"]: + ) -> AsyncIterable["_models.ActivityLogAlertList"]: """Get a list of all activity log alerts in a resource group. :param resource_group_name: The name of the resource group. @@ -376,7 +376,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,7 +422,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py index 1a29bdc4ca45..689b1d5d1421 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str action_group_name, # type: str - action_group, # type: "models.ActionGroupResource" + action_group, # type: "_models.ActionGroupResource" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( action_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Get an action group. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str action_group_name, # type: str - action_group_patch, # type: "models.ActionGroupPatchBody" + action_group_patch, # type: "_models.ActionGroupPatchBody" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -306,7 +306,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_04_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -359,7 +359,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -375,7 +375,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_04_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -446,7 +446,7 @@ def enable_receiver( self, resource_group_name, # type: str action_group_name, # type: str - enable_request, # type: "models.EnableRequest" + enable_request, # type: "_models.EnableRequest" **kwargs # type: Any ): # type: (...) -> None @@ -500,7 +500,7 @@ def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py index 31437df9c13f..5854c48a1409 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActivityLogAlertsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str activity_log_alert_name, # type: str - activity_log_alert, # type: "models.ActivityLogAlertResource" + activity_log_alert, # type: "_models.ActivityLogAlertResource" **kwargs # type: Any ): - # type: (...) -> "models.ActivityLogAlertResource" + # type: (...) -> "_models.ActivityLogAlertResource" """Create a new activity log alert or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( activity_log_alert_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActivityLogAlertResource" + # type: (...) -> "_models.ActivityLogAlertResource" """Get an activity log alert. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str activity_log_alert_name, # type: str - activity_log_alert_patch, # type: "models.ActivityLogAlertPatchBody" + activity_log_alert_patch, # type: "_models.ActivityLogAlertPatchBody" **kwargs # type: Any ): - # type: (...) -> "models.ActivityLogAlertResource" + # type: (...) -> "_models.ActivityLogAlertResource" """Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. @@ -256,7 +256,7 @@ def update( :rtype: ~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -292,7 +292,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -307,7 +307,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActivityLogAlertList"] + # type: (...) -> Iterable["_models.ActivityLogAlertList"] """Get a list of all activity log alerts in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -315,7 +315,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -376,7 +376,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActivityLogAlertList"] + # type: (...) -> Iterable["_models.ActivityLogAlertList"] """Get a list of all activity log alerts in a resource group. :param resource_group_name: The name of the resource group. @@ -386,7 +386,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_04_01.models.ActivityLogAlertList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActivityLogAlertList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -432,7 +432,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py index 7900fde3b236..53a3fe13e267 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2017-05-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json index 52324983dd78..a3386f83d0da 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py index f993b0d21f3b..b83792cf63f6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py @@ -58,7 +58,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py index ed3403f0731d..a3191436cfef 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2017-05-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py index 54b8e0318734..a24cfd896f78 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py @@ -55,7 +55,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py index 2f8059814a66..cb356ad37a9a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class DiagnosticSettingsCategoryOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( resource_uri: str, name: str, **kwargs - ) -> "models.DiagnosticSettingsCategoryResource": + ) -> "_models.DiagnosticSettingsCategoryResource": """Gets the diagnostic settings category for the specified resource. :param resource_uri: The identifier of the resource. @@ -57,7 +57,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsCategoryResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsCategoryResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsCategoryResource', pipeline_response) @@ -102,7 +102,7 @@ async def list( self, resource_uri: str, **kwargs - ) -> "models.DiagnosticSettingsCategoryResourceCollection": + ) -> "_models.DiagnosticSettingsCategoryResourceCollection": """Lists the diagnostic settings categories for the specified resource. :param resource_uri: The identifier of the resource. @@ -112,7 +112,7 @@ async def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsCategoryResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsCategoryResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -141,7 +141,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsCategoryResourceCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py index 1c24fe090cbc..95c8a5fd4f21 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class DiagnosticSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( resource_uri: str, name: str, **kwargs - ) -> "models.DiagnosticSettingsResource": + ) -> "_models.DiagnosticSettingsResource": """Gets the active diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -57,7 +57,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsResource', pipeline_response) @@ -102,9 +102,9 @@ async def create_or_update( self, resource_uri: str, name: str, - parameters: "models.DiagnosticSettingsResource", + parameters: "_models.DiagnosticSettingsResource", **kwargs - ) -> "models.DiagnosticSettingsResource": + ) -> "_models.DiagnosticSettingsResource": """Creates or updates diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -118,7 +118,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -153,7 +153,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsResource', pipeline_response) @@ -211,7 +211,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -223,7 +223,7 @@ async def list( self, resource_uri: str, **kwargs - ) -> "models.DiagnosticSettingsResourceCollection": + ) -> "_models.DiagnosticSettingsResourceCollection": """Gets the active diagnostic settings list for the specified resource. :param resource_uri: The identifier of the resource. @@ -233,7 +233,7 @@ async def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsResourceCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py index 4861496d3b7a..de54aaaa2548 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, resource_uri: str, **kwargs - ) -> AsyncIterable["models.MetricDefinitionCollection"]: + ) -> AsyncIterable["_models.MetricDefinitionCollection"]: """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_05_01_preview.models.MetricDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py index 7c9ab28b7877..e5acd4985819 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -51,9 +51,9 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, filter: Optional[str] = None, - result_type: Optional[Union[str, "models.ResultType"]] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, **kwargs - ) -> "models.Response": + ) -> "_models.Response": """**Lists the metric values for a resource**. :param resource_uri: The identifier of the resource. @@ -93,7 +93,7 @@ async def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.Response :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Response"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -138,7 +138,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Response', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py index 4a5cf58453bf..8d38157011b2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class SubscriptionDiagnosticSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( subscription_id: str, name: str, **kwargs - ) -> "models.SubscriptionDiagnosticSettingsResource": + ) -> "_models.SubscriptionDiagnosticSettingsResource": """Gets the active subscription diagnostic settings for the specified resource. :param subscription_id: The subscription id. @@ -57,7 +57,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -87,7 +87,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) @@ -102,9 +102,9 @@ async def create_or_update( self, subscription_id: str, name: str, - parameters: "models.SubscriptionDiagnosticSettingsResource", + parameters: "_models.SubscriptionDiagnosticSettingsResource", **kwargs - ) -> "models.SubscriptionDiagnosticSettingsResource": + ) -> "_models.SubscriptionDiagnosticSettingsResource": """Creates or updates subscription diagnostic settings for the specified resource. :param subscription_id: The subscription id. @@ -118,7 +118,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -153,7 +153,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) @@ -211,7 +211,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -223,7 +223,7 @@ async def list( self, subscription_id: str, **kwargs - ) -> "models.SubscriptionDiagnosticSettingsResourceCollection": + ) -> "_models.SubscriptionDiagnosticSettingsResourceCollection": """Gets the active subscription diagnostic settings list for the specified subscriptionId. :param subscription_id: The subscription id. @@ -233,7 +233,7 @@ async def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionDiagnosticSettingsResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SubscriptionDiagnosticSettingsResourceCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py index c02bcb56365d..b4f988ccfad0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class DiagnosticSettingsCategoryOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiagnosticSettingsCategoryResource" + # type: (...) -> "_models.DiagnosticSettingsCategoryResource" """Gets the diagnostic settings category for the specified resource. :param resource_uri: The identifier of the resource. @@ -62,7 +62,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsCategoryResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsCategoryResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsCategoryResource', pipeline_response) @@ -108,7 +108,7 @@ def list( resource_uri, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiagnosticSettingsCategoryResourceCollection" + # type: (...) -> "_models.DiagnosticSettingsCategoryResourceCollection" """Lists the diagnostic settings categories for the specified resource. :param resource_uri: The identifier of the resource. @@ -118,7 +118,7 @@ def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsCategoryResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsCategoryResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -147,7 +147,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsCategoryResourceCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py index 542a2b2ecd70..c1a0017ef007 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class DiagnosticSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiagnosticSettingsResource" + # type: (...) -> "_models.DiagnosticSettingsResource" """Gets the active diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -62,7 +62,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsResource', pipeline_response) @@ -107,10 +107,10 @@ def create_or_update( self, resource_uri, # type: str name, # type: str - parameters, # type: "models.DiagnosticSettingsResource" + parameters, # type: "_models.DiagnosticSettingsResource" **kwargs # type: Any ): - # type: (...) -> "models.DiagnosticSettingsResource" + # type: (...) -> "_models.DiagnosticSettingsResource" """Creates or updates diagnostic settings for the specified resource. :param resource_uri: The identifier of the resource. @@ -124,7 +124,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -159,7 +159,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsResource', pipeline_response) @@ -218,7 +218,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,7 +231,7 @@ def list( resource_uri, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiagnosticSettingsResourceCollection" + # type: (...) -> "_models.DiagnosticSettingsResourceCollection" """Gets the active diagnostic settings list for the specified resource. :param resource_uri: The identifier of the resource. @@ -241,7 +241,7 @@ def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.DiagnosticSettingsResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticSettingsResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +270,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DiagnosticSettingsResourceCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py index 9d055f98dceb..fe8410940a9d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( resource_uri, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricDefinitionCollection"] + # type: (...) -> Iterable["_models.MetricDefinitionCollection"] """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_05_01_preview.models.MetricDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,7 +105,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py index bda90bf8d2d4..f784c87fe166 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -55,10 +55,10 @@ def list( top=None, # type: Optional[int] orderby=None, # type: Optional[str] filter=None, # type: Optional[str] - result_type=None, # type: Optional[Union[str, "models.ResultType"]] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] **kwargs # type: Any ): - # type: (...) -> "models.Response" + # type: (...) -> "_models.Response" """**Lists the metric values for a resource**. :param resource_uri: The identifier of the resource. @@ -98,7 +98,7 @@ def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.Response :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Response"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -143,7 +143,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Response', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py index ed6be77f0587..b8f0928e298b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class SubscriptionDiagnosticSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SubscriptionDiagnosticSettingsResource" + # type: (...) -> "_models.SubscriptionDiagnosticSettingsResource" """Gets the active subscription diagnostic settings for the specified resource. :param subscription_id: The subscription id. @@ -62,7 +62,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -92,7 +92,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) @@ -107,10 +107,10 @@ def create_or_update( self, subscription_id, # type: str name, # type: str - parameters, # type: "models.SubscriptionDiagnosticSettingsResource" + parameters, # type: "_models.SubscriptionDiagnosticSettingsResource" **kwargs # type: Any ): - # type: (...) -> "models.SubscriptionDiagnosticSettingsResource" + # type: (...) -> "_models.SubscriptionDiagnosticSettingsResource" """Creates or updates subscription diagnostic settings for the specified resource. :param subscription_id: The subscription id. @@ -124,7 +124,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -159,7 +159,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) @@ -218,7 +218,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,7 +231,7 @@ def list( subscription_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SubscriptionDiagnosticSettingsResourceCollection" + # type: (...) -> "_models.SubscriptionDiagnosticSettingsResourceCollection" """Gets the active subscription diagnostic settings list for the specified subscriptionId. :param subscription_id: The subscription id. @@ -241,7 +241,7 @@ def list( :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResourceCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionDiagnosticSettingsResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -270,7 +270,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SubscriptionDiagnosticSettingsResourceCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py index 519a3e172d74..d0fb26233a4a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2017-11-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json index 27fac2a7af1f..032220920274 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py index 251b6bd7ae11..3c48248a52c1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_baseline = MetricBaselineOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py index fee89e640696..28b010a60fb5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2017-11-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py index eccc4e77501a..a34fecffc287 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py @@ -43,7 +43,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_baseline = MetricBaselineOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py index fff71a39e22b..d4b82f738fea 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricBaselineOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,9 +49,9 @@ async def get( interval: Optional[datetime.timedelta] = None, aggregation: Optional[str] = None, sensitivities: Optional[str] = None, - result_type: Optional[Union[str, "models.ResultType"]] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, **kwargs - ) -> "models.BaselineResponse": + ) -> "_models.BaselineResponse": """**Gets the baseline values for a specific metric**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -78,7 +78,7 @@ async def get( :rtype: ~$(python-base-namespace).v2017_11_01_preview.models.BaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BaselineResponse', pipeline_response) @@ -132,9 +132,9 @@ async def get( async def calculate_baseline( self, resource_uri: str, - time_series_information: "models.TimeSeriesInformation", + time_series_information: "_models.TimeSeriesInformation", **kwargs - ) -> "models.CalculateBaselineResponse": + ) -> "_models.CalculateBaselineResponse": """**Lists the baseline values for a resource**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -150,7 +150,7 @@ async def calculate_baseline( :rtype: ~$(python-base-namespace).v2017_11_01_preview.models.CalculateBaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CalculateBaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ async def calculate_baseline( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CalculateBaselineResponse', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py index fee333322b08..1974d16f13c4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricBaselineOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,10 +53,10 @@ def get( interval=None, # type: Optional[datetime.timedelta] aggregation=None, # type: Optional[str] sensitivities=None, # type: Optional[str] - result_type=None, # type: Optional[Union[str, "models.ResultType"]] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] **kwargs # type: Any ): - # type: (...) -> "models.BaselineResponse" + # type: (...) -> "_models.BaselineResponse" """**Gets the baseline values for a specific metric**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -83,7 +83,7 @@ def get( :rtype: ~$(python-base-namespace).v2017_11_01_preview.models.BaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -123,7 +123,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BaselineResponse', pipeline_response) @@ -137,10 +137,10 @@ def get( def calculate_baseline( self, resource_uri, # type: str - time_series_information, # type: "models.TimeSeriesInformation" + time_series_information, # type: "_models.TimeSeriesInformation" **kwargs # type: Any ): - # type: (...) -> "models.CalculateBaselineResponse" + # type: (...) -> "_models.CalculateBaselineResponse" """**Lists the baseline values for a resource**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -156,7 +156,7 @@ def calculate_baseline( :rtype: ~$(python-base-namespace).v2017_11_01_preview.models.CalculateBaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CalculateBaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def calculate_baseline( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CalculateBaselineResponse', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py index 3b15522c5f9c..f791805e52f2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2017-12-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json index 5d938f67dd49..90b18ede7f52 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py index d3328a470f3a..7dc3c6fcb82e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_namespaces = MetricNamespacesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py index f9a108ffbc2b..00dc29134a32 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2017-12-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py index 93c631613bfa..7371583d4223 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py @@ -43,7 +43,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_namespaces = MetricNamespacesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py index 29042ab21025..15497b8ed00c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricNamespacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_uri: str, start_time: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.MetricNamespaceCollection"]: + ) -> AsyncIterable["_models.MetricNamespaceCollection"]: """Lists the metric namespaces for the resource. :param resource_uri: The identifier of the resource. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2017_12_01_preview.models.MetricNamespaceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricNamespaceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricNamespaceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py index 255ba377af8d..247d93eac5fd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricNamespacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( start_time=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricNamespaceCollection"] + # type: (...) -> Iterable["_models.MetricNamespaceCollection"] """Lists the metric namespaces for the resource. :param resource_uri: The identifier of the resource. @@ -64,7 +64,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2017_12_01_preview.models.MetricNamespaceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricNamespaceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricNamespaceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py index efc917163bc6..449982bc94c7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2018-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json index 773155f7320d..b4d69509a432 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py index 49362a201308..d49d26f76ec5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_definitions = MetricDefinitionsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py index f38c67068226..3357ffb00a13 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2018-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py index 2ea519ee0b2d..41b74d643867 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_definitions = MetricDefinitionsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py index d14bfaaef84e..634aa84501b5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricDefinitionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list( resource_uri: str, metricnamespace: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.MetricDefinitionCollection"]: + ) -> AsyncIterable["_models.MetricDefinitionCollection"]: """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. @@ -58,7 +58,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_01_01.models.MetricDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py index 60bd670a79ee..f59760d272b8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -51,10 +51,10 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, filter: Optional[str] = None, - result_type: Optional[Union[str, "models.ResultType"]] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, metricnamespace: Optional[str] = None, **kwargs - ) -> "models.Response": + ) -> "_models.Response": """**Lists the metric values for a resource**. :param resource_uri: The identifier of the resource. @@ -96,7 +96,7 @@ async def list( :rtype: ~$(python-base-namespace).v2018_01_01.models.Response :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Response"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -143,7 +143,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Response', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py index 59060fc38550..03e9da0f5741 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricDefinitionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( metricnamespace=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricDefinitionCollection"] + # type: (...) -> Iterable["_models.MetricDefinitionCollection"] """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. @@ -63,7 +63,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_01_01.models.MetricDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py index adef5b73c7d5..0c4201e92e8a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -55,11 +55,11 @@ def list( top=None, # type: Optional[int] orderby=None, # type: Optional[str] filter=None, # type: Optional[str] - result_type=None, # type: Optional[Union[str, "models.ResultType"]] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] metricnamespace=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Response" + # type: (...) -> "_models.Response" """**Lists the metric values for a resource**. :param resource_uri: The identifier of the resource. @@ -101,7 +101,7 @@ def list( :rtype: ~$(python-base-namespace).v2018_01_01.models.Response :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Response"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -148,7 +148,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Response', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py index e17c5db0c200..ebec2e6101db 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json index d19d65e12c33..a1e11b0eb0e1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py index 89ec27686676..d10baa70c109 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py @@ -55,7 +55,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py index 110ba3677e13..61a3ada0a89e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py index c494d8a98319..6425d5b7db77 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py @@ -52,7 +52,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py index e0062d85fda3..b5887d78df96 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, action_group_name: str, - action_group: "models.ActionGroupResource", + action_group: "_models.ActionGroupResource", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2018_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, action_group_name: str, **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Get an action group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, action_group_name: str, - action_group_patch: "models.ActionGroupPatchBody", + action_group_patch: "_models.ActionGroupPatchBody", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def update( :rtype: ~$(python-base-namespace).v2018_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +283,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -297,7 +297,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,7 +350,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -365,7 +365,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -375,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +421,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -436,7 +436,7 @@ async def enable_receiver( self, resource_group_name: str, action_group_name: str, - enable_request: "models.EnableRequest", + enable_request: "_models.EnableRequest", **kwargs ) -> None: """Enable a receiver in an action group. This changes the receiver's status from Disabled to @@ -489,7 +489,7 @@ async def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py index c1a2bffbd343..f05312f25a40 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricAlertsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.MetricAlertResourceCollection"]: + ) -> AsyncIterable["_models.MetricAlertResourceCollection"]: """Retrieve alert rule definitions in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_03_01.models.MetricAlertResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -112,7 +112,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.MetricAlertResourceCollection"]: + ) -> AsyncIterable["_models.MetricAlertResourceCollection"]: """Retrieve alert rule definitions in a resource group. :param resource_group_name: The name of the resource group. @@ -122,7 +122,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_03_01.models.MetricAlertResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -184,7 +184,7 @@ async def get( resource_group_name: str, rule_name: str, **kwargs - ) -> "models.MetricAlertResource": + ) -> "_models.MetricAlertResource": """Retrieve an alert rule definition. :param resource_group_name: The name of the resource group. @@ -196,7 +196,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +227,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertResource', pipeline_response) @@ -242,9 +242,9 @@ async def create_or_update( self, resource_group_name: str, rule_name: str, - parameters: "models.MetricAlertResource", + parameters: "_models.MetricAlertResource", **kwargs - ) -> "models.MetricAlertResource": + ) -> "_models.MetricAlertResource": """Create or update an metric alert definition. :param resource_group_name: The name of the resource group. @@ -258,7 +258,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -294,7 +294,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertResource', pipeline_response) @@ -309,9 +309,9 @@ async def update( self, resource_group_name: str, rule_name: str, - parameters: "models.MetricAlertResourcePatch", + parameters: "_models.MetricAlertResourcePatch", **kwargs - ) -> "models.MetricAlertResource": + ) -> "_models.MetricAlertResource": """Update an metric alert definition. :param resource_group_name: The name of the resource group. @@ -325,7 +325,7 @@ async def update( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +361,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertResource', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py index dbfe12ec9822..8700d6231456 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class MetricAlertsStatusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def list( resource_group_name: str, rule_name: str, **kwargs - ) -> "models.MetricAlertStatusCollection": + ) -> "_models.MetricAlertStatusCollection": """Retrieve an alert rule status. :param resource_group_name: The name of the resource group. @@ -57,7 +57,7 @@ async def list( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertStatusCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertStatusCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertStatusCollection', pipeline_response) @@ -105,7 +105,7 @@ async def list_by_name( rule_name: str, status_name: str, **kwargs - ) -> "models.MetricAlertStatusCollection": + ) -> "_models.MetricAlertStatusCollection": """Retrieve an alert rule status. :param resource_group_name: The name of the resource group. @@ -119,7 +119,7 @@ async def list_by_name( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertStatusCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertStatusCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def list_by_name( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertStatusCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py index e3123cfd1b68..3bf283074e85 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str action_group_name, # type: str - action_group, # type: "models.ActionGroupResource" + action_group, # type: "_models.ActionGroupResource" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2018_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( action_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Get an action group. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str action_group_name, # type: str - action_group_patch, # type: "models.ActionGroupPatchBody" + action_group_patch, # type: "_models.ActionGroupPatchBody" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def update( :rtype: ~$(python-base-namespace).v2018_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -306,7 +306,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -359,7 +359,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -375,7 +375,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -446,7 +446,7 @@ def enable_receiver( self, resource_group_name, # type: str action_group_name, # type: str - enable_request, # type: "models.EnableRequest" + enable_request, # type: "_models.EnableRequest" **kwargs # type: Any ): # type: (...) -> None @@ -500,7 +500,7 @@ def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py index c5ad151d7ce1..497d473da137 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricAlertsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricAlertResourceCollection"] + # type: (...) -> Iterable["_models.MetricAlertResourceCollection"] """Retrieve alert rule definitions in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_03_01.models.MetricAlertResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -118,7 +118,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricAlertResourceCollection"] + # type: (...) -> Iterable["_models.MetricAlertResourceCollection"] """Retrieve alert rule definitions in a resource group. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_03_01.models.MetricAlertResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -191,7 +191,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.MetricAlertResource" + # type: (...) -> "_models.MetricAlertResource" """Retrieve an alert rule definition. :param resource_group_name: The name of the resource group. @@ -203,7 +203,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,7 +234,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertResource', pipeline_response) @@ -249,10 +249,10 @@ def create_or_update( self, resource_group_name, # type: str rule_name, # type: str - parameters, # type: "models.MetricAlertResource" + parameters, # type: "_models.MetricAlertResource" **kwargs # type: Any ): - # type: (...) -> "models.MetricAlertResource" + # type: (...) -> "_models.MetricAlertResource" """Create or update an metric alert definition. :param resource_group_name: The name of the resource group. @@ -266,7 +266,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -302,7 +302,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertResource', pipeline_response) @@ -317,10 +317,10 @@ def update( self, resource_group_name, # type: str rule_name, # type: str - parameters, # type: "models.MetricAlertResourcePatch" + parameters, # type: "_models.MetricAlertResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.MetricAlertResource" + # type: (...) -> "_models.MetricAlertResource" """Update an metric alert definition. :param resource_group_name: The name of the resource group. @@ -334,7 +334,7 @@ def update( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertResource', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py index 605a407e5c61..82aa2f529a36 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class MetricAlertsStatusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.MetricAlertStatusCollection" + # type: (...) -> "_models.MetricAlertStatusCollection" """Retrieve an alert rule status. :param resource_group_name: The name of the resource group. @@ -62,7 +62,7 @@ def list( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertStatusCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertStatusCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertStatusCollection', pipeline_response) @@ -111,7 +111,7 @@ def list_by_name( status_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.MetricAlertStatusCollection" + # type: (...) -> "_models.MetricAlertStatusCollection" """Retrieve an alert rule status. :param resource_group_name: The name of the resource group. @@ -125,7 +125,7 @@ def list_by_name( :rtype: ~$(python-base-namespace).v2018_03_01.models.MetricAlertStatusCollection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricAlertStatusCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -157,7 +157,7 @@ def list_by_name( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MetricAlertStatusCollection', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py index 057a1701351f..1db685d7e626 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-04-16" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json index fb33a5064fd0..92d457269982 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py index f79b4be96052..10fa9a582ef5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.scheduled_query_rules = ScheduledQueryRulesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py index ca313cc14b8a..7f77eef29df1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-04-16" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py index d720ac96d670..dc53bfa91c79 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.scheduled_query_rules = ScheduledQueryRulesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py index 05fe997303bc..655f20858287 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ScheduledQueryRulesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, rule_name: str, - parameters: "models.LogSearchRuleResource", + parameters: "_models.LogSearchRuleResource", **kwargs - ) -> "models.LogSearchRuleResource": + ) -> "_models.LogSearchRuleResource": """Creates or updates an log search rule. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, rule_name: str, **kwargs - ) -> "models.LogSearchRuleResource": + ) -> "_models.LogSearchRuleResource": """Gets an Log Search rule. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogSearchRuleResource', pipeline_response) @@ -175,9 +175,9 @@ async def update( self, resource_group_name: str, rule_name: str, - parameters: "models.LogSearchRuleResourcePatch", + parameters: "_models.LogSearchRuleResourcePatch", **kwargs - ) -> "models.LogSearchRuleResource": + ) -> "_models.LogSearchRuleResource": """Update log search Rule. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ async def update( :rtype: ~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +227,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogSearchRuleResource', pipeline_response) @@ -286,7 +286,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -298,7 +298,7 @@ def list_by_subscription( self, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.LogSearchRuleResourceCollection"]: + ) -> AsyncIterable["_models.LogSearchRuleResourceCollection"]: """List the Log Search rules within a subscription group. :param filter: The filter to apply on the operation. For more information please see @@ -309,7 +309,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,7 +356,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -372,7 +372,7 @@ def list_by_resource_group( resource_group_name: str, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.LogSearchRuleResourceCollection"]: + ) -> AsyncIterable["_models.LogSearchRuleResourceCollection"]: """List the Log Search rules within a resource group. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -433,7 +433,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py index 190bb72db8dc..63d29f5e963f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ScheduledQueryRulesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str rule_name, # type: str - parameters, # type: "models.LogSearchRuleResource" + parameters, # type: "_models.LogSearchRuleResource" **kwargs # type: Any ): - # type: (...) -> "models.LogSearchRuleResource" + # type: (...) -> "_models.LogSearchRuleResource" """Creates or updates an log search rule. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.LogSearchRuleResource" + # type: (...) -> "_models.LogSearchRuleResource" """Gets an Log Search rule. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogSearchRuleResource', pipeline_response) @@ -181,10 +181,10 @@ def update( self, resource_group_name, # type: str rule_name, # type: str - parameters, # type: "models.LogSearchRuleResourcePatch" + parameters, # type: "_models.LogSearchRuleResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.LogSearchRuleResource" + # type: (...) -> "_models.LogSearchRuleResource" """Update log search Rule. :param resource_group_name: The name of the resource group. @@ -198,7 +198,7 @@ def update( :rtype: ~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,7 +234,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LogSearchRuleResource', pipeline_response) @@ -294,7 +294,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -307,7 +307,7 @@ def list_by_subscription( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.LogSearchRuleResourceCollection"] + # type: (...) -> Iterable["_models.LogSearchRuleResourceCollection"] """List the Log Search rules within a subscription group. :param filter: The filter to apply on the operation. For more information please see @@ -318,7 +318,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,7 +365,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -382,7 +382,7 @@ def list_by_resource_group( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.LogSearchRuleResourceCollection"] + # type: (...) -> Iterable["_models.LogSearchRuleResourceCollection"] """List the Log Search rules within a resource group. :param resource_group_name: The name of the resource group. @@ -395,7 +395,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_04_16.models.LogSearchRuleResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogSearchRuleResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -443,7 +443,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py index 5ac948acf27a..26e4da69b15f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-06-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json index 04a8308bde25..60c4c86b11e6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py index 4c51e4bdb45e..c6466958bea5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py @@ -52,7 +52,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py index 169f07e9f2e8..f00e51e3e390 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-06-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py index 9210c25c5515..8d276070ee6b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py index 1b1ebe3f7d3e..176032de5bc6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class GuestDiagnosticsSettingsAssociationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_uri: str, association_name: str, - diagnostic_settings_association: "models.GuestDiagnosticSettingsAssociationResource", + diagnostic_settings_association: "_models.GuestDiagnosticSettingsAssociationResource", **kwargs - ) -> "models.GuestDiagnosticSettingsAssociationResource": + ) -> "_models.GuestDiagnosticSettingsAssociationResource": """Creates or updates guest diagnostics settings association. :param resource_uri: The fully qualified ID of the resource, including the resource name and @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -118,7 +118,7 @@ async def get( resource_uri: str, association_name: str, **kwargs - ) -> "models.GuestDiagnosticSettingsAssociationResource": + ) -> "_models.GuestDiagnosticSettingsAssociationResource": """Gets guest diagnostics association settings. :param resource_uri: The fully qualified ID of the resource, including the resource name and @@ -131,7 +131,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -161,7 +161,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('GuestDiagnosticSettingsAssociationResource', pipeline_response) @@ -220,7 +220,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -232,9 +232,9 @@ async def update( self, resource_uri: str, association_name: str, - parameters: "models.GuestDiagnosticSettingsAssociationResourcePatch", + parameters: "_models.GuestDiagnosticSettingsAssociationResourcePatch", **kwargs - ) -> "models.GuestDiagnosticSettingsAssociationResource": + ) -> "_models.GuestDiagnosticSettingsAssociationResource": """Updates an existing guestDiagnosticsSettingsAssociation Resource. To update other fields use the CreateOrUpdate method. @@ -250,7 +250,7 @@ async def update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -285,7 +285,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('GuestDiagnosticSettingsAssociationResource', pipeline_response) @@ -299,7 +299,7 @@ async def update( def list( self, **kwargs - ) -> AsyncIterable["models.GuestDiagnosticSettingsAssociationList"]: + ) -> AsyncIterable["_models.GuestDiagnosticSettingsAssociationList"]: """Get a list of all guest diagnostic settings association in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -307,7 +307,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,7 +352,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -367,7 +367,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.GuestDiagnosticSettingsAssociationList"]: + ) -> AsyncIterable["_models.GuestDiagnosticSettingsAssociationList"]: """Get a list of all guest diagnostic settings association in a resource group. :param resource_group_name: The name of the resource group. @@ -377,7 +377,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,7 +423,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py index 0d71030a2a17..a9b8d306d9e5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class GuestDiagnosticsSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, diagnostic_settings_name: str, - diagnostic_settings: "models.GuestDiagnosticSettingsResource", + diagnostic_settings: "_models.GuestDiagnosticSettingsResource", **kwargs - ) -> "models.GuestDiagnosticSettingsResource": + ) -> "_models.GuestDiagnosticSettingsResource": """Creates or updates guest diagnostics settings. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, diagnostic_settings_name: str, **kwargs - ) -> "models.GuestDiagnosticSettingsResource": + ) -> "_models.GuestDiagnosticSettingsResource": """Gets guest diagnostics settings. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('GuestDiagnosticSettingsResource', pipeline_response) @@ -175,9 +175,9 @@ async def update( self, resource_group_name: str, diagnostic_settings_name: str, - parameters: "models.GuestDiagnosticSettingsPatchResource", + parameters: "_models.GuestDiagnosticSettingsPatchResource", **kwargs - ) -> "models.GuestDiagnosticSettingsResource": + ) -> "_models.GuestDiagnosticSettingsResource": """Updates guest diagnostics settings. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ async def update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +227,7 @@ async def update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -290,7 +290,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -301,7 +301,7 @@ async def delete( def list( self, **kwargs - ) -> AsyncIterable["models.GuestDiagnosticSettingsList"]: + ) -> AsyncIterable["_models.GuestDiagnosticSettingsList"]: """Get a list of all guest diagnostic settings in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -309,7 +309,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +354,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -369,7 +369,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.GuestDiagnosticSettingsList"]: + ) -> AsyncIterable["_models.GuestDiagnosticSettingsList"]: """Get a list of all guest diagnostic settings in a resource group. :param resource_group_name: The name of the resource group. @@ -379,7 +379,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -425,7 +425,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py index c730084dc51c..2c977cb690f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class GuestDiagnosticsSettingsAssociationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_uri, # type: str association_name, # type: str - diagnostic_settings_association, # type: "models.GuestDiagnosticSettingsAssociationResource" + diagnostic_settings_association, # type: "_models.GuestDiagnosticSettingsAssociationResource" **kwargs # type: Any ): - # type: (...) -> "models.GuestDiagnosticSettingsAssociationResource" + # type: (...) -> "_models.GuestDiagnosticSettingsAssociationResource" """Creates or updates guest diagnostics settings association. :param resource_uri: The fully qualified ID of the resource, including the resource name and @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,7 +103,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -124,7 +124,7 @@ def get( association_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GuestDiagnosticSettingsAssociationResource" + # type: (...) -> "_models.GuestDiagnosticSettingsAssociationResource" """Gets guest diagnostics association settings. :param resource_uri: The fully qualified ID of the resource, including the resource name and @@ -137,7 +137,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -167,7 +167,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('GuestDiagnosticSettingsAssociationResource', pipeline_response) @@ -227,7 +227,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -239,10 +239,10 @@ def update( self, resource_uri, # type: str association_name, # type: str - parameters, # type: "models.GuestDiagnosticSettingsAssociationResourcePatch" + parameters, # type: "_models.GuestDiagnosticSettingsAssociationResourcePatch" **kwargs # type: Any ): - # type: (...) -> "models.GuestDiagnosticSettingsAssociationResource" + # type: (...) -> "_models.GuestDiagnosticSettingsAssociationResource" """Updates an existing guestDiagnosticsSettingsAssociation Resource. To update other fields use the CreateOrUpdate method. @@ -258,7 +258,7 @@ def update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -293,7 +293,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('GuestDiagnosticSettingsAssociationResource', pipeline_response) @@ -308,7 +308,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.GuestDiagnosticSettingsAssociationList"] + # type: (...) -> Iterable["_models.GuestDiagnosticSettingsAssociationList"] """Get a list of all guest diagnostic settings association in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -316,7 +316,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +361,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -377,7 +377,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GuestDiagnosticSettingsAssociationList"] + # type: (...) -> Iterable["_models.GuestDiagnosticSettingsAssociationList"] """Get a list of all guest diagnostic settings association in a resource group. :param resource_group_name: The name of the resource group. @@ -387,7 +387,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsAssociationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsAssociationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -433,7 +433,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py index 67a7f766c3e8..1e45f3485e86 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class GuestDiagnosticsSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str diagnostic_settings_name, # type: str - diagnostic_settings, # type: "models.GuestDiagnosticSettingsResource" + diagnostic_settings, # type: "_models.GuestDiagnosticSettingsResource" **kwargs # type: Any ): - # type: (...) -> "models.GuestDiagnosticSettingsResource" + # type: (...) -> "_models.GuestDiagnosticSettingsResource" """Creates or updates guest diagnostics settings. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( diagnostic_settings_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GuestDiagnosticSettingsResource" + # type: (...) -> "_models.GuestDiagnosticSettingsResource" """Gets guest diagnostics settings. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('GuestDiagnosticSettingsResource', pipeline_response) @@ -181,10 +181,10 @@ def update( self, resource_group_name, # type: str diagnostic_settings_name, # type: str - parameters, # type: "models.GuestDiagnosticSettingsPatchResource" + parameters, # type: "_models.GuestDiagnosticSettingsPatchResource" **kwargs # type: Any ): - # type: (...) -> "models.GuestDiagnosticSettingsResource" + # type: (...) -> "_models.GuestDiagnosticSettingsResource" """Updates guest diagnostics settings. :param resource_group_name: The name of the resource group. @@ -198,7 +198,7 @@ def update( :rtype: ~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,7 +234,7 @@ def update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -298,7 +298,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -310,7 +310,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.GuestDiagnosticSettingsList"] + # type: (...) -> Iterable["_models.GuestDiagnosticSettingsList"] """Get a list of all guest diagnostic settings in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -318,7 +318,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,7 +363,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -379,7 +379,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GuestDiagnosticSettingsList"] + # type: (...) -> Iterable["_models.GuestDiagnosticSettingsList"] """Get a list of all guest diagnostic settings in a resource group. :param resource_group_name: The name of the resource group. @@ -389,7 +389,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_06_01_preview.models.GuestDiagnosticSettingsList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestDiagnosticSettingsList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -435,7 +435,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py index 37323d0126ed..68644ad9bce1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-09-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json index 3e61eec80347..1c4cec2694ea 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py index 425ab6863cfa..3f5f5b1e3760 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py @@ -55,7 +55,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py index eed1aaa61ef2..2f0c23734e5a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2018-09-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py index 5549ee3ad4c3..1e0270630838 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py @@ -52,7 +52,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py index df135300c0d2..784c2646f6e5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, action_group_name: str, - action_group: "models.ActionGroupResource", + action_group: "_models.ActionGroupResource", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2018_09_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, action_group_name: str, **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Get an action group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_09_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, action_group_name: str, - action_group_patch: "models.ActionGroupPatchBody", + action_group_patch: "_models.ActionGroupPatchBody", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def update( :rtype: ~$(python-base-namespace).v2018_09_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +283,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -297,7 +297,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_09_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,7 +350,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -365,7 +365,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -375,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_09_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +421,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -436,7 +436,7 @@ async def enable_receiver( self, resource_group_name: str, action_group_name: str, - enable_request: "models.EnableRequest", + enable_request: "_models.EnableRequest", **kwargs ) -> None: """Enable a receiver in an action group. This changes the receiver's status from Disabled to @@ -489,7 +489,7 @@ async def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py index a1e357bac815..2e13edf2f29d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class BaselineOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,11 +49,11 @@ async def get( interval: Optional[datetime.timedelta] = None, aggregation: Optional[str] = None, sensitivities: Optional[str] = None, - result_type: Optional[Union[str, "models.ResultType"]] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, metricnamespace: Optional[str] = None, filter: Optional[str] = None, **kwargs - ) -> "models.BaselineResponse": + ) -> "_models.BaselineResponse": """**Gets the baseline values for a resource**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -85,7 +85,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_09_01.models.BaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -130,7 +130,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BaselineResponse', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py index b3b9cd22981f..cf63e10acad9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MetricBaselineOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,11 +49,11 @@ async def get( interval: Optional[datetime.timedelta] = None, aggregation: Optional[str] = None, sensitivities: Optional[str] = None, - result_type: Optional[Union[str, "models.ResultType"]] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, metricnamespace: Optional[str] = None, filter: Optional[str] = None, **kwargs - ) -> "models.BaselineResponse": + ) -> "_models.BaselineResponse": """**Gets the baseline values for a specific metric**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -85,7 +85,7 @@ async def get( :rtype: ~$(python-base-namespace).v2018_09_01.models.BaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -129,7 +129,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BaselineResponse', pipeline_response) @@ -143,9 +143,9 @@ async def get( async def calculate_baseline( self, resource_uri: str, - time_series_information: "models.TimeSeriesInformation", + time_series_information: "_models.TimeSeriesInformation", **kwargs - ) -> "models.CalculateBaselineResponse": + ) -> "_models.CalculateBaselineResponse": """**Lists the baseline values for a resource**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -161,7 +161,7 @@ async def calculate_baseline( :rtype: ~$(python-base-namespace).v2018_09_01.models.CalculateBaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CalculateBaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -195,7 +195,7 @@ async def calculate_baseline( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CalculateBaselineResponse', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py index 027d0716ac1a..46614344a75b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str action_group_name, # type: str - action_group, # type: "models.ActionGroupResource" + action_group, # type: "_models.ActionGroupResource" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2018_09_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( action_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Get an action group. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_09_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str action_group_name, # type: str - action_group_patch, # type: "models.ActionGroupPatchBody" + action_group_patch, # type: "_models.ActionGroupPatchBody" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def update( :rtype: ~$(python-base-namespace).v2018_09_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -306,7 +306,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_09_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -359,7 +359,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -375,7 +375,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_09_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -446,7 +446,7 @@ def enable_receiver( self, resource_group_name, # type: str action_group_name, # type: str - enable_request, # type: "models.EnableRequest" + enable_request, # type: "_models.EnableRequest" **kwargs # type: Any ): # type: (...) -> None @@ -500,7 +500,7 @@ def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py index 95712395f509..2afba907f941 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class BaselineOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,12 +53,12 @@ def get( interval=None, # type: Optional[datetime.timedelta] aggregation=None, # type: Optional[str] sensitivities=None, # type: Optional[str] - result_type=None, # type: Optional[Union[str, "models.ResultType"]] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] metricnamespace=None, # type: Optional[str] filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BaselineResponse" + # type: (...) -> "_models.BaselineResponse" """**Gets the baseline values for a resource**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -90,7 +90,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_09_01.models.BaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -135,7 +135,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BaselineResponse', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py index b2cdb7bb6e42..e312106466af 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MetricBaselineOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,12 +53,12 @@ def get( interval=None, # type: Optional[datetime.timedelta] aggregation=None, # type: Optional[str] sensitivities=None, # type: Optional[str] - result_type=None, # type: Optional[Union[str, "models.ResultType"]] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] metricnamespace=None, # type: Optional[str] filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.BaselineResponse" + # type: (...) -> "_models.BaselineResponse" """**Gets the baseline values for a specific metric**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -90,7 +90,7 @@ def get( :rtype: ~$(python-base-namespace).v2018_09_01.models.BaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -134,7 +134,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BaselineResponse', pipeline_response) @@ -148,10 +148,10 @@ def get( def calculate_baseline( self, resource_uri, # type: str - time_series_information, # type: "models.TimeSeriesInformation" + time_series_information, # type: "_models.TimeSeriesInformation" **kwargs # type: Any ): - # type: (...) -> "models.CalculateBaselineResponse" + # type: (...) -> "_models.CalculateBaselineResponse" """**Lists the baseline values for a resource**. :param resource_uri: The identifier of the resource. It has the following structure: @@ -167,7 +167,7 @@ def calculate_baseline( :rtype: ~$(python-base-namespace).v2018_09_01.models.CalculateBaselineResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CalculateBaselineResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -201,7 +201,7 @@ def calculate_baseline( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CalculateBaselineResponse', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py index f9dcf79d380d..5633dfdd4b07 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2018-11-27-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json index 904ce44141fb..e8bd03081bb2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py index 3d0dfcc9d9d5..fe69a0cda202 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.vm_insights = VMInsightsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py index ebb294089737..5a81e34b4d7a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2018-11-27-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py index 062436d432e4..3709f21b2721 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py @@ -43,7 +43,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.vm_insights = VMInsightsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py index f0d98fcfa390..e79fd543f141 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VMInsightsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ async def get_onboarding_status( self, resource_uri: str, **kwargs - ) -> "models.VMInsightsOnboardingStatus": + ) -> "_models.VMInsightsOnboardingStatus": """Retrieves the VM Insights onboarding status for the specified resource or resource scope. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource, or @@ -55,7 +55,7 @@ async def get_onboarding_status( :rtype: ~$(python-base-namespace).v2018_11_27_preview.models.VMInsightsOnboardingStatus :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VMInsightsOnboardingStatus"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VMInsightsOnboardingStatus"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -84,7 +84,7 @@ async def get_onboarding_status( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResponseWithError, response) + error = self._deserialize(_models.ResponseWithError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VMInsightsOnboardingStatus', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py index a76ef6e7f3ce..b2b629ba9c05 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VMInsightsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def get_onboarding_status( resource_uri, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VMInsightsOnboardingStatus" + # type: (...) -> "_models.VMInsightsOnboardingStatus" """Retrieves the VM Insights onboarding status for the specified resource or resource scope. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource, or @@ -60,7 +60,7 @@ def get_onboarding_status( :rtype: ~$(python-base-namespace).v2018_11_27_preview.models.VMInsightsOnboardingStatus :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VMInsightsOnboardingStatus"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VMInsightsOnboardingStatus"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -89,7 +89,7 @@ def get_onboarding_status( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResponseWithError, response) + error = self._deserialize(_models.ResponseWithError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VMInsightsOnboardingStatus', pipeline_response) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py index b745daf54047..5cf970c2ef54 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2019-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json index 24a87bcac7c4..318a583e4a56 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py index 694541caa5e9..b90703aeaea9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py @@ -52,7 +52,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py index 407068f252da..c0d937d37c2f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2019-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py index a02d6dfbcf12..4b680046b942 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py index 71171f8d75e8..97335a1b91b4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, action_group_name: str, - action_group: "models.ActionGroupResource", + action_group: "_models.ActionGroupResource", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2019_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, action_group_name: str, **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Get an action group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, action_group_name: str, - action_group_patch: "models.ActionGroupPatchBody", + action_group_patch: "_models.ActionGroupPatchBody", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def update( :rtype: ~$(python-base-namespace).v2019_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +283,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -297,7 +297,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,7 +350,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -365,7 +365,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -375,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +421,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -436,7 +436,7 @@ async def enable_receiver( self, resource_group_name: str, action_group_name: str, - enable_request: "models.EnableRequest", + enable_request: "_models.EnableRequest", **kwargs ) -> None: """Enable a receiver in an action group. This changes the receiver's status from Disabled to @@ -489,7 +489,7 @@ async def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py index 1fbc07aa9dbc..a3b9afcfcf6d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py @@ -15,7 +15,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class BaselinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -52,9 +52,9 @@ def list( aggregation: Optional[str] = None, sensitivities: Optional[str] = None, filter: Optional[str] = None, - result_type: Optional[Union[str, "models.ResultType"]] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, **kwargs - ) -> AsyncIterable["models.MetricBaselinesResponse"]: + ) -> AsyncIterable["_models.MetricBaselinesResponse"]: """**Lists the metric baseline values for a resource**. :param resource_uri: The identifier of the resource. @@ -90,7 +90,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_03_01.models.MetricBaselinesResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricBaselinesResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricBaselinesResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -151,7 +151,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py index 51eb052aeaca..c9fbe20773ce 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str action_group_name, # type: str - action_group, # type: "models.ActionGroupResource" + action_group, # type: "_models.ActionGroupResource" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2019_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( action_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Get an action group. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str action_group_name, # type: str - action_group_patch, # type: "models.ActionGroupPatchBody" + action_group_patch, # type: "_models.ActionGroupPatchBody" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def update( :rtype: ~$(python-base-namespace).v2019_03_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -306,7 +306,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -359,7 +359,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -375,7 +375,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_03_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -446,7 +446,7 @@ def enable_receiver( self, resource_group_name, # type: str action_group_name, # type: str - enable_request, # type: "models.EnableRequest" + enable_request, # type: "_models.EnableRequest" **kwargs # type: Any ): # type: (...) -> None @@ -500,7 +500,7 @@ def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py index 9cd5ecd4ec9f..694d1ae0d6c6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py @@ -15,7 +15,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class BaselinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -56,10 +56,10 @@ def list( aggregation=None, # type: Optional[str] sensitivities=None, # type: Optional[str] filter=None, # type: Optional[str] - result_type=None, # type: Optional[Union[str, "models.ResultType"]] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] **kwargs # type: Any ): - # type: (...) -> Iterable["models.MetricBaselinesResponse"] + # type: (...) -> Iterable["_models.MetricBaselinesResponse"] """**Lists the metric baseline values for a resource**. :param resource_uri: The identifier of the resource. @@ -95,7 +95,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_03_01.models.MetricBaselinesResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MetricBaselinesResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricBaselinesResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -156,7 +156,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py index e5a8708721ec..7a4937844a30 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2019-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json index f4fd97631fd6..cd0a23bc3ba7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py index 69d3e351d303..788ced9c71e7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py index 4926cceb67f8..e68fc84db57f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2019-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py index 5e632bf1b35f..91a5a9981a76 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py index 011ea1f3e2c5..234fd4de0997 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ActionGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, action_group_name: str, - action_group: "models.ActionGroupResource", + action_group: "_models.ActionGroupResource", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2019_06_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -117,7 +117,7 @@ async def get( resource_group_name: str, action_group_name: str, **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Get an action group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_06_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -231,9 +231,9 @@ async def update( self, resource_group_name: str, action_group_name: str, - action_group_patch: "models.ActionGroupPatchBody", + action_group_patch: "_models.ActionGroupPatchBody", **kwargs - ) -> "models.ActionGroupResource": + ) -> "_models.ActionGroupResource": """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def update( :rtype: ~$(python-base-namespace).v2019_06_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,7 +283,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -297,7 +297,7 @@ async def update( def list_by_subscription_id( self, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription_id( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_06_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,7 +350,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -365,7 +365,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ActionGroupList"]: + ) -> AsyncIterable["_models.ActionGroupList"]: """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -375,7 +375,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_06_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -421,7 +421,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -436,7 +436,7 @@ async def enable_receiver( self, resource_group_name: str, action_group_name: str, - enable_request: "models.EnableRequest", + enable_request: "_models.EnableRequest", **kwargs ) -> None: """Enable a receiver in an action group. This changes the receiver's status from Disabled to @@ -489,7 +489,7 @@ async def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py index 6ce83244aee8..5e5beb6f7e23 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ActionGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str action_group_name, # type: str - action_group, # type: "models.ActionGroupResource" + action_group, # type: "_models.ActionGroupResource" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Create a new action group or update an existing one. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2019_06_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -123,7 +123,7 @@ def get( action_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Get an action group. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_06_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -238,10 +238,10 @@ def update( self, resource_group_name, # type: str action_group_name, # type: str - action_group_patch, # type: "models.ActionGroupPatchBody" + action_group_patch, # type: "_models.ActionGroupPatchBody" **kwargs # type: Any ): - # type: (...) -> "models.ActionGroupResource" + # type: (...) -> "_models.ActionGroupResource" """Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def update( :rtype: ~$(python-base-namespace).v2019_06_01.models.ActionGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -306,7 +306,7 @@ def list_by_subscription_id( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription_id( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_06_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -359,7 +359,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -375,7 +375,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ActionGroupList"] + # type: (...) -> Iterable["_models.ActionGroupList"] """Get a list of all action groups in a resource group. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_06_01.models.ActionGroupList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -446,7 +446,7 @@ def enable_receiver( self, resource_group_name, # type: str action_group_name, # type: str - enable_request, # type: "models.EnableRequest" + enable_request, # type: "_models.EnableRequest" **kwargs # type: Any ): # type: (...) -> None @@ -500,7 +500,7 @@ def enable_receiver( if response.status_code not in [200, 409]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py index ae5dc051a0ce..88dfe78c795b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py @@ -49,7 +49,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2019-10-17-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json index db10af186408..673f1ee0b046 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "The Azure subscription Id.", "docstring_type": "str", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py index 7e250df0fab0..2ffccb0ba2ef 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py @@ -62,7 +62,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.private_link_scopes = PrivateLinkScopesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py index 21d6b4e30631..f2c5b1645d74 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py @@ -46,7 +46,7 @@ def __init__( self.subscription_id = subscription_id self.api_version = "2019-10-17-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py index 17ff10edd576..b281b1e23a5f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py @@ -59,7 +59,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.private_link_scopes = PrivateLinkScopesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py index b41712ae5507..6737376e3138 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( scope_name: str, private_endpoint_connection_name: str, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Gets a private endpoint connection. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> Optional["models.PrivateEndpointConnection"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] + ) -> Optional["_models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -167,9 +167,9 @@ async def begin_create_or_update( resource_group_name: str, scope_name: str, private_endpoint_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> AsyncLROPoller["models.PrivateEndpointConnection"]: + ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -217,7 +217,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -323,7 +330,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -342,7 +356,7 @@ def list_by_private_link_scope( resource_group_name: str, scope_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets all private endpoint connections on a private link scope. :param resource_group_name: The name of the resource group. @@ -354,7 +368,7 @@ def list_by_private_link_scope( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_10_17.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py index 12fcc4dbf996..bed75a78ceaf 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class PrivateLinkResourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list_by_private_link_scope( resource_group_name: str, scope_name: str, **kwargs - ) -> AsyncIterable["models.PrivateLinkResourceListResult"]: + ) -> AsyncIterable["_models.PrivateLinkResourceListResult"]: """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -58,7 +58,7 @@ def list_by_private_link_scope( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_10_17.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -121,7 +121,7 @@ async def get( scope_name: str, group_name: str, **kwargs - ) -> "models.PrivateLinkResource": + ) -> "_models.PrivateLinkResource": """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py index 3243b12b7d98..a5b6373e2a95 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PrivateLinkScopeOperationStatusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( async_operation_id: str, resource_group_name: str, **kwargs - ) -> "models.OperationStatus": + ) -> "_models.OperationStatus": """Get the status of an azure asynchronous operation associated with a private link scope operation. @@ -58,7 +58,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.OperationStatus :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py index 2ca14616f0fa..54a032f85139 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkScopedResourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get( scope_name: str, name: str, **kwargs - ) -> "models.ScopedResource": + ) -> "_models.ScopedResource": """Gets a scoped resource in a private link scope. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.ScopedResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScopedResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _create_or_update_initial( resource_group_name: str, scope_name: str, name: str, - parameters: "models.ScopedResource", + parameters: "_models.ScopedResource", **kwargs - ) -> Optional["models.ScopedResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ScopedResource"]] + ) -> Optional["_models.ScopedResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ScopedResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -170,9 +170,9 @@ async def begin_create_or_update( resource_group_name: str, scope_name: str, name: str, - parameters: "models.ScopedResource", + parameters: "_models.ScopedResource", **kwargs - ) -> AsyncLROPoller["models.ScopedResource"]: + ) -> AsyncLROPoller["_models.ScopedResource"]: """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -194,7 +194,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScopedResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -326,7 +333,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -345,7 +359,7 @@ def list_by_private_link_scope( resource_group_name: str, scope_name: str, **kwargs - ) -> AsyncIterable["models.ScopedResourceListResult"]: + ) -> AsyncIterable["_models.ScopedResourceListResult"]: """Gets all private endpoint connections on a private link scope. :param resource_group_name: The name of the resource group. @@ -357,7 +371,7 @@ def list_by_private_link_scope( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_10_17.models.ScopedResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScopedResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py index 1ff852ac71bc..64888edbabcb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateLinkScopesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.AzureMonitorPrivateLinkScopeListResult"]: + ) -> AsyncIterable["_models.AzureMonitorPrivateLinkScopeListResult"]: """Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScopeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,7 +113,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AzureMonitorPrivateLinkScopeListResult"]: + ) -> AsyncIterable["_models.AzureMonitorPrivateLinkScopeListResult"]: """Gets a list of Azure Monitor PrivateLinkScopes within a resource group. :param resource_group_name: The name of the resource group. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScopeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -265,7 +265,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -284,7 +290,7 @@ async def get( resource_group_name: str, scope_name: str, **kwargs - ) -> "models.AzureMonitorPrivateLinkScope": + ) -> "_models.AzureMonitorPrivateLinkScope": """Returns a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -296,7 +302,7 @@ async def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,9 +347,9 @@ async def create_or_update( self, resource_group_name: str, scope_name: str, - azure_monitor_private_link_scope_payload: "models.AzureMonitorPrivateLinkScope", + azure_monitor_private_link_scope_payload: "_models.AzureMonitorPrivateLinkScope", **kwargs - ) -> "models.AzureMonitorPrivateLinkScope": + ) -> "_models.AzureMonitorPrivateLinkScope": """Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. @@ -359,7 +365,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,9 +419,9 @@ async def update_tags( self, resource_group_name: str, scope_name: str, - private_link_scope_tags: "models.TagsResource", + private_link_scope_tags: "_models.TagsResource", **kwargs - ) -> "models.AzureMonitorPrivateLinkScope": + ) -> "_models.AzureMonitorPrivateLinkScope": """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. @@ -431,7 +437,7 @@ async def update_tags( :rtype: ~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py index 795d9364097f..db80c9574e45 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( private_endpoint_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Gets a private endpoint connection. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str scope_name, # type: str private_endpoint_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> Optional["models.PrivateEndpointConnection"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] + # type: (...) -> Optional["_models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,10 +173,10 @@ def begin_create_or_update( resource_group_name, # type: str scope_name, # type: str private_endpoint_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.PrivateEndpointConnection"] + # type: (...) -> LROPoller["_models.PrivateEndpointConnection"] """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -198,7 +198,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -224,7 +224,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -332,7 +339,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -352,7 +366,7 @@ def list_by_private_link_scope( scope_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets all private endpoint connections on a private link scope. :param resource_group_name: The name of the resource group. @@ -364,7 +378,7 @@ def list_by_private_link_scope( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_10_17.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py index 25bd633a17fd..6620eacc112b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class PrivateLinkResourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list_by_private_link_scope( scope_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateLinkResourceListResult"] + # type: (...) -> Iterable["_models.PrivateLinkResourceListResult"] """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ def list_by_private_link_scope( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_10_17.models.PrivateLinkResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -127,7 +127,7 @@ def get( group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkResource" + # type: (...) -> "_models.PrivateLinkResource" """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -141,7 +141,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py index 3f289ceffea1..e1f637aaf3b5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PrivateLinkScopeOperationStatusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatus" + # type: (...) -> "_models.OperationStatus" """Get the status of an azure asynchronous operation associated with a private link scope operation. @@ -63,7 +63,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.OperationStatus :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py index 6c192514ac5a..7aa45cf03bd3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkScopedResourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ScopedResource" + # type: (...) -> "_models.ScopedResource" """Gets a scoped resource in a private link scope. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.ScopedResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScopedResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _create_or_update_initial( resource_group_name, # type: str scope_name, # type: str name, # type: str - parameters, # type: "models.ScopedResource" + parameters, # type: "_models.ScopedResource" **kwargs # type: Any ): - # type: (...) -> Optional["models.ScopedResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ScopedResource"]] + # type: (...) -> Optional["_models.ScopedResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ScopedResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -176,10 +176,10 @@ def begin_create_or_update( resource_group_name, # type: str scope_name, # type: str name, # type: str - parameters, # type: "models.ScopedResource" + parameters, # type: "_models.ScopedResource" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.ScopedResource"] + # type: (...) -> LROPoller["_models.ScopedResource"] """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -201,7 +201,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScopedResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -355,7 +369,7 @@ def list_by_private_link_scope( scope_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ScopedResourceListResult"] + # type: (...) -> Iterable["_models.ScopedResourceListResult"] """Gets all private endpoint connections on a private link scope. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list_by_private_link_scope( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_10_17.models.ScopedResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScopedResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py index 8e10edb8e9ed..147a41ec0f0e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateLinkScopesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureMonitorPrivateLinkScopeListResult"] + # type: (...) -> Iterable["_models.AzureMonitorPrivateLinkScopeListResult"] """Gets a list of all Azure Monitor PrivateLinkScopes within a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScopeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -119,7 +119,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AzureMonitorPrivateLinkScopeListResult"] + # type: (...) -> Iterable["_models.AzureMonitorPrivateLinkScopeListResult"] """Gets a list of Azure Monitor PrivateLinkScopes within a resource group. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScopeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScopeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -273,7 +273,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -293,7 +299,7 @@ def get( scope_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AzureMonitorPrivateLinkScope" + # type: (...) -> "_models.AzureMonitorPrivateLinkScope" """Returns a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -305,7 +311,7 @@ def get( :rtype: ~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,10 +356,10 @@ def create_or_update( self, resource_group_name, # type: str scope_name, # type: str - azure_monitor_private_link_scope_payload, # type: "models.AzureMonitorPrivateLinkScope" + azure_monitor_private_link_scope_payload, # type: "_models.AzureMonitorPrivateLinkScope" **kwargs # type: Any ): - # type: (...) -> "models.AzureMonitorPrivateLinkScope" + # type: (...) -> "_models.AzureMonitorPrivateLinkScope" """Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. @@ -369,7 +375,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -423,10 +429,10 @@ def update_tags( self, resource_group_name, # type: str scope_name, # type: str - private_link_scope_tags, # type: "models.TagsResource" + private_link_scope_tags, # type: "_models.TagsResource" **kwargs # type: Any ): - # type: (...) -> "models.AzureMonitorPrivateLinkScope" + # type: (...) -> "_models.AzureMonitorPrivateLinkScope" """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. @@ -442,7 +448,7 @@ def update_tags( :rtype: ~$(python-base-namespace).v2019_10_17.models.AzureMonitorPrivateLinkScope :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureMonitorPrivateLinkScope"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py new file mode 100644 index 000000000000..fa63968b3759 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py @@ -0,0 +1,16 @@ +# 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py new file mode 100644 index 000000000000..7a00eb694f1e --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py @@ -0,0 +1,70 @@ +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-11-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json new file mode 100644 index 000000000000..c0b06cb89a14 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-11-01-preview", + "total_api_version_list": ["2019-11-01-preview"], + "client": { + "name": "MonitorClient", + "filename": "_monitor_client", + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "data_collection_rule_associations": "DataCollectionRuleAssociationsOperations", + "data_collection_rules": "DataCollectionRulesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_client.py new file mode 100644 index 000000000000..528421a8cb96 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_client.py @@ -0,0 +1,73 @@ +# 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import DataCollectionRuleAssociationsOperations +from .operations import DataCollectionRulesOperations +from . import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar data_collection_rule_associations: DataCollectionRuleAssociationsOperations operations + :vartype data_collection_rule_associations: $(python-base-namespace).v2019_11_01_preview.operations.DataCollectionRuleAssociationsOperations + :ivar data_collection_rules: DataCollectionRulesOperations operations + :vartype data_collection_rules: $(python-base-namespace).v2019_11_01_preview.operations.DataCollectionRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.data_collection_rule_associations = DataCollectionRuleAssociationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_collection_rules = DataCollectionRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MonitorClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/__init__.py new file mode 100644 index 000000000000..7096a59fbc1f --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..d84f7c4bcb3d --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-11-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_client.py new file mode 100644 index 000000000000..b435d889ab51 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_client.py @@ -0,0 +1,67 @@ +# 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 typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import DataCollectionRuleAssociationsOperations +from .operations import DataCollectionRulesOperations +from .. import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar data_collection_rule_associations: DataCollectionRuleAssociationsOperations operations + :vartype data_collection_rule_associations: $(python-base-namespace).v2019_11_01_preview.aio.operations.DataCollectionRuleAssociationsOperations + :ivar data_collection_rules: DataCollectionRulesOperations operations + :vartype data_collection_rules: $(python-base-namespace).v2019_11_01_preview.aio.operations.DataCollectionRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.data_collection_rule_associations = DataCollectionRuleAssociationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_collection_rules = DataCollectionRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MonitorClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..f755a04ab065 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 ._data_collection_rule_associations_operations import DataCollectionRuleAssociationsOperations +from ._data_collection_rules_operations import DataCollectionRulesOperations + +__all__ = [ + 'DataCollectionRuleAssociationsOperations', + 'DataCollectionRulesOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/_data_collection_rule_associations_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/_data_collection_rule_associations_operations.py new file mode 100644 index 000000000000..b1cf0eab42bd --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/_data_collection_rule_associations_operations.py @@ -0,0 +1,384 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRuleAssociationsOperations: + """DataCollectionRuleAssociationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + resource_uri: str, + **kwargs + ) -> AsyncIterable["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"]: + """Lists associations for the specified resource. + + Lists associations for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations'} # type: ignore + + def list_by_rule( + self, + resource_group_name: str, + data_collection_rule_name: str, + **kwargs + ) -> AsyncIterable["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"]: + """Lists associations for the specified data collection rule. + + Lists associations for the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_rule.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations'} # type: ignore + + async def get( + self, + resource_uri: str, + association_name: str, + **kwargs + ) -> "_models.DataCollectionRuleAssociationProxyOnlyResource": + """Returns the specified association. + + Returns the specified association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + async def create( + self, + resource_uri: str, + association_name: str, + body: Optional["_models.DataCollectionRuleAssociationProxyOnlyResource"] = None, + **kwargs + ) -> "_models.DataCollectionRuleAssociationProxyOnlyResource": + """Creates or updates an association. + + Creates or updates an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleAssociationProxyOnlyResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + async def delete( + self, + resource_uri: str, + association_name: str, + **kwargs + ) -> None: + """Deletes an association. + + Deletes an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/_data_collection_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/_data_collection_rules_operations.py new file mode 100644 index 000000000000..eaa21916a40e --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/operations/_data_collection_rules_operations.py @@ -0,0 +1,455 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRulesOperations: + """DataCollectionRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DataCollectionRuleResourceListResult"]: + """Lists all data collection rules in the specified resource group. + + Lists all data collection rules in the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.DataCollectionRuleResourceListResult"]: + """Lists all data collection rules in the specified subscription. + + Lists all data collection rules in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + async def get( + self, + resource_group_name: str, + data_collection_rule_name: str, + **kwargs + ) -> "_models.DataCollectionRuleResource": + """Returns the specified data collection rule. + + Returns the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + data_collection_rule_name: str, + body: Optional["_models.DataCollectionRuleResource"] = None, + **kwargs + ) -> "_models.DataCollectionRuleResource": + """Creates or updates a data collection rule. + + Creates or updates a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + data_collection_rule_name: str, + body: Optional["_models.ResourceForUpdate"] = None, + **kwargs + ) -> "_models.DataCollectionRuleResource": + """Updates part of a data collection rule. + + Updates part of a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.ResourceForUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourceForUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + data_collection_rule_name: str, + **kwargs + ) -> None: + """Deletes a data collection rule. + + Deletes a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py new file mode 100644 index 000000000000..161faf6d805f --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py @@ -0,0 +1,122 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureMonitorMetricsDestination + from ._models_py3 import DataCollectionRule + from ._models_py3 import DataCollectionRuleAssociation + from ._models_py3 import DataCollectionRuleAssociationProxyOnlyResource + from ._models_py3 import DataCollectionRuleAssociationProxyOnlyResourceListResult + from ._models_py3 import DataCollectionRuleAssociationProxyOnlyResourceProperties + from ._models_py3 import DataCollectionRuleDataSources + from ._models_py3 import DataCollectionRuleDestinations + from ._models_py3 import DataCollectionRuleResource + from ._models_py3 import DataCollectionRuleResourceListResult + from ._models_py3 import DataCollectionRuleResourceProperties + from ._models_py3 import DataFlow + from ._models_py3 import DataSourcesSpec + from ._models_py3 import DestinationsSpec + from ._models_py3 import DestinationsSpecAzureMonitorMetrics + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorDetailsAutoGenerated + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseAutoGenerated + from ._models_py3 import ErrorResponseError + from ._models_py3 import ErrorResponseErrorAutoGenerated + from ._models_py3 import ExtensionDataSource + from ._models_py3 import LogAnalyticsDestination + from ._models_py3 import PerfCounterDataSource + from ._models_py3 import ResourceForUpdate + from ._models_py3 import SyslogDataSource + from ._models_py3 import WindowsEventLogDataSource +except (SyntaxError, ImportError): + from ._models import AzureMonitorMetricsDestination # type: ignore + from ._models import DataCollectionRule # type: ignore + from ._models import DataCollectionRuleAssociation # type: ignore + from ._models import DataCollectionRuleAssociationProxyOnlyResource # type: ignore + from ._models import DataCollectionRuleAssociationProxyOnlyResourceListResult # type: ignore + from ._models import DataCollectionRuleAssociationProxyOnlyResourceProperties # type: ignore + from ._models import DataCollectionRuleDataSources # type: ignore + from ._models import DataCollectionRuleDestinations # type: ignore + from ._models import DataCollectionRuleResource # type: ignore + from ._models import DataCollectionRuleResourceListResult # type: ignore + from ._models import DataCollectionRuleResourceProperties # type: ignore + from ._models import DataFlow # type: ignore + from ._models import DataSourcesSpec # type: ignore + from ._models import DestinationsSpec # type: ignore + from ._models import DestinationsSpecAzureMonitorMetrics # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetails # type: ignore + from ._models import ErrorDetailsAutoGenerated # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseAutoGenerated # type: ignore + from ._models import ErrorResponseError # type: ignore + from ._models import ErrorResponseErrorAutoGenerated # type: ignore + from ._models import ExtensionDataSource # type: ignore + from ._models import LogAnalyticsDestination # type: ignore + from ._models import PerfCounterDataSource # type: ignore + from ._models import ResourceForUpdate # type: ignore + from ._models import SyslogDataSource # type: ignore + from ._models import WindowsEventLogDataSource # type: ignore + +from ._monitor_client_enums import ( + KnownDataCollectionRuleAssociationProvisioningState, + KnownDataCollectionRuleProvisioningState, + KnownDataFlowStreams, + KnownExtensionDataSourceStreams, + KnownPerfCounterDataSourceScheduledTransferPeriod, + KnownPerfCounterDataSourceStreams, + KnownSyslogDataSourceFacilityNames, + KnownSyslogDataSourceLogLevels, + KnownSyslogDataSourceStreams, + KnownWindowsEventLogDataSourceScheduledTransferPeriod, + KnownWindowsEventLogDataSourceStreams, +) + +__all__ = [ + 'AzureMonitorMetricsDestination', + 'DataCollectionRule', + 'DataCollectionRuleAssociation', + 'DataCollectionRuleAssociationProxyOnlyResource', + 'DataCollectionRuleAssociationProxyOnlyResourceListResult', + 'DataCollectionRuleAssociationProxyOnlyResourceProperties', + 'DataCollectionRuleDataSources', + 'DataCollectionRuleDestinations', + 'DataCollectionRuleResource', + 'DataCollectionRuleResourceListResult', + 'DataCollectionRuleResourceProperties', + 'DataFlow', + 'DataSourcesSpec', + 'DestinationsSpec', + 'DestinationsSpecAzureMonitorMetrics', + 'ErrorAdditionalInfo', + 'ErrorDetails', + 'ErrorDetailsAutoGenerated', + 'ErrorResponse', + 'ErrorResponseAutoGenerated', + 'ErrorResponseError', + 'ErrorResponseErrorAutoGenerated', + 'ExtensionDataSource', + 'LogAnalyticsDestination', + 'PerfCounterDataSource', + 'ResourceForUpdate', + 'SyslogDataSource', + 'WindowsEventLogDataSource', + 'KnownDataCollectionRuleAssociationProvisioningState', + 'KnownDataCollectionRuleProvisioningState', + 'KnownDataFlowStreams', + 'KnownExtensionDataSourceStreams', + 'KnownPerfCounterDataSourceScheduledTransferPeriod', + 'KnownPerfCounterDataSourceStreams', + 'KnownSyslogDataSourceFacilityNames', + 'KnownSyslogDataSourceLogLevels', + 'KnownSyslogDataSourceStreams', + 'KnownWindowsEventLogDataSourceScheduledTransferPeriod', + 'KnownWindowsEventLogDataSourceStreams', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py new file mode 100644 index 000000000000..60075942c9d5 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py @@ -0,0 +1,1089 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AzureMonitorMetricsDestination(msrest.serialization.Model): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureMonitorMetricsDestination, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class DataCollectionRule(msrest.serialization.Model): + """Definition of what monitoring data to collect and where that data should be sent. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.data_sources = kwargs.get('data_sources', None) + self.destinations = kwargs['destinations'] + self.data_flows = kwargs['data_flows'] + self.provisioning_state = None + + +class DataCollectionRuleAssociation(msrest.serialization.Model): + """Definition of association of a data collection rule with a monitored Azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociation, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.data_collection_rule_id = kwargs['data_collection_rule_id'] + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResource(msrest.serialization.Model): + """Definition of generic ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'properties.dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = kwargs.get('description', None) + self.data_collection_rule_id = kwargs['data_collection_rule_id'] + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleAssociationProxyOnlyResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DataCollectionRuleAssociationProxyOnlyResourceProperties(DataCollectionRuleAssociation): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceProperties, self).__init__(**kwargs) + + +class DataSourcesSpec(msrest.serialization.Model): + """Specification of data sources that will be collected. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSourcesSpec, self).__init__(**kwargs) + self.performance_counters = kwargs.get('performance_counters', None) + self.windows_event_logs = kwargs.get('windows_event_logs', None) + self.syslog = kwargs.get('syslog', None) + self.extensions = kwargs.get('extensions', None) + + +class DataCollectionRuleDataSources(DataSourcesSpec): + """The specification of data sources. +This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleDataSources, self).__init__(**kwargs) + + +class DestinationsSpec(msrest.serialization.Model): + """Specification of destinations that can be used in data flows. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + **kwargs + ): + super(DestinationsSpec, self).__init__(**kwargs) + self.log_analytics = kwargs.get('log_analytics', None) + self.azure_monitor_metrics = kwargs.get('azure_monitor_metrics', None) + + +class DataCollectionRuleDestinations(DestinationsSpec): + """The specification of destinations. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleDestinations, self).__init__(**kwargs) + + +class DataCollectionRuleResource(msrest.serialization.Model): + """Definition of ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The geo-location where the resource lives. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_sources': {'key': 'properties.dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'properties.destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'properties.dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleResource, self).__init__(**kwargs) + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = kwargs.get('description', None) + self.data_sources = kwargs.get('data_sources', None) + self.destinations = kwargs['destinations'] + self.data_flows = kwargs['data_flows'] + self.provisioning_state = None + + +class DataCollectionRuleResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleResourceListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class DataCollectionRuleResourceProperties(DataCollectionRule): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCollectionRuleResourceProperties, self).__init__(**kwargs) + + +class DataFlow(msrest.serialization.Model): + """Definition of which streams are sent to which destinations. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams for this data flow. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataFlowStreams] + :param destinations: Required. List of destinations for this data flow. + :type destinations: list[str] + """ + + _validation = { + 'streams': {'required': True}, + 'destinations': {'required': True}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataFlow, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.destinations = kwargs['destinations'] + + +class DestinationsSpecAzureMonitorMetrics(AzureMonitorMetricsDestination): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DestinationsSpecAzureMonitorMetrics, self).__init__(**kwargs) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """Additional information for common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetails(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorDetailsAutoGenerated(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetailsAutoGenerated, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseAutoGenerated(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseAutoGenerated, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseError(ErrorDetails): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + + +class ErrorResponseErrorAutoGenerated(ErrorDetailsAutoGenerated): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorAutoGenerated, self).__init__(**kwargs) + + +class ExtensionDataSource(msrest.serialization.Model): + """Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. +Collected from either Windows and Linux machines, depending on which extension is defined. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownExtensionDataSourceStreams] + :param extension_name: Required. The name of the VM extension. + :type extension_name: str + :param extension_settings: The extension settings. The format is specific for particular + extension. + :type extension_settings: object + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'extension_name': {'required': True, 'max_length': 64, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'extension_settings': {'key': 'extensionSettings', 'type': 'object'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.extension_name = kwargs['extension_name'] + self.extension_settings = kwargs.get('extension_settings', None) + self.name = kwargs['name'] + + +class LogAnalyticsDestination(msrest.serialization.Model): + """Log Analytics destination. + + All required parameters must be populated in order to send to Azure. + + :param workspace_resource_id: Required. The resource ID of the Log Analytics workspace. + :type workspace_resource_id: str + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'workspace_resource_id': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsDestination, self).__init__(**kwargs) + self.workspace_resource_id = kwargs['workspace_resource_id'] + self.name = kwargs['name'] + + +class PerfCounterDataSource(msrest.serialization.Model): + """Definition of which performance counters will be collected and how they will be collected by this data collection rule. +Collected from both Windows and Linux machines where the counter is present. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceScheduledTransferPeriod + :param sampling_frequency_in_seconds: Required. The number of seconds between consecutive + counter measurements (samples). + :type sampling_frequency_in_seconds: int + :param counter_specifiers: Required. A list of specifier names of the performance counters you + want to collect. + Use a wildcard (*) to collect a counter for all instances. + To get a list of performance counters on Windows, run the command 'typeperf'. + :type counter_specifiers: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'sampling_frequency_in_seconds': {'required': True, 'maximum': 30, 'minimum': 1}, + 'counter_specifiers': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'sampling_frequency_in_seconds': {'key': 'samplingFrequencyInSeconds', 'type': 'int'}, + 'counter_specifiers': {'key': 'counterSpecifiers', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfCounterDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.scheduled_transfer_period = kwargs['scheduled_transfer_period'] + self.sampling_frequency_in_seconds = kwargs['sampling_frequency_in_seconds'] + self.counter_specifiers = kwargs['counter_specifiers'] + self.name = kwargs['name'] + + +class ResourceForUpdate(msrest.serialization.Model): + """Definition of ARM tracked top level resource properties for update operation. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceForUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class SyslogDataSource(msrest.serialization.Model): + """Definition of which syslog data will be collected and how it will be collected. +Only collected from Linux machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceStreams] + :param facility_names: Required. The list of facility names. + :type facility_names: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceFacilityNames] + :param log_levels: The log levels to collect. + :type log_levels: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceLogLevels] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'facility_names': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'facility_names': {'key': 'facilityNames', 'type': '[str]'}, + 'log_levels': {'key': 'logLevels', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SyslogDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.facility_names = kwargs['facility_names'] + self.log_levels = kwargs.get('log_levels', None) + self.name = kwargs['name'] + + +class WindowsEventLogDataSource(msrest.serialization.Model): + """Definition of which Windows Event Log events will be collected and how they will be collected. +Only collected from Windows machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceScheduledTransferPeriod + :param x_path_queries: Required. A list of Windows Event Log queries in XPATH format. + :type x_path_queries: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'x_path_queries': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'x_path_queries': {'key': 'xPathQueries', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsEventLogDataSource, self).__init__(**kwargs) + self.streams = kwargs['streams'] + self.scheduled_transfer_period = kwargs['scheduled_transfer_period'] + self.x_path_queries = kwargs['x_path_queries'] + self.name = kwargs['name'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..2a19661dae90 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py @@ -0,0 +1,1174 @@ +# 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 typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._monitor_client_enums import * + + +class AzureMonitorMetricsDestination(msrest.serialization.Model): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(AzureMonitorMetricsDestination, self).__init__(**kwargs) + self.name = name + + +class DataCollectionRule(msrest.serialization.Model): + """Definition of what monitoring data to collect and where that data should be sent. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + destinations: "DestinationsSpec", + data_flows: List["DataFlow"], + description: Optional[str] = None, + data_sources: Optional["DataSourcesSpec"] = None, + **kwargs + ): + super(DataCollectionRule, self).__init__(**kwargs) + self.description = description + self.data_sources = data_sources + self.destinations = destinations + self.data_flows = data_flows + self.provisioning_state = None + + +class DataCollectionRuleAssociation(msrest.serialization.Model): + """Definition of association of a data collection rule with a monitored Azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_collection_rule_id: str, + description: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociation, self).__init__(**kwargs) + self.description = description + self.data_collection_rule_id = data_collection_rule_id + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResource(msrest.serialization.Model): + """Definition of generic ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'properties.dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_collection_rule_id: str, + description: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = description + self.data_collection_rule_id = data_collection_rule_id + self.provisioning_state = None + + +class DataCollectionRuleAssociationProxyOnlyResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleAssociationProxyOnlyResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DataCollectionRuleAssociationProxyOnlyResource"], + next_link: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DataCollectionRuleAssociationProxyOnlyResourceProperties(DataCollectionRuleAssociation): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the association. + :type description: str + :param data_collection_rule_id: Required. The resource ID of the data collection rule that is + to be associated. + :type data_collection_rule_id: str + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleAssociationProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'data_collection_rule_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_collection_rule_id': {'key': 'dataCollectionRuleId', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_collection_rule_id: str, + description: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleAssociationProxyOnlyResourceProperties, self).__init__(description=description, data_collection_rule_id=data_collection_rule_id, **kwargs) + + +class DataSourcesSpec(msrest.serialization.Model): + """Specification of data sources that will be collected. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + *, + performance_counters: Optional[List["PerfCounterDataSource"]] = None, + windows_event_logs: Optional[List["WindowsEventLogDataSource"]] = None, + syslog: Optional[List["SyslogDataSource"]] = None, + extensions: Optional[List["ExtensionDataSource"]] = None, + **kwargs + ): + super(DataSourcesSpec, self).__init__(**kwargs) + self.performance_counters = performance_counters + self.windows_event_logs = windows_event_logs + self.syslog = syslog + self.extensions = extensions + + +class DataCollectionRuleDataSources(DataSourcesSpec): + """The specification of data sources. +This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. + + :param performance_counters: The list of performance counter data source configurations. + :type performance_counters: list[~$(python-base- + namespace).v2019_11_01_preview.models.PerfCounterDataSource] + :param windows_event_logs: The list of Windows Event Log data source configurations. + :type windows_event_logs: list[~$(python-base- + namespace).v2019_11_01_preview.models.WindowsEventLogDataSource] + :param syslog: The list of Syslog data source configurations. + :type syslog: list[~$(python-base-namespace).v2019_11_01_preview.models.SyslogDataSource] + :param extensions: The list of Azure VM extension data source configurations. + :type extensions: list[~$(python-base- + namespace).v2019_11_01_preview.models.ExtensionDataSource] + """ + + _attribute_map = { + 'performance_counters': {'key': 'performanceCounters', 'type': '[PerfCounterDataSource]'}, + 'windows_event_logs': {'key': 'windowsEventLogs', 'type': '[WindowsEventLogDataSource]'}, + 'syslog': {'key': 'syslog', 'type': '[SyslogDataSource]'}, + 'extensions': {'key': 'extensions', 'type': '[ExtensionDataSource]'}, + } + + def __init__( + self, + *, + performance_counters: Optional[List["PerfCounterDataSource"]] = None, + windows_event_logs: Optional[List["WindowsEventLogDataSource"]] = None, + syslog: Optional[List["SyslogDataSource"]] = None, + extensions: Optional[List["ExtensionDataSource"]] = None, + **kwargs + ): + super(DataCollectionRuleDataSources, self).__init__(performance_counters=performance_counters, windows_event_logs=windows_event_logs, syslog=syslog, extensions=extensions, **kwargs) + + +class DestinationsSpec(msrest.serialization.Model): + """Specification of destinations that can be used in data flows. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + *, + log_analytics: Optional[List["LogAnalyticsDestination"]] = None, + azure_monitor_metrics: Optional["AzureMonitorMetricsDestination"] = None, + **kwargs + ): + super(DestinationsSpec, self).__init__(**kwargs) + self.log_analytics = log_analytics + self.azure_monitor_metrics = azure_monitor_metrics + + +class DataCollectionRuleDestinations(DestinationsSpec): + """The specification of destinations. + + :param log_analytics: List of Log Analytics destinations. + :type log_analytics: list[~$(python-base- + namespace).v2019_11_01_preview.models.LogAnalyticsDestination] + :param azure_monitor_metrics: Azure Monitor Metrics destination. + :type azure_monitor_metrics: ~$(python-base- + namespace).v2019_11_01_preview.models.AzureMonitorMetricsDestination + """ + + _attribute_map = { + 'log_analytics': {'key': 'logAnalytics', 'type': '[LogAnalyticsDestination]'}, + 'azure_monitor_metrics': {'key': 'azureMonitorMetrics', 'type': 'AzureMonitorMetricsDestination'}, + } + + def __init__( + self, + *, + log_analytics: Optional[List["LogAnalyticsDestination"]] = None, + azure_monitor_metrics: Optional["AzureMonitorMetricsDestination"] = None, + **kwargs + ): + super(DataCollectionRuleDestinations, self).__init__(log_analytics=log_analytics, azure_monitor_metrics=azure_monitor_metrics, **kwargs) + + +class DataCollectionRuleResource(msrest.serialization.Model): + """Definition of ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The geo-location where the resource lives. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar id: Fully qualified ID of the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: Resource entity tag (ETag). + :vartype etag: str + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'location': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_sources': {'key': 'properties.dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'properties.destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'properties.dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + destinations: "DestinationsSpec", + data_flows: List["DataFlow"], + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + data_sources: Optional["DataSourcesSpec"] = None, + **kwargs + ): + super(DataCollectionRuleResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.id = None + self.name = None + self.type = None + self.etag = None + self.description = description + self.data_sources = data_sources + self.destinations = destinations + self.data_flows = data_flows + self.provisioning_state = None + + +class DataCollectionRuleResourceListResult(msrest.serialization.Model): + """A pageable list of resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of resources. + :type value: list[~$(python-base- + namespace).v2019_11_01_preview.models.DataCollectionRuleResource] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCollectionRuleResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DataCollectionRuleResource"], + next_link: Optional[str] = None, + **kwargs + ): + super(DataCollectionRuleResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DataCollectionRuleResourceProperties(DataCollectionRule): + """Resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param description: Description of the data collection rule. + :type description: str + :param data_sources: The specification of data sources. + This property is optional and can be omitted if the rule is meant to be used via direct calls + to the provisioned endpoint. + :type data_sources: ~$(python-base-namespace).v2019_11_01_preview.models.DataSourcesSpec + :param destinations: Required. The specification of destinations. + :type destinations: ~$(python-base-namespace).v2019_11_01_preview.models.DestinationsSpec + :param data_flows: Required. The specification of data flows. + :type data_flows: list[~$(python-base-namespace).v2019_11_01_preview.models.DataFlow] + :ivar provisioning_state: The resource provisioning state. Possible values include: "Creating", + "Updating", "Deleting", "Succeeded", "Failed". + :vartype provisioning_state: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataCollectionRuleProvisioningState + """ + + _validation = { + 'description': {'max_length': 256, 'min_length': 0}, + 'destinations': {'required': True}, + 'data_flows': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'data_sources': {'key': 'dataSources', 'type': 'DataSourcesSpec'}, + 'destinations': {'key': 'destinations', 'type': 'DestinationsSpec'}, + 'data_flows': {'key': 'dataFlows', 'type': '[DataFlow]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + destinations: "DestinationsSpec", + data_flows: List["DataFlow"], + description: Optional[str] = None, + data_sources: Optional["DataSourcesSpec"] = None, + **kwargs + ): + super(DataCollectionRuleResourceProperties, self).__init__(description=description, data_sources=data_sources, destinations=destinations, data_flows=data_flows, **kwargs) + + +class DataFlow(msrest.serialization.Model): + """Definition of which streams are sent to which destinations. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams for this data flow. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownDataFlowStreams] + :param destinations: Required. List of destinations for this data flow. + :type destinations: list[str] + """ + + _validation = { + 'streams': {'required': True}, + 'destinations': {'required': True}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'destinations': {'key': 'destinations', 'type': '[str]'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownDataFlowStreams"]], + destinations: List[str], + **kwargs + ): + super(DataFlow, self).__init__(**kwargs) + self.streams = streams + self.destinations = destinations + + +class DestinationsSpecAzureMonitorMetrics(AzureMonitorMetricsDestination): + """Azure Monitor Metrics destination. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(DestinationsSpecAzureMonitorMetrics, self).__init__(name=name, **kwargs) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """Additional information for common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetails(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorDetailsAutoGenerated(msrest.serialization.Model): + """Common error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetailsAutoGenerated, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseAutoGenerated(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseAutoGenerated, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseError(ErrorDetails): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + + +class ErrorResponseErrorAutoGenerated(ErrorDetailsAutoGenerated): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code which can be used to programmatically identify the class of error. + :vartype code: str + :ivar message: Describes the error in detail and provides debugging information. + :vartype message: str + :ivar target: The target of the particular error (for example, the name of the property in + error). + :vartype target: str + :ivar details: Additional nested error detail objects. + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] + :ivar additional_info: Additional error information. + :vartype additional_info: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorAutoGenerated, self).__init__(**kwargs) + + +class ExtensionDataSource(msrest.serialization.Model): + """Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. +Collected from either Windows and Linux machines, depending on which extension is defined. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownExtensionDataSourceStreams] + :param extension_name: Required. The name of the VM extension. + :type extension_name: str + :param extension_settings: The extension settings. The format is specific for particular + extension. + :type extension_settings: object + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'extension_name': {'required': True, 'max_length': 64, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'extension_name': {'key': 'extensionName', 'type': 'str'}, + 'extension_settings': {'key': 'extensionSettings', 'type': 'object'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownExtensionDataSourceStreams"]], + extension_name: str, + name: str, + extension_settings: Optional[object] = None, + **kwargs + ): + super(ExtensionDataSource, self).__init__(**kwargs) + self.streams = streams + self.extension_name = extension_name + self.extension_settings = extension_settings + self.name = name + + +class LogAnalyticsDestination(msrest.serialization.Model): + """Log Analytics destination. + + All required parameters must be populated in order to send to Azure. + + :param workspace_resource_id: Required. The resource ID of the Log Analytics workspace. + :type workspace_resource_id: str + :param name: Required. A friendly name for the destination. + This name should be unique across all destinations (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'workspace_resource_id': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + workspace_resource_id: str, + name: str, + **kwargs + ): + super(LogAnalyticsDestination, self).__init__(**kwargs) + self.workspace_resource_id = workspace_resource_id + self.name = name + + +class PerfCounterDataSource(msrest.serialization.Model): + """Definition of which performance counters will be collected and how they will be collected by this data collection rule. +Collected from both Windows and Linux machines where the counter is present. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownPerfCounterDataSourceScheduledTransferPeriod + :param sampling_frequency_in_seconds: Required. The number of seconds between consecutive + counter measurements (samples). + :type sampling_frequency_in_seconds: int + :param counter_specifiers: Required. A list of specifier names of the performance counters you + want to collect. + Use a wildcard (*) to collect a counter for all instances. + To get a list of performance counters on Windows, run the command 'typeperf'. + :type counter_specifiers: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'sampling_frequency_in_seconds': {'required': True, 'maximum': 30, 'minimum': 1}, + 'counter_specifiers': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'sampling_frequency_in_seconds': {'key': 'samplingFrequencyInSeconds', 'type': 'int'}, + 'counter_specifiers': {'key': 'counterSpecifiers', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownPerfCounterDataSourceStreams"]], + scheduled_transfer_period: Union[str, "KnownPerfCounterDataSourceScheduledTransferPeriod"], + sampling_frequency_in_seconds: int, + counter_specifiers: List[str], + name: str, + **kwargs + ): + super(PerfCounterDataSource, self).__init__(**kwargs) + self.streams = streams + self.scheduled_transfer_period = scheduled_transfer_period + self.sampling_frequency_in_seconds = sampling_frequency_in_seconds + self.counter_specifiers = counter_specifiers + self.name = name + + +class ResourceForUpdate(msrest.serialization.Model): + """Definition of ARM tracked top level resource properties for update operation. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ResourceForUpdate, self).__init__(**kwargs) + self.tags = tags + + +class SyslogDataSource(msrest.serialization.Model): + """Definition of which syslog data will be collected and how it will be collected. +Only collected from Linux machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceStreams] + :param facility_names: Required. The list of facility names. + :type facility_names: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceFacilityNames] + :param log_levels: The log levels to collect. + :type log_levels: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownSyslogDataSourceLogLevels] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'facility_names': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'facility_names': {'key': 'facilityNames', 'type': '[str]'}, + 'log_levels': {'key': 'logLevels', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownSyslogDataSourceStreams"]], + facility_names: List[Union[str, "KnownSyslogDataSourceFacilityNames"]], + name: str, + log_levels: Optional[List[Union[str, "KnownSyslogDataSourceLogLevels"]]] = None, + **kwargs + ): + super(SyslogDataSource, self).__init__(**kwargs) + self.streams = streams + self.facility_names = facility_names + self.log_levels = log_levels + self.name = name + + +class WindowsEventLogDataSource(msrest.serialization.Model): + """Definition of which Windows Event Log events will be collected and how they will be collected. +Only collected from Windows machines. + + All required parameters must be populated in order to send to Azure. + + :param streams: Required. List of streams that this data source will be sent to. + A stream indicates what schema will be used for this data and usually what table in Log + Analytics the data will be sent to. + :type streams: list[str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceStreams] + :param scheduled_transfer_period: Required. The interval between data uploads (scheduled + transfers), rounded up to the nearest minute. Possible values include: "PT1M", "PT5M", "PT15M", + "PT30M", "PT60M". + :type scheduled_transfer_period: str or ~$(python-base- + namespace).v2019_11_01_preview.models.KnownWindowsEventLogDataSourceScheduledTransferPeriod + :param x_path_queries: Required. A list of Windows Event Log queries in XPATH format. + :type x_path_queries: list[str] + :param name: Required. A friendly name for the data source. + This name should be unique across all data sources (regardless of type) within the data + collection rule. + :type name: str + """ + + _validation = { + 'streams': {'required': True}, + 'scheduled_transfer_period': {'required': True}, + 'x_path_queries': {'required': True}, + 'name': {'required': True, 'max_length': 32, 'min_length': 0, 'pattern': r'^[-\w\._\(\)]+$'}, + } + + _attribute_map = { + 'streams': {'key': 'streams', 'type': '[str]'}, + 'scheduled_transfer_period': {'key': 'scheduledTransferPeriod', 'type': 'str'}, + 'x_path_queries': {'key': 'xPathQueries', 'type': '[str]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + streams: List[Union[str, "KnownWindowsEventLogDataSourceStreams"]], + scheduled_transfer_period: Union[str, "KnownWindowsEventLogDataSourceScheduledTransferPeriod"], + x_path_queries: List[str], + name: str, + **kwargs + ): + super(WindowsEventLogDataSource, self).__init__(**kwargs) + self.streams = streams + self.scheduled_transfer_period = scheduled_transfer_period + self.x_path_queries = x_path_queries + self.name = name diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_client_enums.py new file mode 100644 index 000000000000..2308243d3ed4 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_client_enums.py @@ -0,0 +1,161 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class KnownDataCollectionRuleAssociationProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The resource provisioning state. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class KnownDataCollectionRuleProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The resource provisioning state. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class KnownDataFlowStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_ANTI_MALWARE_STATUS = "Microsoft-AntiMalwareStatus" + MICROSOFT_AUDITD = "Microsoft-Auditd" + MICROSOFT_CISCOASA = "Microsoft-CISCOASA" + MICROSOFT_COMMON_SECURITY_LOG = "Microsoft-CommonSecurityLog" + MICROSOFT_COMPUTER_GROUP = "Microsoft-ComputerGroup" + MICROSOFT_EVENT = "Microsoft-Event" + MICROSOFT_FIREWALL_LOG = "Microsoft-FirewallLog" + MICROSOFT_HEALTH_STATE_CHANGE = "Microsoft-HealthStateChange" + MICROSOFT_HEARTBEAT = "Microsoft-Heartbeat" + MICROSOFT_INSIGHTS_METRICS = "Microsoft-InsightsMetrics" + MICROSOFT_OPERATION_LOG = "Microsoft-OperationLog" + MICROSOFT_PERF = "Microsoft-Perf" + MICROSOFT_PROCESS_INVESTIGATOR = "Microsoft-ProcessInvestigator" + MICROSOFT_PROTECTION_STATUS = "Microsoft-ProtectionStatus" + MICROSOFT_ROME_DETECTION_EVENT = "Microsoft-RomeDetectionEvent" + MICROSOFT_SECURITY_BASELINE = "Microsoft-SecurityBaseline" + MICROSOFT_SECURITY_BASELINE_SUMMARY = "Microsoft-SecurityBaselineSummary" + MICROSOFT_SECURITY_EVENT = "Microsoft-SecurityEvent" + MICROSOFT_SYSLOG = "Microsoft-Syslog" + MICROSOFT_WINDOWS_EVENT = "Microsoft-WindowsEvent" + +class KnownExtensionDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_ANTI_MALWARE_STATUS = "Microsoft-AntiMalwareStatus" + MICROSOFT_AUDITD = "Microsoft-Auditd" + MICROSOFT_CISCOASA = "Microsoft-CISCOASA" + MICROSOFT_COMMON_SECURITY_LOG = "Microsoft-CommonSecurityLog" + MICROSOFT_COMPUTER_GROUP = "Microsoft-ComputerGroup" + MICROSOFT_EVENT = "Microsoft-Event" + MICROSOFT_FIREWALL_LOG = "Microsoft-FirewallLog" + MICROSOFT_HEALTH_STATE_CHANGE = "Microsoft-HealthStateChange" + MICROSOFT_HEARTBEAT = "Microsoft-Heartbeat" + MICROSOFT_INSIGHTS_METRICS = "Microsoft-InsightsMetrics" + MICROSOFT_OPERATION_LOG = "Microsoft-OperationLog" + MICROSOFT_PERF = "Microsoft-Perf" + MICROSOFT_PROCESS_INVESTIGATOR = "Microsoft-ProcessInvestigator" + MICROSOFT_PROTECTION_STATUS = "Microsoft-ProtectionStatus" + MICROSOFT_ROME_DETECTION_EVENT = "Microsoft-RomeDetectionEvent" + MICROSOFT_SECURITY_BASELINE = "Microsoft-SecurityBaseline" + MICROSOFT_SECURITY_BASELINE_SUMMARY = "Microsoft-SecurityBaselineSummary" + MICROSOFT_SECURITY_EVENT = "Microsoft-SecurityEvent" + MICROSOFT_SYSLOG = "Microsoft-Syslog" + MICROSOFT_WINDOWS_EVENT = "Microsoft-WindowsEvent" + +class KnownPerfCounterDataSourceScheduledTransferPeriod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The interval between data uploads (scheduled transfers), rounded up to the nearest minute. + """ + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT60_M = "PT60M" + +class KnownPerfCounterDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_PERF = "Microsoft-Perf" + MICROSOFT_INSIGHTS_METRICS = "Microsoft-InsightsMetrics" + +class KnownSyslogDataSourceFacilityNames(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + AUTH = "auth" + AUTHPRIV = "authpriv" + CRON = "cron" + DAEMON = "daemon" + KERN = "kern" + LPR = "lpr" + MAIL = "mail" + MARK = "mark" + NEWS = "news" + SYSLOG = "syslog" + USER = "user" + UUCP = "UUCP" + LOCAL0 = "local0" + LOCAL1 = "local1" + LOCAL2 = "local2" + LOCAL3 = "local3" + LOCAL4 = "local4" + LOCAL5 = "local5" + LOCAL6 = "local6" + LOCAL7 = "local7" + +class KnownSyslogDataSourceLogLevels(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEBUG = "Debug" + INFO = "Info" + NOTICE = "Notice" + WARNING = "Warning" + ERROR = "Error" + CRITICAL = "Critical" + ALERT = "Alert" + EMERGENCY = "Emergency" + +class KnownSyslogDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_SYSLOG = "Microsoft-Syslog" + +class KnownWindowsEventLogDataSourceScheduledTransferPeriod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The interval between data uploads (scheduled transfers), rounded up to the nearest minute. + """ + + PT1_M = "PT1M" + PT5_M = "PT5M" + PT15_M = "PT15M" + PT30_M = "PT30M" + PT60_M = "PT60M" + +class KnownWindowsEventLogDataSourceStreams(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_WINDOWS_EVENT = "Microsoft-WindowsEvent" + MICROSOFT_EVENT = "Microsoft-Event" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/__init__.py new file mode 100644 index 000000000000..f755a04ab065 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/__init__.py @@ -0,0 +1,15 @@ +# 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 ._data_collection_rule_associations_operations import DataCollectionRuleAssociationsOperations +from ._data_collection_rules_operations import DataCollectionRulesOperations + +__all__ = [ + 'DataCollectionRuleAssociationsOperations', + 'DataCollectionRulesOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rule_associations_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rule_associations_operations.py new file mode 100644 index 000000000000..7217c7daf643 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rule_associations_operations.py @@ -0,0 +1,393 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRuleAssociationsOperations(object): + """DataCollectionRuleAssociationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource( + self, + resource_uri, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + """Lists associations for the specified resource. + + Lists associations for the specified resource. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations'} # type: ignore + + def list_by_rule( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + """Lists associations for the specified data collection rule. + + Lists associations for the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleAssociationProxyOnlyResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_rule.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations'} # type: ignore + + def get( + self, + resource_uri, # type: str + association_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataCollectionRuleAssociationProxyOnlyResource" + """Returns the specified association. + + Returns the specified association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + def create( + self, + resource_uri, # type: str + association_name, # type: str + body=None, # type: Optional["_models.DataCollectionRuleAssociationProxyOnlyResource"] + **kwargs # type: Any + ): + # type: (...) -> "_models.DataCollectionRuleAssociationProxyOnlyResource" + """Creates or updates an association. + + Creates or updates an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleAssociationProxyOnlyResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleAssociationProxyOnlyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleAssociationProxyOnlyResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleAssociationProxyOnlyResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleAssociationProxyOnlyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore + + def delete( + self, + resource_uri, # type: str + association_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an association. + + Deletes an association. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param association_name: The name of the association. + :type association_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True, min_length=1), + 'associationName': self._serialize.url("association_name", association_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rules_operations.py new file mode 100644 index 000000000000..9f555f1455d1 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/operations/_data_collection_rules_operations.py @@ -0,0 +1,465 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataCollectionRulesOperations(object): + """DataCollectionRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2019_11_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataCollectionRuleResourceListResult"] + """Lists all data collection rules in the specified resource group. + + Lists all data collection rules in the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DataCollectionRuleResourceListResult"] + """Lists all data collection rules in the specified subscription. + + Lists all data collection rules in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DataCollectionRuleResourceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResourceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataCollectionRuleResourceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataCollectionRuleResource" + """Returns the specified data collection rule. + + Returns the specified data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + body=None, # type: Optional["_models.DataCollectionRuleResource"] + **kwargs # type: Any + ): + # type: (...) -> "_models.DataCollectionRuleResource" + """Creates or updates a data collection rule. + + Creates or updates a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'DataCollectionRuleResource') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + body=None, # type: Optional["_models.ResourceForUpdate"] + **kwargs # type: Any + ): + # type: (...) -> "_models.DataCollectionRuleResource" + """Updates part of a data collection rule. + + Updates part of a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :param body: The payload. + :type body: ~$(python-base-namespace).v2019_11_01_preview.models.ResourceForUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataCollectionRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2019_11_01_preview.models.DataCollectionRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCollectionRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourceForUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataCollectionRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + data_collection_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a data collection rule. + + Deletes a data collection rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param data_collection_rule_name: The name of the data collection rule. The name is case + insensitive. + :type data_collection_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + 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\._\(\)]+$'), + 'dataCollectionRuleName': self._serialize.url("data_collection_rule_name", data_collection_rule_name, 'str', max_length=64, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/py.typed b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py index 7eb739ad65a6..40a30732e6b8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py @@ -43,7 +43,7 @@ def __init__( self.credential = credential self.api_version = "2020-01-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json index b801d74bf6ca..0e184819af2c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json @@ -8,20 +8,21 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py index 91f0fd5aed89..0a44a2308e03 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.management_group_diagnostic_settings = ManagementGroupDiagnosticSettingsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py index 9fc93fa75bff..f2814440fdb4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py @@ -40,7 +40,7 @@ def __init__( self.credential = credential self.api_version = "2020-01-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py index 1d880d8d1aee..0cb96dc6dedd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py @@ -43,7 +43,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.management_group_diagnostic_settings = ManagementGroupDiagnosticSettingsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py index cb67e01cbfc8..8ee8b141d012 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ManagementGroupDiagnosticSettingsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ async def get( management_group_id: str, name: str, **kwargs - ) -> "models.ManagementGroupDiagnosticSettingsResource": + ) -> "_models.ManagementGroupDiagnosticSettingsResource": """Gets the active management group diagnostic settings for the specified resource. :param management_group_id: The management group id. @@ -58,7 +58,7 @@ async def get( :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) @@ -103,9 +103,9 @@ async def create_or_update( self, management_group_id: str, name: str, - parameters: "models.ManagementGroupDiagnosticSettingsResource", + parameters: "_models.ManagementGroupDiagnosticSettingsResource", **kwargs - ) -> "models.ManagementGroupDiagnosticSettingsResource": + ) -> "_models.ManagementGroupDiagnosticSettingsResource": """Creates or updates management group diagnostic settings for the specified resource. :param management_group_id: The management group id. @@ -119,7 +119,7 @@ async def create_or_update( :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) @@ -212,7 +212,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -224,7 +224,7 @@ def list( self, management_group_id: str, **kwargs - ) -> AsyncIterable["models.ManagementGroupDiagnosticSettingsResourceCollection"]: + ) -> AsyncIterable["_models.ManagementGroupDiagnosticSettingsResourceCollection"]: """Gets the active management group diagnostic settings list for the specified management group. :param management_group_id: The management group id. @@ -234,7 +234,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupDiagnosticSettingsResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -279,7 +279,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py index b1054afd8e9c..9f9bdc045e1b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ManagementGroupDiagnosticSettingsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def get( name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ManagementGroupDiagnosticSettingsResource" + # type: (...) -> "_models.ManagementGroupDiagnosticSettingsResource" """Gets the active management group diagnostic settings for the specified resource. :param management_group_id: The management group id. @@ -63,7 +63,7 @@ def get( :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) @@ -108,10 +108,10 @@ def create_or_update( self, management_group_id, # type: str name, # type: str - parameters, # type: "models.ManagementGroupDiagnosticSettingsResource" + parameters, # type: "_models.ManagementGroupDiagnosticSettingsResource" **kwargs # type: Any ): - # type: (...) -> "models.ManagementGroupDiagnosticSettingsResource" + # type: (...) -> "_models.ManagementGroupDiagnosticSettingsResource" """Creates or updates management group diagnostic settings for the specified resource. :param management_group_id: The management group id. @@ -125,7 +125,7 @@ def create_or_update( :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupDiagnosticSettingsResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) @@ -219,7 +219,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -232,7 +232,7 @@ def list( management_group_id, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ManagementGroupDiagnosticSettingsResourceCollection"] + # type: (...) -> Iterable["_models.ManagementGroupDiagnosticSettingsResourceCollection"] """Gets the active management group diagnostic settings list for the specified management group. :param management_group_id: The management group id. @@ -242,7 +242,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResourceCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementGroupDiagnosticSettingsResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -287,7 +287,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py new file mode 100644 index 000000000000..fa63968b3759 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py @@ -0,0 +1,16 @@ +# 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py new file mode 100644 index 000000000000..2fa9b101ed4e --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py @@ -0,0 +1,70 @@ +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-05-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json new file mode 100644 index 000000000000..6a6adf3cb4e5 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json @@ -0,0 +1,61 @@ +{ + "chosen_version": "2020-05-01-preview", + "total_api_version_list": ["2020-05-01-preview"], + "client": { + "name": "MonitorClient", + "filename": "_monitor_client", + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Azure subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The Azure subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "scheduled_query_rules": "ScheduledQueryRulesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_client.py new file mode 100644 index 000000000000..4b4d285ac25a --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_client.py @@ -0,0 +1,68 @@ +# 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import ScheduledQueryRulesOperations +from . import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations + :vartype scheduled_query_rules: $(python-base-namespace).v2020_05_01_preview.operations.ScheduledQueryRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription Id. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.scheduled_query_rules = ScheduledQueryRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MonitorClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/__init__.py new file mode 100644 index 000000000000..7096a59fbc1f --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..52ce19d524af --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription Id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-05-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_client.py new file mode 100644 index 000000000000..945168d2c165 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_client.py @@ -0,0 +1,62 @@ +# 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 typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import ScheduledQueryRulesOperations +from .. import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations + :vartype scheduled_query_rules: $(python-base-namespace).v2020_05_01_preview.aio.operations.ScheduledQueryRulesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Azure subscription Id. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.scheduled_query_rules = ScheduledQueryRulesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MonitorClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..f677702ed3df --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._scheduled_query_rules_operations import ScheduledQueryRulesOperations + +__all__ = [ + 'ScheduledQueryRulesOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py new file mode 100644 index 000000000000..25daa2f351dd --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py @@ -0,0 +1,433 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ScheduledQueryRulesOperations: + """ScheduledQueryRulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2020_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["_models.ScheduledQueryRuleResourceCollection"]: + """Retrieve a scheduled query rule definitions in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ScheduledQueryRuleResourceCollection"]: + """Retrieve scheduled query rule definitions in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore + + async def get( + self, + resource_group_name: str, + rule_name: str, + **kwargs + ) -> "_models.ScheduledQueryRuleResource": + """Retrieve an scheduled query rule definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + rule_name: str, + parameters: "_models.ScheduledQueryRuleResource", + **kwargs + ) -> "_models.ScheduledQueryRuleResource": + """Creates or updates a scheduled query rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to create or update. + :type parameters: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + rule_name: str, + parameters: "_models.ScheduledQueryRuleResourcePatch", + **kwargs + ) -> "_models.ScheduledQueryRuleResource": + """Update a scheduled query rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to update. + :type parameters: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResourcePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + rule_name: str, + **kwargs + ) -> None: + """Deletes a scheduled query rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py new file mode 100644 index 000000000000..58149d4e6127 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py @@ -0,0 +1,63 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Action + from ._models_py3 import Condition + from ._models_py3 import ConditionFailingPeriods + from ._models_py3 import Dimension + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorContract + from ._models_py3 import ErrorResponse + from ._models_py3 import Resource + from ._models_py3 import ScheduledQueryRuleCriteria + from ._models_py3 import ScheduledQueryRuleResource + from ._models_py3 import ScheduledQueryRuleResourceCollection + from ._models_py3 import ScheduledQueryRuleResourcePatch + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import Action # type: ignore + from ._models import Condition # type: ignore + from ._models import ConditionFailingPeriods # type: ignore + from ._models import Dimension # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorContract # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Resource # type: ignore + from ._models import ScheduledQueryRuleCriteria # type: ignore + from ._models import ScheduledQueryRuleResource # type: ignore + from ._models import ScheduledQueryRuleResourceCollection # type: ignore + from ._models import ScheduledQueryRuleResourcePatch # type: ignore + from ._models import TrackedResource # type: ignore + +from ._monitor_client_enums import ( + AlertSeverity, + ConditionOperator, + DimensionOperator, + TimeAggregation, +) + +__all__ = [ + 'Action', + 'Condition', + 'ConditionFailingPeriods', + 'Dimension', + 'ErrorAdditionalInfo', + 'ErrorContract', + 'ErrorResponse', + 'Resource', + 'ScheduledQueryRuleCriteria', + 'ScheduledQueryRuleResource', + 'ScheduledQueryRuleResourceCollection', + 'ScheduledQueryRuleResourcePatch', + 'TrackedResource', + 'AlertSeverity', + 'ConditionOperator', + 'DimensionOperator', + 'TimeAggregation', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models.py new file mode 100644 index 000000000000..65721a94a4ca --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models.py @@ -0,0 +1,530 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Action(msrest.serialization.Model): + """Actions to invoke when the alert fires. + + :param action_group_id: Action Group resource Id to invoke when the alert fires. + :type action_group_id: str + :param web_hook_properties: The properties of a webhook object. + :type web_hook_properties: dict[str, str] + """ + + _attribute_map = { + 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, + 'web_hook_properties': {'key': 'webHookProperties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Action, self).__init__(**kwargs) + self.action_group_id = kwargs.get('action_group_id', None) + self.web_hook_properties = kwargs.get('web_hook_properties', None) + + +class Condition(msrest.serialization.Model): + """A condition of the scheduled query rule. + + All required parameters must be populated in order to send to Azure. + + :param query: Log query alert. + :type query: str + :param time_aggregation: Required. Aggregation type. Possible values include: "Count", + "Average", "Minimum", "Maximum", "Total". + :type time_aggregation: str or ~$(python-base- + namespace).v2020_05_01_preview.models.TimeAggregation + :param metric_measure_column: The column containing the metric measure number. + :type metric_measure_column: str + :param resource_id_column: The column containing the resource id. The content of the column + must be a uri formatted as resource id. + :type resource_id_column: str + :param dimensions: List of Dimensions conditions. + :type dimensions: list[~$(python-base-namespace).v2020_05_01_preview.models.Dimension] + :param operator: Required. The criteria operator. Possible values include: "Equals", + "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual". + :type operator: str or ~$(python-base-namespace).v2020_05_01_preview.models.ConditionOperator + :param threshold: Required. the criteria threshold value that activates the alert. + :type threshold: float + :param failing_periods: The minimum number of violations required within the selected lookback + time window required to raise an alert. + :type failing_periods: ~$(python-base- + namespace).v2020_05_01_preview.models.ConditionFailingPeriods + """ + + _validation = { + 'time_aggregation': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, + 'metric_measure_column': {'key': 'metricMeasureColumn', 'type': 'str'}, + 'resource_id_column': {'key': 'resourceIdColumn', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'failing_periods': {'key': 'failingPeriods', 'type': 'ConditionFailingPeriods'}, + } + + def __init__( + self, + **kwargs + ): + super(Condition, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.time_aggregation = kwargs['time_aggregation'] + self.metric_measure_column = kwargs.get('metric_measure_column', None) + self.resource_id_column = kwargs.get('resource_id_column', None) + self.dimensions = kwargs.get('dimensions', None) + self.operator = kwargs['operator'] + self.threshold = kwargs['threshold'] + self.failing_periods = kwargs.get('failing_periods', None) + + +class ConditionFailingPeriods(msrest.serialization.Model): + """The minimum number of violations required within the selected lookback time window required to raise an alert. + + :param number_of_evaluation_periods: The number of aggregated lookback points. The lookback + time window is calculated based on the aggregation granularity (windowSize) and the selected + number of aggregated points. Default value is 1. + :type number_of_evaluation_periods: long + :param min_failing_periods_to_alert: The number of violations to trigger an alert. Should be + smaller or equal to numberOfEvaluationPeriods. Default value is 1. + :type min_failing_periods_to_alert: long + """ + + _attribute_map = { + 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'long'}, + 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ConditionFailingPeriods, self).__init__(**kwargs) + self.number_of_evaluation_periods = kwargs.get('number_of_evaluation_periods', 1) + self.min_failing_periods_to_alert = kwargs.get('min_failing_periods_to_alert', 1) + + +class Dimension(msrest.serialization.Model): + """Dimension splitting and filtering definition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param operator: Required. Operator for dimension values. Possible values include: "Include", + "Exclude". + :type operator: str or ~$(python-base-namespace).v2020_05_01_preview.models.DimensionOperator + :param values: Required. List of dimension values. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs['name'] + self.operator = kwargs['operator'] + self.values = kwargs['values'] + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorContract(msrest.serialization.Model): + """Describes the format of Error response. + + :param error: The error details. + :type error: ~$(python-base-namespace).v2020_05_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorContract, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~$(python-base-namespace).v2020_05_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~$(python-base- + namespace).v2020_05_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ScheduledQueryRuleCriteria(msrest.serialization.Model): + """The rule criteria that defines the conditions of the scheduled query rule. + + :param all_of: A list of conditions to evaluate against the specified scopes. + :type all_of: list[~$(python-base-namespace).v2020_05_01_preview.models.Condition] + """ + + _attribute_map = { + 'all_of': {'key': 'allOf', 'type': '[Condition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledQueryRuleCriteria, self).__init__(**kwargs) + self.all_of = kwargs.get('all_of', None) + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class ScheduledQueryRuleResource(TrackedResource): + """The scheduled query rule resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param description: The description of the scheduled query rule. + :type description: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Possible values include: 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2020_05_01_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. + :type enabled: bool + :param scopes: The list of resource id's that this scheduled query rule is scoped to. + :type scopes: list[str] + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). + :type window_size: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. + :type target_resource_types: list[str] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. + :type mute_actions_duration: ~datetime.timedelta + :param actions: + :type actions: list[~$(python-base-namespace).v2020_05_01_preview.models.Action] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, + 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, + 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, + 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledQueryRuleResource, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.severity = kwargs.get('severity', None) + self.enabled = kwargs.get('enabled', None) + self.scopes = kwargs.get('scopes', None) + self.evaluation_frequency = kwargs.get('evaluation_frequency', None) + self.window_size = kwargs.get('window_size', None) + self.target_resource_types = kwargs.get('target_resource_types', None) + self.criteria = kwargs.get('criteria', None) + self.mute_actions_duration = kwargs.get('mute_actions_duration', None) + self.actions = kwargs.get('actions', None) + + +class ScheduledQueryRuleResourceCollection(msrest.serialization.Model): + """Represents a collection of scheduled query rule resources. + + :param value: The values for the scheduled query rule resources. + :type value: list[~$(python-base- + namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScheduledQueryRuleResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledQueryRuleResourceCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): + """The scheduled query rule resource for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of the scheduled query rule. + :type description: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Possible values include: 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2020_05_01_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. + :type enabled: bool + :param scopes: The list of resource id's that this scheduled query rule is scoped to. + :type scopes: list[str] + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). + :type window_size: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. + :type target_resource_types: list[str] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. + :type mute_actions_duration: ~datetime.timedelta + :param actions: + :type actions: list[~$(python-base-namespace).v2020_05_01_preview.models.Action] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, + 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, + 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, + 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledQueryRuleResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.severity = kwargs.get('severity', None) + self.enabled = kwargs.get('enabled', None) + self.scopes = kwargs.get('scopes', None) + self.evaluation_frequency = kwargs.get('evaluation_frequency', None) + self.window_size = kwargs.get('window_size', None) + self.target_resource_types = kwargs.get('target_resource_types', None) + self.criteria = kwargs.get('criteria', None) + self.mute_actions_duration = kwargs.get('mute_actions_duration', None) + self.actions = kwargs.get('actions', None) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..8a32c3553f84 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py @@ -0,0 +1,588 @@ +# 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. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._monitor_client_enums import * + + +class Action(msrest.serialization.Model): + """Actions to invoke when the alert fires. + + :param action_group_id: Action Group resource Id to invoke when the alert fires. + :type action_group_id: str + :param web_hook_properties: The properties of a webhook object. + :type web_hook_properties: dict[str, str] + """ + + _attribute_map = { + 'action_group_id': {'key': 'actionGroupId', 'type': 'str'}, + 'web_hook_properties': {'key': 'webHookProperties', 'type': '{str}'}, + } + + def __init__( + self, + *, + action_group_id: Optional[str] = None, + web_hook_properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Action, self).__init__(**kwargs) + self.action_group_id = action_group_id + self.web_hook_properties = web_hook_properties + + +class Condition(msrest.serialization.Model): + """A condition of the scheduled query rule. + + All required parameters must be populated in order to send to Azure. + + :param query: Log query alert. + :type query: str + :param time_aggregation: Required. Aggregation type. Possible values include: "Count", + "Average", "Minimum", "Maximum", "Total". + :type time_aggregation: str or ~$(python-base- + namespace).v2020_05_01_preview.models.TimeAggregation + :param metric_measure_column: The column containing the metric measure number. + :type metric_measure_column: str + :param resource_id_column: The column containing the resource id. The content of the column + must be a uri formatted as resource id. + :type resource_id_column: str + :param dimensions: List of Dimensions conditions. + :type dimensions: list[~$(python-base-namespace).v2020_05_01_preview.models.Dimension] + :param operator: Required. The criteria operator. Possible values include: "Equals", + "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual". + :type operator: str or ~$(python-base-namespace).v2020_05_01_preview.models.ConditionOperator + :param threshold: Required. the criteria threshold value that activates the alert. + :type threshold: float + :param failing_periods: The minimum number of violations required within the selected lookback + time window required to raise an alert. + :type failing_periods: ~$(python-base- + namespace).v2020_05_01_preview.models.ConditionFailingPeriods + """ + + _validation = { + 'time_aggregation': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + } + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, + 'metric_measure_column': {'key': 'metricMeasureColumn', 'type': 'str'}, + 'resource_id_column': {'key': 'resourceIdColumn', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'float'}, + 'failing_periods': {'key': 'failingPeriods', 'type': 'ConditionFailingPeriods'}, + } + + def __init__( + self, + *, + time_aggregation: Union[str, "TimeAggregation"], + operator: Union[str, "ConditionOperator"], + threshold: float, + query: Optional[str] = None, + metric_measure_column: Optional[str] = None, + resource_id_column: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + failing_periods: Optional["ConditionFailingPeriods"] = None, + **kwargs + ): + super(Condition, self).__init__(**kwargs) + self.query = query + self.time_aggregation = time_aggregation + self.metric_measure_column = metric_measure_column + self.resource_id_column = resource_id_column + self.dimensions = dimensions + self.operator = operator + self.threshold = threshold + self.failing_periods = failing_periods + + +class ConditionFailingPeriods(msrest.serialization.Model): + """The minimum number of violations required within the selected lookback time window required to raise an alert. + + :param number_of_evaluation_periods: The number of aggregated lookback points. The lookback + time window is calculated based on the aggregation granularity (windowSize) and the selected + number of aggregated points. Default value is 1. + :type number_of_evaluation_periods: long + :param min_failing_periods_to_alert: The number of violations to trigger an alert. Should be + smaller or equal to numberOfEvaluationPeriods. Default value is 1. + :type min_failing_periods_to_alert: long + """ + + _attribute_map = { + 'number_of_evaluation_periods': {'key': 'numberOfEvaluationPeriods', 'type': 'long'}, + 'min_failing_periods_to_alert': {'key': 'minFailingPeriodsToAlert', 'type': 'long'}, + } + + def __init__( + self, + *, + number_of_evaluation_periods: Optional[int] = 1, + min_failing_periods_to_alert: Optional[int] = 1, + **kwargs + ): + super(ConditionFailingPeriods, self).__init__(**kwargs) + self.number_of_evaluation_periods = number_of_evaluation_periods + self.min_failing_periods_to_alert = min_failing_periods_to_alert + + +class Dimension(msrest.serialization.Model): + """Dimension splitting and filtering definition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param operator: Required. Operator for dimension values. Possible values include: "Include", + "Exclude". + :type operator: str or ~$(python-base-namespace).v2020_05_01_preview.models.DimensionOperator + :param values: Required. List of dimension values. + :type values: list[str] + """ + + _validation = { + 'name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: str, + operator: Union[str, "DimensionOperator"], + values: List[str], + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.operator = operator + self.values = values + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorContract(msrest.serialization.Model): + """Describes the format of Error response. + + :param error: The error details. + :type error: ~$(python-base-namespace).v2020_05_01_preview.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponse"] = None, + **kwargs + ): + super(ErrorContract, self).__init__(**kwargs) + self.error = error + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~$(python-base-namespace).v2020_05_01_preview.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~$(python-base- + namespace).v2020_05_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ScheduledQueryRuleCriteria(msrest.serialization.Model): + """The rule criteria that defines the conditions of the scheduled query rule. + + :param all_of: A list of conditions to evaluate against the specified scopes. + :type all_of: list[~$(python-base-namespace).v2020_05_01_preview.models.Condition] + """ + + _attribute_map = { + 'all_of': {'key': 'allOf', 'type': '[Condition]'}, + } + + def __init__( + self, + *, + all_of: Optional[List["Condition"]] = None, + **kwargs + ): + super(ScheduledQueryRuleCriteria, self).__init__(**kwargs) + self.all_of = all_of + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class ScheduledQueryRuleResource(TrackedResource): + """The scheduled query rule resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param description: The description of the scheduled query rule. + :type description: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Possible values include: 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2020_05_01_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. + :type enabled: bool + :param scopes: The list of resource id's that this scheduled query rule is scoped to. + :type scopes: list[str] + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). + :type window_size: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. + :type target_resource_types: list[str] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. + :type mute_actions_duration: ~datetime.timedelta + :param actions: + :type actions: list[~$(python-base-namespace).v2020_05_01_preview.models.Action] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, + 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, + 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, + 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + severity: Optional[Union[float, "AlertSeverity"]] = None, + enabled: Optional[bool] = None, + scopes: Optional[List[str]] = None, + evaluation_frequency: Optional[datetime.timedelta] = None, + window_size: Optional[datetime.timedelta] = None, + target_resource_types: Optional[List[str]] = None, + criteria: Optional["ScheduledQueryRuleCriteria"] = None, + mute_actions_duration: Optional[datetime.timedelta] = None, + actions: Optional[List["Action"]] = None, + **kwargs + ): + super(ScheduledQueryRuleResource, self).__init__(tags=tags, location=location, **kwargs) + self.description = description + self.severity = severity + self.enabled = enabled + self.scopes = scopes + self.evaluation_frequency = evaluation_frequency + self.window_size = window_size + self.target_resource_types = target_resource_types + self.criteria = criteria + self.mute_actions_duration = mute_actions_duration + self.actions = actions + + +class ScheduledQueryRuleResourceCollection(msrest.serialization.Model): + """Represents a collection of scheduled query rule resources. + + :param value: The values for the scheduled query rule resources. + :type value: list[~$(python-base- + namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ScheduledQueryRuleResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["ScheduledQueryRuleResource"]] = None, + **kwargs + ): + super(ScheduledQueryRuleResourceCollection, self).__init__(**kwargs) + self.value = value + + +class ScheduledQueryRuleResourcePatch(msrest.serialization.Model): + """The scheduled query rule resource for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of the scheduled query rule. + :type description: str + :param severity: Severity of the alert. Should be an integer between [0-4]. Value of 0 is + severest. Possible values include: 0, 1, 2, 3, 4. + :type severity: str or ~$(python-base-namespace).v2020_05_01_preview.models.AlertSeverity + :param enabled: The flag which indicates whether this scheduled query rule is enabled. Value + should be true or false. + :type enabled: bool + :param scopes: The list of resource id's that this scheduled query rule is scoped to. + :type scopes: list[str] + :param evaluation_frequency: How often the scheduled query rule is evaluated represented in ISO + 8601 duration format. + :type evaluation_frequency: ~datetime.timedelta + :param window_size: The period of time (in ISO 8601 duration format) on which the Alert query + will be executed (bin size). + :type window_size: ~datetime.timedelta + :param target_resource_types: List of resource type of the target resource(s) on which the + alert is created/updated. For example if the scope is a resource group and targetResourceTypes + is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual + machine in the resource group which meet the alert criteria. + :type target_resource_types: list[str] + :param criteria: The rule criteria that defines the conditions of the scheduled query rule. + :type criteria: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleCriteria + :param mute_actions_duration: Mute actions for the chosen period of time (in ISO 8601 duration + format) after the alert is fired. + :type mute_actions_duration: ~datetime.timedelta + :param actions: + :type actions: list[~$(python-base-namespace).v2020_05_01_preview.models.Action] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'float'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'}, + 'window_size': {'key': 'properties.windowSize', 'type': 'duration'}, + 'target_resource_types': {'key': 'properties.targetResourceTypes', 'type': '[str]'}, + 'criteria': {'key': 'properties.criteria', 'type': 'ScheduledQueryRuleCriteria'}, + 'mute_actions_duration': {'key': 'properties.muteActionsDuration', 'type': 'duration'}, + 'actions': {'key': 'properties.actions', 'type': '[Action]'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + severity: Optional[Union[float, "AlertSeverity"]] = None, + enabled: Optional[bool] = None, + scopes: Optional[List[str]] = None, + evaluation_frequency: Optional[datetime.timedelta] = None, + window_size: Optional[datetime.timedelta] = None, + target_resource_types: Optional[List[str]] = None, + criteria: Optional["ScheduledQueryRuleCriteria"] = None, + mute_actions_duration: Optional[datetime.timedelta] = None, + actions: Optional[List["Action"]] = None, + **kwargs + ): + super(ScheduledQueryRuleResourcePatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.severity = severity + self.enabled = enabled + self.scopes = scopes + self.evaluation_frequency = evaluation_frequency + self.window_size = window_size + self.target_resource_types = target_resource_types + self.criteria = criteria + self.mute_actions_duration = mute_actions_duration + self.actions = actions diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_client_enums.py new file mode 100644 index 000000000000..824ade35f9c6 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_client_enums.py @@ -0,0 +1,64 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, float, Enum)): + """Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest + """ + + ZERO = 0 + ONE = 1 + TWO = 2 + THREE = 3 + FOUR = 4 + +class ConditionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The criteria operator. + """ + + EQUALS = "Equals" + GREATER_THAN = "GreaterThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN = "LessThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" + +class DimensionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operator for dimension values + """ + + INCLUDE = "Include" + EXCLUDE = "Exclude" + +class TimeAggregation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Aggregation type + """ + + COUNT = "Count" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/__init__.py new file mode 100644 index 000000000000..f677702ed3df --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._scheduled_query_rules_operations import ScheduledQueryRulesOperations + +__all__ = [ + 'ScheduledQueryRulesOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py new file mode 100644 index 000000000000..6879360b4e77 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py @@ -0,0 +1,443 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ScheduledQueryRulesOperations(object): + """ScheduledQueryRulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2020_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ScheduledQueryRuleResourceCollection"] + """Retrieve a scheduled query rule definitions in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ScheduledQueryRuleResourceCollection"] + """Retrieve scheduled query rule definitions in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ScheduledQueryRuleResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ScheduledQueryRuleResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorContract, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ScheduledQueryRuleResource" + """Retrieve an scheduled query rule definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + rule_name, # type: str + parameters, # type: "_models.ScheduledQueryRuleResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.ScheduledQueryRuleResource" + """Creates or updates a scheduled query rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to create or update. + :type parameters: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + rule_name, # type: str + parameters, # type: "_models.ScheduledQueryRuleResourcePatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.ScheduledQueryRuleResource" + """Update a scheduled query rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param parameters: The parameters of the rule to update. + :type parameters: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ScheduledQueryRuleResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_05_01_preview.models.ScheduledQueryRuleResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ScheduledQueryRuleResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ScheduledQueryRuleResourcePatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ScheduledQueryRuleResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a scheduled query rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorContract, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/py.typed b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file