From ea2621190241dae2e545eecdacde6c3057ce6e0b Mon Sep 17 00:00:00 2001 From: 00Kai0 Date: Wed, 16 Sep 2020 15:28:39 +0800 Subject: [PATCH] generate eventhub track2 ga version --- sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md | 8 + .../azure/mgmt/eventhub/__init__.py | 2 +- .../azure/mgmt/eventhub/_configuration.py | 5 +- .../eventhub/_event_hub_management_client.py | 46 +- .../azure/mgmt/eventhub/_version.py | 2 +- .../azure/mgmt/eventhub/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 6 +- ...ync.py => _event_hub_management_client.py} | 120 ++-- .../mgmt/eventhub/v2015_08_01/__init__.py | 2 +- .../eventhub/v2015_08_01/_configuration.py | 5 +- .../_event_hub_management_client.py | 1 + .../mgmt/eventhub/v2015_08_01/_metadata.json | 11 +- .../mgmt/eventhub/v2015_08_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...ync.py => _event_hub_management_client.py} | 19 +- .../__init__.py | 8 +- .../_consumer_groups_operations.py} | 43 +- .../_event_hubs_operations.py} | 105 ++-- .../_namespaces_operations.py} | 157 +++--- .../_operations.py} | 19 +- .../_event_hub_management_client_enums.py | 114 ++-- .../operations/_consumer_groups_operations.py | 43 +- .../operations/_event_hubs_operations.py | 105 ++-- .../operations/_namespaces_operations.py | 149 ++--- .../v2015_08_01/operations/_operations.py | 19 +- .../mgmt/eventhub/v2017_04_01/__init__.py | 2 +- .../eventhub/v2017_04_01/_configuration.py | 5 +- .../_event_hub_management_client.py | 1 + .../mgmt/eventhub/v2017_04_01/_metadata.json | 11 +- .../mgmt/eventhub/v2017_04_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...ync.py => _event_hub_management_client.py} | 27 +- .../__init__.py | 12 +- .../_consumer_groups_operations.py} | 57 +- .../_disaster_recovery_configs_operations.py} | 103 ++-- .../_event_hubs_operations.py} | 123 +++-- .../_namespaces_operations.py} | 203 ++++--- .../_operations.py} | 19 +- .../_regions_operations.py} | 19 +- .../eventhub/v2017_04_01/models/__init__.py | 2 + .../_event_hub_management_client_enums.py | 116 ++-- .../eventhub/v2017_04_01/models/_models.py | 13 +- .../v2017_04_01/models/_models_py3.py | 14 +- .../operations/_consumer_groups_operations.py | 57 +- .../_disaster_recovery_configs_operations.py | 103 ++-- .../operations/_event_hubs_operations.py | 123 +++-- .../operations/_namespaces_operations.py | 195 ++++--- .../v2017_04_01/operations/_operations.py | 19 +- .../operations/_regions_operations.py | 19 +- .../eventhub/v2018_01_01_preview/__init__.py | 2 +- .../v2018_01_01_preview/_configuration.py | 5 +- .../_event_hub_management_client.py | 11 + .../v2018_01_01_preview/_metadata.json | 13 +- .../v2018_01_01_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...ync.py => _event_hub_management_client.py} | 45 +- .../aio/operations/__init__.py | 31 ++ .../_clusters_operations.py} | 94 ++-- .../_configuration_operations.py} | 23 +- .../_consumer_groups_operations.py} | 57 +- .../_disaster_recovery_configs_operations.py} | 103 ++-- .../_event_hubs_operations.py} | 123 +++-- .../_namespaces_operations.py} | 260 +++++---- .../_operations.py} | 19 +- ...private_endpoint_connections_operations.py | 368 ++++++++++++ .../_private_link_resources_operations.py | 100 ++++ .../_regions_operations.py} | 19 +- .../aio/operations_async/__init__.py | 27 - .../v2018_01_01_preview/models/__init__.py | 26 + .../_event_hub_management_client_enums.py | 148 +++-- .../v2018_01_01_preview/models/_models.py | 205 ++++++- .../v2018_01_01_preview/models/_models_py3.py | 230 +++++++- .../operations/__init__.py | 4 + .../operations/_clusters_operations.py | 82 +-- .../operations/_configuration_operations.py | 23 +- .../operations/_consumer_groups_operations.py | 57 +- .../_disaster_recovery_configs_operations.py | 103 ++-- .../operations/_event_hubs_operations.py | 123 +++-- .../operations/_namespaces_operations.py | 252 +++++---- .../operations/_operations.py | 19 +- ...private_endpoint_connections_operations.py | 377 +++++++++++++ .../_private_link_resources_operations.py | 105 ++++ .../operations/_regions_operations.py | 19 +- ...enthub.test_disaster_recovery_configs.yaml | 402 ++++++++------ .../test_cli_mgmt_eventhub.test_eventhub.yaml | 287 +++++----- ...cli_mgmt_eventhub_async.test_eventhub.yaml | 522 +++++++++--------- .../tests/test_cli_mgmt_eventhub.py | 30 +- 87 files changed, 4364 insertions(+), 2205 deletions(-) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/{_event_hub_management_client_async.py => _event_hub_management_client.py} (62%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{_event_hub_management_client_async.py => _event_hub_management_client.py} (88%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{operations_async => operations}/__init__.py (71%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{operations_async/_consumer_groups_operations_async.py => operations/_consumer_groups_operations.py} (92%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{operations_async/_event_hubs_operations_async.py => operations/_event_hubs_operations.py} (92%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{operations_async/_namespaces_operations_async.py => operations/_namespaces_operations.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/{operations_async/_operations_async.py => operations/_operations.py} (88%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{_event_hub_management_client_async.py => _event_hub_management_client.py} (86%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async => operations}/__init__.py (62%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async/_consumer_groups_operations_async.py => operations/_consumer_groups_operations.py} (90%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async/_disaster_recovery_configs_operations_async.py => operations/_disaster_recovery_configs_operations.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async/_event_hubs_operations_async.py => operations/_event_hubs_operations.py} (90%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async/_namespaces_operations_async.py => operations/_namespaces_operations.py} (90%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async/_operations_async.py => operations/_operations.py} (88%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/{operations_async/_regions_operations_async.py => operations/_regions_operations.py} (89%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{_event_hub_management_client_async.py => _event_hub_management_client.py} (72%) create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/__init__.py rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_clusters_operations_async.py => operations/_clusters_operations.py} (90%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_configuration_operations_async.py => operations/_configuration_operations.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_consumer_groups_operations_async.py => operations/_consumer_groups_operations.py} (90%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_disaster_recovery_configs_operations_async.py => operations/_disaster_recovery_configs_operations.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_event_hubs_operations_async.py => operations/_event_hubs_operations.py} (90%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_namespaces_operations_async.py => operations/_namespaces_operations.py} (91%) rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_operations_async.py => operations/_operations.py} (88%) create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_link_resources_operations.py rename sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/{operations_async/_regions_operations_async.py => operations/_regions_operations.py} (89%) delete mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/__init__.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_link_resources_operations.py diff --git a/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md b/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md index 7fd58b7c11a4..25ee87a70d16 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md +++ b/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +## 8.0.0 (2020-09-16) + +**Features** + + - Model NetworkRuleSet has a new parameter trusted_service_access_enabled + - Added operation group PrivateEndpointConnectionsOperations + - Added operation group PrivateLinkResourcesOperations + ## 8.0.0b1 (2020-06-17) This is beta preview version. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/__init__.py index 1758273a3230..72f93dd9db6c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/__init__.py @@ -10,7 +10,7 @@ __all__ = ['EventHubManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_configuration.py index d139dc97dbb8..9547465caa42 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_configuration.py @@ -12,6 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy from ._version import VERSION @@ -43,8 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py index d193fbb8056c..4e4b53b204b2 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py @@ -69,8 +69,6 @@ def __init__( self._config = EventHubManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(EventHubManagementClient, self).__init__( - credential, - self._config, api_version=api_version, profile=profile ) @@ -96,7 +94,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview import models return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} is not available".format(api_version)) @property def clusters(self): @@ -108,7 +106,7 @@ def clusters(self): if api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import ClustersOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -121,7 +119,7 @@ def configuration(self): if api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import ConfigurationOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -140,7 +138,7 @@ def consumer_groups(self): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import ConsumerGroupsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'consumer_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -156,7 +154,7 @@ def disaster_recovery_configs(self): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -175,7 +173,7 @@ def event_hubs(self): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import EventHubsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'event_hubs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -194,7 +192,7 @@ def namespaces(self): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import NamespacesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -213,7 +211,33 @@ def operations(self): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import Operations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2018-01-01-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2018-01-01-preview': + from .v2018_01_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2018-01-01-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2018-01-01-preview': + from .v2018_01_01_preview.operations import PrivateLinkResourcesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -229,7 +253,7 @@ def regions(self): elif api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import RegionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'regions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) def close(self): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py index ef893bf59305..24f92428b653 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "8.0.0b1" \ No newline at end of file +VERSION = "8.0.0" \ No newline at end of file diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/__init__.py index e990def3459f..7cb0ca65be40 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._event_hub_management_client_async import EventHubManagementClient +from ._event_hub_management_client import EventHubManagementClient __all__ = ['EventHubManagementClient'] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration.py index dbb842893257..a12fd4c1c3d7 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_configuration.py @@ -12,6 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy from .._version import VERSION @@ -34,7 +35,6 @@ def __init__( subscription_id, # type: str **kwargs # type: Any ) -> None: - # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -43,8 +43,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -56,6 +55,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py similarity index 62% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py index 0ae96160b6c1..011cbda743e9 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py @@ -14,7 +14,7 @@ from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from ._configuration_async import EventHubManagementClientConfiguration +from ._configuration import EventHubManagementClientConfiguration class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -69,8 +69,6 @@ def __init__( self._config = EventHubManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(EventHubManagementClient, self).__init__( - credential, - self._config, api_version=api_version, profile=profile ) @@ -96,140 +94,166 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-01-01-preview': from ..v2018_01_01_preview import models return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} is not available".format(api_version)) @property def clusters(self): """Instance depends on the API version: - * 2018-01-01-preview: :class:`ClustersOperations` + * 2018-01-01-preview: :class:`ClustersOperations` """ api_version = self._get_api_version('clusters') if api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import ClustersOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import ClustersOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def configuration(self): """Instance depends on the API version: - * 2018-01-01-preview: :class:`ConfigurationOperations` + * 2018-01-01-preview: :class:`ConfigurationOperations` """ api_version = self._get_api_version('configuration') if api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import ConfigurationOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import ConfigurationOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def consumer_groups(self): """Instance depends on the API version: - * 2015-08-01: :class:`ConsumerGroupsOperations` - * 2017-04-01: :class:`ConsumerGroupsOperations` - * 2018-01-01-preview: :class:`ConsumerGroupsOperations` + * 2015-08-01: :class:`ConsumerGroupsOperations` + * 2017-04-01: :class:`ConsumerGroupsOperations` + * 2018-01-01-preview: :class:`ConsumerGroupsOperations` """ api_version = self._get_api_version('consumer_groups') if api_version == '2015-08-01': - from ..v2015_08_01.aio.operations_async import ConsumerGroupsOperations as OperationClass + from ..v2015_08_01.aio.operations import ConsumerGroupsOperations as OperationClass elif api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import ConsumerGroupsOperations as OperationClass + from ..v2017_04_01.aio.operations import ConsumerGroupsOperations as OperationClass elif api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import ConsumerGroupsOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import ConsumerGroupsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'consumer_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def disaster_recovery_configs(self): """Instance depends on the API version: - * 2017-04-01: :class:`DisasterRecoveryConfigsOperations` - * 2018-01-01-preview: :class:`DisasterRecoveryConfigsOperations` + * 2017-04-01: :class:`DisasterRecoveryConfigsOperations` + * 2018-01-01-preview: :class:`DisasterRecoveryConfigsOperations` """ api_version = self._get_api_version('disaster_recovery_configs') if api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import DisasterRecoveryConfigsOperations as OperationClass + from ..v2017_04_01.aio.operations import DisasterRecoveryConfigsOperations as OperationClass elif api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import DisasterRecoveryConfigsOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import DisasterRecoveryConfigsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def event_hubs(self): """Instance depends on the API version: - * 2015-08-01: :class:`EventHubsOperations` - * 2017-04-01: :class:`EventHubsOperations` - * 2018-01-01-preview: :class:`EventHubsOperations` + * 2015-08-01: :class:`EventHubsOperations` + * 2017-04-01: :class:`EventHubsOperations` + * 2018-01-01-preview: :class:`EventHubsOperations` """ api_version = self._get_api_version('event_hubs') if api_version == '2015-08-01': - from ..v2015_08_01.aio.operations_async import EventHubsOperations as OperationClass + from ..v2015_08_01.aio.operations import EventHubsOperations as OperationClass elif api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import EventHubsOperations as OperationClass + from ..v2017_04_01.aio.operations import EventHubsOperations as OperationClass elif api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import EventHubsOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import EventHubsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'event_hubs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def namespaces(self): """Instance depends on the API version: - * 2015-08-01: :class:`NamespacesOperations` - * 2017-04-01: :class:`NamespacesOperations` - * 2018-01-01-preview: :class:`NamespacesOperations` + * 2015-08-01: :class:`NamespacesOperations` + * 2017-04-01: :class:`NamespacesOperations` + * 2018-01-01-preview: :class:`NamespacesOperations` """ api_version = self._get_api_version('namespaces') if api_version == '2015-08-01': - from ..v2015_08_01.aio.operations_async import NamespacesOperations as OperationClass + from ..v2015_08_01.aio.operations import NamespacesOperations as OperationClass elif api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import NamespacesOperations as OperationClass + from ..v2017_04_01.aio.operations import NamespacesOperations as OperationClass elif api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import NamespacesOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import NamespacesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def operations(self): """Instance depends on the API version: - * 2015-08-01: :class:`Operations` - * 2017-04-01: :class:`Operations` - * 2018-01-01-preview: :class:`Operations` + * 2015-08-01: :class:`Operations` + * 2017-04-01: :class:`Operations` + * 2018-01-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-08-01': - from ..v2015_08_01.aio.operations_async import Operations as OperationClass + from ..v2015_08_01.aio.operations import Operations as OperationClass elif api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import Operations as OperationClass + from ..v2017_04_01.aio.operations import Operations as OperationClass elif api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import Operations as OperationClass + from ..v2018_01_01_preview.aio.operations import Operations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2018-01-01-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2018-01-01-preview': + from ..v2018_01_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2018-01-01-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2018-01-01-preview': + from ..v2018_01_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def regions(self): """Instance depends on the API version: - * 2017-04-01: :class:`RegionsOperations` - * 2018-01-01-preview: :class:`RegionsOperations` + * 2017-04-01: :class:`RegionsOperations` + * 2018-01-01-preview: :class:`RegionsOperations` """ api_version = self._get_api_version('regions') if api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import RegionsOperations as OperationClass + from ..v2017_04_01.aio.operations import RegionsOperations as OperationClass elif api_version == '2018-01-01-preview': - from ..v2018_01_01_preview.aio.operations_async import RegionsOperations as OperationClass + from ..v2018_01_01_preview.aio.operations import RegionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'regions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) async def close(self): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py index 1758273a3230..72f93dd9db6c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['EventHubManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py index d3e6cdd293bd..f698e6e92d49 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py @@ -10,6 +10,7 @@ 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 @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2015-08-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_event_hub_management_client.py index 96d00c6123ce..f35c3cb08d1f 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_event_hub_management_client.py @@ -59,6 +59,7 @@ 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.operations = Operations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_metadata.json b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_metadata.json index 6505d9f0adf3..8af35ccbed59 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_metadata.json +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "EventHubManagementClient", "filename": "_event_hub_management_client", - "description": "Azure Event Hubs client." + "description": "Azure Event Hubs client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "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": { "operations": "Operations", diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/__init__.py index e990def3459f..7cb0ca65be40 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._event_hub_management_client_async import EventHubManagementClient +from ._event_hub_management_client import EventHubManagementClient __all__ = ['EventHubManagementClient'] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py index e8120136d2dd..004a7b9d0e26 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py @@ -10,6 +10,7 @@ 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 @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2015-08-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py similarity index 88% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py index d87643b7895b..23aa2ba3b02e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py @@ -15,11 +15,11 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import EventHubManagementClientConfiguration -from .operations_async import Operations -from .operations_async import NamespacesOperations -from .operations_async import EventHubsOperations -from .operations_async import ConsumerGroupsOperations +from ._configuration import EventHubManagementClientConfiguration +from .operations import Operations +from .operations import NamespacesOperations +from .operations import EventHubsOperations +from .operations import ConsumerGroupsOperations from .. import models @@ -27,13 +27,13 @@ class EventHubManagementClient(object): """Azure Event Hubs client. :ivar operations: Operations operations - :vartype operations: azure.mgmt.eventhub.v2015_08_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.eventhub.v2015_08_01.aio.operations.Operations :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.eventhub.v2015_08_01.aio.operations_async.NamespacesOperations + :vartype namespaces: azure.mgmt.eventhub.v2015_08_01.aio.operations.NamespacesOperations :ivar event_hubs: EventHubsOperations operations - :vartype event_hubs: azure.mgmt.eventhub.v2015_08_01.aio.operations_async.EventHubsOperations + :vartype event_hubs: azure.mgmt.eventhub.v2015_08_01.aio.operations.EventHubsOperations :ivar consumer_groups: ConsumerGroupsOperations operations - :vartype consumer_groups: azure.mgmt.eventhub.v2015_08_01.aio.operations_async.ConsumerGroupsOperations + :vartype consumer_groups: azure.mgmt.eventhub.v2015_08_01.aio.operations.ConsumerGroupsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -56,6 +56,7 @@ 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.operations = Operations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/__init__.py similarity index 71% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/__init__.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/__init__.py index 7c3e938270ec..39c68cd3b389 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/__init__.py @@ -6,10 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._operations_async import Operations -from ._namespaces_operations_async import NamespacesOperations -from ._event_hubs_operations_async import EventHubsOperations -from ._consumer_groups_operations_async import ConsumerGroupsOperations +from ._operations import Operations +from ._namespaces_operations import NamespacesOperations +from ._event_hubs_operations import EventHubsOperations +from ._consumer_groups_operations import ConsumerGroupsOperations __all__ = [ 'Operations', diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_consumer_groups_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py similarity index 92% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_consumer_groups_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py index 974edd896582..6aa560deaf87 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_consumer_groups_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -68,10 +68,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -91,14 +94,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConsumerGroupCreateOrUpdateParameters') 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 @@ -138,7 +139,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -160,7 +163,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -198,9 +200,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -219,9 +224,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -246,7 +250,7 @@ def list_all( **kwargs ) -> AsyncIterable["models.ConsumerGroupListResult"]: """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - exists in the Namespace. + exists in the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -260,11 +264,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_all.metadata['url'] # type: ignore @@ -279,15 +290,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_event_hubs_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py similarity index 92% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_event_hubs_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py index 9ecd6659541a..98ecfba9f9b4 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_event_hubs_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -59,11 +59,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_all.metadata['url'] # type: ignore @@ -77,15 +84,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -136,10 +139,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -158,14 +164,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EventHubCreateOrUpdateParameters') 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 @@ -202,7 +206,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -223,7 +229,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -258,9 +263,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -278,9 +286,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -318,11 +325,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -337,15 +351,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -399,10 +409,13 @@ async def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -422,14 +435,12 @@ async def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SharedAccessAuthorizationRuleCreateOrUpdateParameters') 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 @@ -469,9 +480,12 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -490,9 +504,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -533,9 +546,12 @@ async def post_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.post_authorization_rule.metadata['url'] # type: ignore @@ -554,9 +570,8 @@ async def post_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -597,7 +612,9 @@ async def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -619,7 +636,6 @@ async def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -657,9 +673,12 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -678,9 +697,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -725,10 +743,13 @@ async def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -748,14 +769,12 @@ async def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateKeysParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_namespaces_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_namespaces_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py index 5d14adde2313..bb87871d572b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_namespaces_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -58,10 +58,13 @@ async def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -77,14 +80,12 @@ async def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -112,11 +113,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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 @@ -128,15 +136,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -178,11 +182,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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 @@ -195,15 +206,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -236,12 +243,15 @@ async def _create_or_update_initial( namespace_name: str, parameters: "models.NamespaceCreateOrUpdateParameters", **kwargs - ) -> "models.NamespaceResource": - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.NamespaceResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.NamespaceResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -259,14 +269,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NamespaceCreateOrUpdateParameters') 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 @@ -293,9 +301,9 @@ async def begin_create_or_update( namespace_name: str, parameters: "models.NamespaceCreateOrUpdateParameters", **kwargs - ) -> "models.NamespaceResource": + ) -> AsyncLROPoller["models.NamespaceResource"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. + This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -309,8 +317,8 @@ async def begin_create_or_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: NamespaceResource, or the result of cls(response) - :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.NamespaceResource + :return: An instance of AsyncLROPoller that returns either NamespaceResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2015_08_01.models.NamespaceResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -360,7 +368,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -380,7 +390,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -399,9 +408,9 @@ async def begin_delete( resource_group_name: str, namespace_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. + namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -413,8 +422,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -471,9 +480,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -490,9 +502,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -501,7 +512,6 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NamespaceResource', pipeline_response) @@ -520,7 +530,7 @@ async def update( namespace_name: str, parameters: "models.NamespaceUpdateParameter", **kwargs - ) -> "models.NamespaceResource": + ) -> Optional["models.NamespaceResource"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -535,11 +545,14 @@ async def update( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.NamespaceResource or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.NamespaceResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -557,14 +570,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NamespaceUpdateParameter') 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 @@ -603,11 +614,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -621,15 +639,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -680,10 +694,13 @@ async def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -702,14 +719,12 @@ async def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SharedAccessAuthorizationRuleCreateOrUpdateParameters') 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 @@ -746,7 +761,9 @@ async def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -767,7 +784,6 @@ async def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request 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 @@ -802,9 +818,12 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -822,9 +841,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -862,9 +880,12 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -882,9 +903,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -925,10 +945,13 @@ async def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -947,14 +970,12 @@ async def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateKeysParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py similarity index 88% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py index 2cd199934499..0a3183b1deb2 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations_async/_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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.metadata['url'] # type: ignore @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/models/_event_hub_management_client_enums.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/models/_event_hub_management_client_enums.py index 78d44fb08a62..590e8e941369 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/models/_event_hub_management_client_enums.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/models/_event_hub_management_client_enums.py @@ -6,75 +6,93 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessRights(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - manage = "Manage" - send = "Send" - listen = "Listen" + 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 EntityStatus(str, Enum): + +class AccessRights(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGE = "Manage" + SEND = "Send" + LISTEN = "Listen" + +class EntityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Enumerates the possible values for the status of the Event Hub. """ - active = "Active" - disabled = "Disabled" - restoring = "Restoring" - send_disabled = "SendDisabled" - receive_disabled = "ReceiveDisabled" - creating = "Creating" - deleting = "Deleting" - renaming = "Renaming" - unknown = "Unknown" - -class NamespaceState(str, Enum): + ACTIVE = "Active" + DISABLED = "Disabled" + RESTORING = "Restoring" + SEND_DISABLED = "SendDisabled" + RECEIVE_DISABLED = "ReceiveDisabled" + CREATING = "Creating" + DELETING = "Deleting" + RENAMING = "Renaming" + UNKNOWN = "Unknown" + +class NamespaceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """State of the Namespace. """ - unknown = "Unknown" - creating = "Creating" - created = "Created" - activating = "Activating" - enabling = "Enabling" - active = "Active" - disabling = "Disabling" - disabled = "Disabled" - soft_deleting = "SoftDeleting" - soft_deleted = "SoftDeleted" - removing = "Removing" - removed = "Removed" - failed = "Failed" - -class Policykey(str, Enum): + UNKNOWN = "Unknown" + CREATING = "Creating" + CREATED = "Created" + ACTIVATING = "Activating" + ENABLING = "Enabling" + ACTIVE = "Active" + DISABLING = "Disabling" + DISABLED = "Disabled" + SOFT_DELETING = "SoftDeleting" + SOFT_DELETED = "SoftDeleted" + REMOVING = "Removing" + REMOVED = "Removed" + FAILED = "Failed" + +class Policykey(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Key that needs to be regenerated. """ - primary_key = "PrimaryKey" - secondary_key = "SecondaryKey" + PRIMARY_KEY = "PrimaryKey" + SECONDARY_KEY = "SecondaryKey" -class SkuName(str, Enum): +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Name of this SKU. """ - basic = "Basic" - standard = "Standard" + BASIC = "Basic" + STANDARD = "Standard" -class SkuTier(str, Enum): +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The billing tier of this particular SKU. """ - basic = "Basic" - standard = "Standard" - premium = "Premium" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" -class UnavailableReason(str, Enum): +class UnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the reason for the unavailability of the service. """ - none = "None" - invalid_name = "InvalidName" - subscription_is_disabled = "SubscriptionIsDisabled" - name_in_use = "NameInUse" - name_in_lockdown = "NameInLockdown" - too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" + NONE = "None" + INVALID_NAME = "InvalidName" + SUBSCRIPTION_IS_DISABLED = "SubscriptionIsDisabled" + NAME_IN_USE = "NameInUse" + NAME_IN_LOCKDOWN = "NameInLockdown" + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_consumer_groups_operations.py index d331a3a27746..fcc93107b5ac 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_consumer_groups_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_consumer_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -73,10 +73,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -96,14 +99,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConsumerGroupCreateOrUpdateParameters') 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 @@ -144,7 +145,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -166,7 +169,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -205,9 +207,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -226,9 +231,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,7 +258,7 @@ def list_all( ): # type: (...) -> Iterable["models.ConsumerGroupListResult"] """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - exists in the Namespace. + exists in the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -268,11 +272,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_all.metadata['url'] # type: ignore @@ -287,15 +298,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_event_hubs_operations.py index 5e767a79f0bb..462cd9ea6923 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_event_hubs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_event_hubs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -64,11 +64,18 @@ def list_all( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_all.metadata['url'] # type: ignore @@ -82,15 +89,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -142,10 +145,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -164,14 +170,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EventHubCreateOrUpdateParameters') 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 @@ -209,7 +213,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -230,7 +236,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -266,9 +271,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -286,9 +294,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -327,11 +334,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -346,15 +360,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -409,10 +419,13 @@ def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -432,14 +445,12 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SharedAccessAuthorizationRuleCreateOrUpdateParameters') 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 @@ -480,9 +491,12 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -501,9 +515,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -545,9 +558,12 @@ def post_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.post_authorization_rule.metadata['url'] # type: ignore @@ -566,9 +582,8 @@ def post_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,7 +625,9 @@ def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -632,7 +649,6 @@ def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -671,9 +687,12 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -692,9 +711,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -740,10 +758,13 @@ def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -763,14 +784,12 @@ def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateKeysParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_namespaces_operations.py index 4f1ad6032e26..410e570e7ff5 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_namespaces_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_namespaces_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -63,10 +63,13 @@ def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -82,14 +85,12 @@ def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -118,11 +119,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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 @@ -134,15 +142,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -185,11 +189,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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 @@ -202,15 +213,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -244,12 +251,15 @@ def _create_or_update_initial( parameters, # type: "models.NamespaceCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.NamespaceResource" - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.NamespaceResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.NamespaceResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -267,14 +277,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NamespaceCreateOrUpdateParameters') 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 @@ -302,9 +310,9 @@ def begin_create_or_update( parameters, # type: "models.NamespaceCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.NamespaceResource"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. + This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -370,7 +378,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -390,7 +400,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -410,9 +419,9 @@ def begin_delete( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. + namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -483,9 +492,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -502,9 +514,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -513,7 +524,6 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('NamespaceResource', pipeline_response) @@ -533,7 +543,7 @@ def update( parameters, # type: "models.NamespaceUpdateParameter" **kwargs # type: Any ): - # type: (...) -> "models.NamespaceResource" + # type: (...) -> Optional["models.NamespaceResource"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -548,11 +558,14 @@ def update( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.NamespaceResource or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.NamespaceResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -570,14 +583,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NamespaceUpdateParameter') 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 @@ -617,11 +628,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -635,15 +653,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -695,10 +709,13 @@ def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -717,14 +734,12 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'SharedAccessAuthorizationRuleCreateOrUpdateParameters') 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 @@ -762,7 +777,9 @@ def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" @@ -783,7 +800,6 @@ def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -819,9 +835,12 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -839,9 +858,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -880,9 +898,12 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -900,9 +921,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -944,10 +964,13 @@ def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -966,14 +989,12 @@ def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateKeysParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_operations.py index 9ef59e3b4741..732f4b07a14e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-08-01" + 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.metadata['url'] # type: ignore @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py index 1758273a3230..72f93dd9db6c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['EventHubManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py index 247e5b0ce124..82776d7e4da1 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py @@ -10,6 +10,7 @@ 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 @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_event_hub_management_client.py index 16d777033ae4..c60829a72e12 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_event_hub_management_client.py @@ -65,6 +65,7 @@ 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.namespaces = NamespacesOperations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_metadata.json b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_metadata.json index d989841faeb7..41acda9663f8 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_metadata.json +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "EventHubManagementClient", "filename": "_event_hub_management_client", - "description": "Azure Event Hubs client." + "description": "Azure Event Hubs client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "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": { "namespaces": "NamespacesOperations", diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/__init__.py index e990def3459f..7cb0ca65be40 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._event_hub_management_client_async import EventHubManagementClient +from ._event_hub_management_client import EventHubManagementClient __all__ = ['EventHubManagementClient'] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py index c213c76e00ad..587b01b0f3f1 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py @@ -10,6 +10,7 @@ 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 @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py similarity index 86% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py index f538fabc98e3..b1bdbb90668f 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import EventHubManagementClientConfiguration -from .operations_async import NamespacesOperations -from .operations_async import DisasterRecoveryConfigsOperations -from .operations_async import EventHubsOperations -from .operations_async import ConsumerGroupsOperations -from .operations_async import Operations -from .operations_async import RegionsOperations +from ._configuration import EventHubManagementClientConfiguration +from .operations import NamespacesOperations +from .operations import DisasterRecoveryConfigsOperations +from .operations import EventHubsOperations +from .operations import ConsumerGroupsOperations +from .operations import Operations +from .operations import RegionsOperations from .. import models @@ -29,17 +29,17 @@ class EventHubManagementClient(object): """Azure Event Hubs client. :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.eventhub.v2017_04_01.aio.operations_async.NamespacesOperations + :vartype namespaces: azure.mgmt.eventhub.v2017_04_01.aio.operations.NamespacesOperations :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations - :vartype disaster_recovery_configs: azure.mgmt.eventhub.v2017_04_01.aio.operations_async.DisasterRecoveryConfigsOperations + :vartype disaster_recovery_configs: azure.mgmt.eventhub.v2017_04_01.aio.operations.DisasterRecoveryConfigsOperations :ivar event_hubs: EventHubsOperations operations - :vartype event_hubs: azure.mgmt.eventhub.v2017_04_01.aio.operations_async.EventHubsOperations + :vartype event_hubs: azure.mgmt.eventhub.v2017_04_01.aio.operations.EventHubsOperations :ivar consumer_groups: ConsumerGroupsOperations operations - :vartype consumer_groups: azure.mgmt.eventhub.v2017_04_01.aio.operations_async.ConsumerGroupsOperations + :vartype consumer_groups: azure.mgmt.eventhub.v2017_04_01.aio.operations.ConsumerGroupsOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.eventhub.v2017_04_01.aio.operations_async.Operations + :vartype operations: azure.mgmt.eventhub.v2017_04_01.aio.operations.Operations :ivar regions: RegionsOperations operations - :vartype regions: azure.mgmt.eventhub.v2017_04_01.aio.operations_async.RegionsOperations + :vartype regions: azure.mgmt.eventhub.v2017_04_01.aio.operations.RegionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -62,6 +62,7 @@ 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.namespaces = NamespacesOperations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/__init__.py similarity index 62% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/__init__.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/__init__.py index 50f866965cbe..9f700e3e8a2b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/__init__.py @@ -6,12 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._namespaces_operations_async import NamespacesOperations -from ._disaster_recovery_configs_operations_async import DisasterRecoveryConfigsOperations -from ._event_hubs_operations_async import EventHubsOperations -from ._consumer_groups_operations_async import ConsumerGroupsOperations -from ._operations_async import Operations -from ._regions_operations_async import RegionsOperations +from ._namespaces_operations import NamespacesOperations +from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from ._event_hubs_operations import EventHubsOperations +from ._consumer_groups_operations import ConsumerGroupsOperations +from ._operations import Operations +from ._regions_operations import RegionsOperations __all__ = [ 'NamespacesOperations', diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_consumer_groups_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py similarity index 90% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_consumer_groups_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py index 9b6d25cd29f0..aea2e7a6bdb8 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_consumer_groups_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -68,17 +68,20 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -91,14 +94,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConsumerGroup') 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 @@ -139,16 +140,19 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -160,8 +164,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -200,16 +204,19 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -221,9 +228,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -251,7 +257,7 @@ def list_by_event_hub( **kwargs ) -> AsyncIterable["models.ConsumerGroupListResult"]: """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - exists in the Namespace. + exists in the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -260,8 +266,8 @@ def list_by_event_hub( :param event_hub_name: The Event Hub name. :type event_hub_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -271,18 +277,25 @@ def list_by_event_hub( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_event_hub.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -294,15 +307,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_disaster_recovery_configs_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_disaster_recovery_configs_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py index e52beb12485a..c0fd5f5516fc 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_disaster_recovery_configs_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,11 +62,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -81,15 +88,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -141,9 +144,12 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -162,9 +168,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +211,12 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -227,9 +235,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,10 +275,13 @@ async def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -289,14 +299,12 @@ async def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -331,11 +339,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -349,15 +364,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -392,7 +403,7 @@ async def create_or_update( alias: str, parameters: "models.ArmDisasterRecovery", **kwargs - ) -> "models.ArmDisasterRecovery": + ) -> Optional["models.ArmDisasterRecovery"]: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the resource group within the azure subscription. @@ -408,11 +419,14 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecovery or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ArmDisasterRecovery"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -431,14 +445,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ArmDisasterRecovery') 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 @@ -478,9 +490,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -498,8 +513,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -535,9 +550,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -555,9 +573,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -597,9 +614,12 @@ async def break_pairing( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.break_pairing.metadata['url'] # type: ignore @@ -617,8 +637,8 @@ async def break_pairing( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -654,9 +674,12 @@ async def fail_over( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.fail_over.metadata['url'] # type: ignore @@ -674,8 +697,8 @@ async def fail_over( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_event_hubs_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py similarity index 90% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_event_hubs_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py index 45fcfed9c90c..28b84ad6402e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_event_hubs_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,18 +62,25 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -81,15 +88,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -145,17 +148,20 @@ async def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -168,14 +174,12 @@ async def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -216,16 +220,19 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -237,9 +244,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -281,16 +287,19 @@ async def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -302,8 +311,8 @@ async def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -342,16 +351,19 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -363,9 +375,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -411,17 +422,20 @@ async def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -434,14 +448,12 @@ async def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -473,8 +485,8 @@ def list_by_namespace( :param namespace_name: The Namespace name. :type namespace_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -484,11 +496,18 @@ def list_by_namespace( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_namespace.metadata['url'] # type: ignore @@ -506,15 +525,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -566,17 +581,20 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -588,14 +606,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Eventhub') 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 @@ -633,16 +649,19 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -653,8 +672,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -690,16 +709,19 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -710,9 +732,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_namespaces_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py similarity index 90% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_namespaces_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py index f0059e08e12a..8662db8019c0 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_namespaces_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -61,11 +61,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -139,10 +142,13 @@ async def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -161,14 +167,12 @@ async def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -206,9 +210,12 @@ async def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore @@ -226,8 +233,8 @@ async def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -263,9 +270,12 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -283,9 +293,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -324,9 +333,12 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -344,9 +356,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -388,10 +399,13 @@ async def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -410,14 +424,12 @@ async def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -449,10 +461,13 @@ async def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -468,14 +483,12 @@ async def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -504,11 +517,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -520,15 +540,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -571,11 +587,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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 @@ -588,15 +611,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -630,12 +649,15 @@ async def _create_or_update_initial( namespace_name: str, parameters: "models.EHNamespace", **kwargs - ) -> "models.EHNamespace": - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.EHNamespace"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -653,14 +675,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -688,9 +708,9 @@ async def begin_create_or_update( namespace_name: str, parameters: "models.EHNamespace", **kwargs - ) -> "models.EHNamespace": + ) -> AsyncLROPoller["models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. + This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -704,8 +724,8 @@ async def begin_create_or_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: EHNamespace, or the result of cls(response) - :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.EHNamespace + :return: An instance of AsyncLROPoller that returns either EHNamespace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2017_04_01.models.EHNamespace] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -755,9 +775,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -774,8 +797,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -795,9 +818,9 @@ async def begin_delete( resource_group_name: str, namespace_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. + namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -809,8 +832,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -867,9 +890,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -886,9 +912,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -898,7 +923,6 @@ async def get( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('EHNamespace', pipeline_response) @@ -917,7 +941,7 @@ async def update( namespace_name: str, parameters: "models.EHNamespace", **kwargs - ) -> "models.EHNamespace": + ) -> Optional["models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -932,11 +956,14 @@ async def update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.EHNamespace or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -954,14 +981,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -1001,9 +1026,12 @@ async def get_messaging_plan( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingPlan"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_messaging_plan.metadata['url'] # type: ignore @@ -1020,9 +1048,8 @@ async def get_messaging_plan( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1061,10 +1088,13 @@ async def create_or_update_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_network_rule_set.metadata['url'] # type: ignore @@ -1082,14 +1112,12 @@ async def create_or_update_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkRuleSet') 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 @@ -1124,9 +1152,12 @@ async def get_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_network_rule_set.metadata['url'] # type: ignore @@ -1143,9 +1174,8 @@ async def get_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1181,11 +1211,18 @@ def list_network_rule_sets( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_network_rule_sets.metadata['url'] # type: ignore @@ -1199,15 +1236,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py similarity index 88% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py index 4cb04f4ccd03..2f391069c916 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_regions_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py similarity index 89% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_regions_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py index 83a051449078..8481c48729d4 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations_async/_regions_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list_by_sku( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_sku.metadata['url'] # type: ignore @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/__init__.py index 866e0396195a..4edc6d5c59f3 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/__init__.py @@ -79,6 +79,7 @@ EncodingCaptureDescription, EntityStatus, KeyType, + NetworkRuleIPAction, ProvisioningStateDR, RoleDisasterRecovery, SkuName, @@ -124,6 +125,7 @@ 'EncodingCaptureDescription', 'EntityStatus', 'KeyType', + 'NetworkRuleIPAction', 'ProvisioningStateDR', 'RoleDisasterRecovery', 'SkuName', diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_event_hub_management_client_enums.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_event_hub_management_client_enums.py index 74ebd3a6ffa7..95c4e7c11c85 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_event_hub_management_client_enums.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_event_hub_management_client_enums.py @@ -6,89 +6,113 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessRights(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - manage = "Manage" - send = "Send" - listen = "Listen" + 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 DefaultAction(str, Enum): + +class AccessRights(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGE = "Manage" + SEND = "Send" + LISTEN = "Listen" + +class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Default Action for Network Rule Set """ - allow = "Allow" - deny = "Deny" + ALLOW = "Allow" + DENY = "Deny" -class EncodingCaptureDescription(str, Enum): +class EncodingCaptureDescription(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version """ - avro = "Avro" - avro_deflate = "AvroDeflate" + AVRO = "Avro" + AVRO_DEFLATE = "AvroDeflate" -class EntityStatus(str, Enum): +class EntityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Enumerates the possible values for the status of the Event Hub. """ - active = "Active" - disabled = "Disabled" - restoring = "Restoring" - send_disabled = "SendDisabled" - receive_disabled = "ReceiveDisabled" - creating = "Creating" - deleting = "Deleting" - renaming = "Renaming" - unknown = "Unknown" - -class KeyType(str, Enum): + ACTIVE = "Active" + DISABLED = "Disabled" + RESTORING = "Restoring" + SEND_DISABLED = "SendDisabled" + RECEIVE_DISABLED = "ReceiveDisabled" + CREATING = "Creating" + DELETING = "Deleting" + RENAMING = "Renaming" + UNKNOWN = "Unknown" + +class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The access key to regenerate. """ - primary_key = "PrimaryKey" - secondary_key = "SecondaryKey" + PRIMARY_KEY = "PrimaryKey" + SECONDARY_KEY = "SecondaryKey" + +class NetworkRuleIPAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IP Filter Action + """ + + ALLOW = "Allow" -class ProvisioningStateDR(str, Enum): +class ProvisioningStateDR(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed' """ - accepted = "Accepted" - succeeded = "Succeeded" - failed = "Failed" + ACCEPTED = "Accepted" + SUCCEEDED = "Succeeded" + FAILED = "Failed" -class RoleDisasterRecovery(str, Enum): +class RoleDisasterRecovery(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary' """ - primary = "Primary" - primary_not_replicating = "PrimaryNotReplicating" - secondary = "Secondary" + PRIMARY = "Primary" + PRIMARY_NOT_REPLICATING = "PrimaryNotReplicating" + SECONDARY = "Secondary" -class SkuName(str, Enum): +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Name of this SKU. """ - basic = "Basic" - standard = "Standard" + BASIC = "Basic" + STANDARD = "Standard" -class SkuTier(str, Enum): +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The billing tier of this particular SKU. """ - basic = "Basic" - standard = "Standard" + BASIC = "Basic" + STANDARD = "Standard" -class UnavailableReason(str, Enum): +class UnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the reason for the unavailability of the service. """ - none = "None" - invalid_name = "InvalidName" - subscription_is_disabled = "SubscriptionIsDisabled" - name_in_use = "NameInUse" - name_in_lockdown = "NameInLockdown" - too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" + NONE = "None" + INVALID_NAME = "InvalidName" + SUBSCRIPTION_IS_DISABLED = "SubscriptionIsDisabled" + NAME_IN_USE = "NameInUse" + NAME_IN_LOCKDOWN = "NameInLockdown" + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models.py index 2dfbdb1982e4..c5ed65e0e26c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models.py @@ -966,31 +966,24 @@ def __init__( class NWRuleSetIpRules(msrest.serialization.Model): """Description of NetWorkRuleSet - IpRules resource. - Variables are only populated by the server, and will be ignored when sending a request. - :param ip_mask: IP Mask. :type ip_mask: str - :ivar action: The IP Filter Action. Default value: "Allow". - :vartype action: str + :param action: The IP Filter Action. Possible values include: "Allow". Default value: "Allow". + :type action: str or ~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleIPAction """ - _validation = { - 'action': {'constant': True}, - } - _attribute_map = { 'ip_mask': {'key': 'ipMask', 'type': 'str'}, 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(NWRuleSetIpRules, self).__init__(**kwargs) self.ip_mask = kwargs.get('ip_mask', None) + self.action = kwargs.get('action', "Allow") class NWRuleSetVirtualNetworkRules(msrest.serialization.Model): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models_py3.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models_py3.py index 2065e098a837..186f9641af2d 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models_py3.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/_models_py3.py @@ -1042,33 +1042,27 @@ def __init__( class NWRuleSetIpRules(msrest.serialization.Model): """Description of NetWorkRuleSet - IpRules resource. - Variables are only populated by the server, and will be ignored when sending a request. - :param ip_mask: IP Mask. :type ip_mask: str - :ivar action: The IP Filter Action. Default value: "Allow". - :vartype action: str + :param action: The IP Filter Action. Possible values include: "Allow". Default value: "Allow". + :type action: str or ~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleIPAction """ - _validation = { - 'action': {'constant': True}, - } - _attribute_map = { 'ip_mask': {'key': 'ipMask', 'type': 'str'}, 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_mask: Optional[str] = None, + action: Optional[Union[str, "NetworkRuleIPAction"]] = "Allow", **kwargs ): super(NWRuleSetIpRules, self).__init__(**kwargs) self.ip_mask = ip_mask + self.action = action class NWRuleSetVirtualNetworkRules(msrest.serialization.Model): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_consumer_groups_operations.py index 2f4254beaa67..a245d6cdff26 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_consumer_groups_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_consumer_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -73,17 +73,20 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -96,14 +99,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConsumerGroup') 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 @@ -145,16 +146,19 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -166,8 +170,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -207,16 +211,19 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -228,9 +235,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +265,7 @@ def list_by_event_hub( ): # type: (...) -> Iterable["models.ConsumerGroupListResult"] """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - exists in the Namespace. + exists in the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -268,8 +274,8 @@ def list_by_event_hub( :param event_hub_name: The Event Hub name. :type event_hub_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -279,18 +285,25 @@ def list_by_event_hub( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_event_hub.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -302,15 +315,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_disaster_recovery_configs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_disaster_recovery_configs_operations.py index 27ade43a3cc9..bfab5c3acf79 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_disaster_recovery_configs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_disaster_recovery_configs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,11 +67,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -86,15 +93,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -147,9 +150,12 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -168,9 +174,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +218,12 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -234,9 +242,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,10 +283,13 @@ def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -297,14 +307,12 @@ def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -340,11 +348,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -358,15 +373,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -402,7 +413,7 @@ def create_or_update( parameters, # type: "models.ArmDisasterRecovery" **kwargs # type: Any ): - # type: (...) -> "models.ArmDisasterRecovery" + # type: (...) -> Optional["models.ArmDisasterRecovery"] """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the resource group within the azure subscription. @@ -418,11 +429,14 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecovery or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ArmDisasterRecovery"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -441,14 +455,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ArmDisasterRecovery') 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 @@ -489,9 +501,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -509,8 +524,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -547,9 +562,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -567,9 +585,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,9 +627,12 @@ def break_pairing( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.break_pairing.metadata['url'] # type: ignore @@ -630,8 +650,8 @@ def break_pairing( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -668,9 +688,12 @@ def fail_over( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.fail_over.metadata['url'] # type: ignore @@ -688,8 +711,8 @@ def fail_over( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_event_hubs_operations.py index c85c0ae1056c..861bf31dc47d 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_event_hubs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_event_hubs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,18 +67,25 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -86,15 +93,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -151,17 +154,20 @@ def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -174,14 +180,12 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -223,16 +227,19 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -244,9 +251,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,16 +295,19 @@ def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -310,8 +319,8 @@ def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -351,16 +360,19 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -372,9 +384,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -421,17 +432,20 @@ def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -444,14 +458,12 @@ def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -484,8 +496,8 @@ def list_by_namespace( :param namespace_name: The Namespace name. :type namespace_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -495,11 +507,18 @@ def list_by_namespace( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_namespace.metadata['url'] # type: ignore @@ -517,15 +536,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -578,17 +593,20 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -600,14 +618,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Eventhub') 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 @@ -646,16 +662,19 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -666,8 +685,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -704,16 +723,19 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -724,9 +746,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_namespaces_operations.py index 5f52f4647755..496ad0d86bf8 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_namespaces_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_namespaces_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -66,11 +66,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -84,15 +91,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -145,10 +148,13 @@ def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -167,14 +173,12 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -213,9 +217,12 @@ def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore @@ -233,8 +240,8 @@ def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -271,9 +278,12 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -291,9 +301,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -333,9 +342,12 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -353,9 +365,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -398,10 +409,13 @@ def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -420,14 +434,12 @@ def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -460,10 +472,13 @@ def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -479,14 +494,12 @@ def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -516,11 +529,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -532,15 +552,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -584,11 +600,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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 @@ -601,15 +624,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -644,12 +663,15 @@ def _create_or_update_initial( parameters, # type: "models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> "models.EHNamespace" - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -667,14 +689,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -703,9 +723,9 @@ def begin_create_or_update( parameters, # type: "models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. + This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -771,9 +791,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -790,8 +813,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -812,9 +835,9 @@ def begin_delete( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. + namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -885,9 +908,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -904,9 +930,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -916,7 +941,6 @@ def get( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('EHNamespace', pipeline_response) @@ -936,7 +960,7 @@ def update( parameters, # type: "models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> "models.EHNamespace" + # type: (...) -> Optional["models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -951,11 +975,14 @@ def update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.EHNamespace or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -973,14 +1000,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -1021,9 +1046,12 @@ def get_messaging_plan( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingPlan"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_messaging_plan.metadata['url'] # type: ignore @@ -1040,9 +1068,8 @@ def get_messaging_plan( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1082,10 +1109,13 @@ def create_or_update_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_network_rule_set.metadata['url'] # type: ignore @@ -1103,14 +1133,12 @@ def create_or_update_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkRuleSet') 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 @@ -1146,9 +1174,12 @@ def get_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_network_rule_set.metadata['url'] # type: ignore @@ -1165,9 +1196,8 @@ def get_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1204,11 +1234,18 @@ def list_network_rule_sets( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSetListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_network_rule_sets.metadata['url'] # type: ignore @@ -1222,15 +1259,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_operations.py index 8b70099cbaa5..d388cd1dc93c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_regions_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_regions_operations.py index da28bb4f30f5..bd6bb55d9d4c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_regions_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/operations/_regions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list_by_sku( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_sku.metadata['url'] # type: ignore @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py index 1758273a3230..72f93dd9db6c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['EventHubManagementClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py index 24789763cef1..63e76602f3e6 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py @@ -10,6 +10,7 @@ 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 @@ -46,8 +47,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -60,6 +60,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_event_hub_management_client.py index cb22a3e538e8..810346133992 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_event_hub_management_client.py @@ -20,6 +20,8 @@ from ._configuration import EventHubManagementClientConfiguration from .operations import ClustersOperations from .operations import NamespacesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations from .operations import ConfigurationOperations from .operations import DisasterRecoveryConfigsOperations from .operations import EventHubsOperations @@ -36,6 +38,10 @@ class EventHubManagementClient(object): :vartype clusters: azure.mgmt.eventhub.v2018_01_01_preview.operations.ClustersOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.eventhub.v2018_01_01_preview.operations.NamespacesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.eventhub.v2018_01_01_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.eventhub.v2018_01_01_preview.operations.PrivateLinkResourcesOperations :ivar configuration: ConfigurationOperations operations :vartype configuration: azure.mgmt.eventhub.v2018_01_01_preview.operations.ConfigurationOperations :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations @@ -71,12 +77,17 @@ 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.clusters = ClustersOperations( self._client, self._config, self._serialize, self._deserialize) self.namespaces = NamespacesOperations( self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) self.configuration = ConfigurationOperations( self._client, self._config, self._serialize, self._deserialize) self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_metadata.json b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_metadata.json index 1b8493c64c9f..864f6a7fffaa 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_metadata.json +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "EventHubManagementClient", "filename": "_event_hub_management_client", - "description": "Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources." + "description": "Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,11 +45,16 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "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": { "clusters": "ClustersOperations", "namespaces": "NamespacesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", "configuration": "ConfigurationOperations", "disaster_recovery_configs": "DisasterRecoveryConfigsOperations", "event_hubs": "EventHubsOperations", diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/__init__.py index e990def3459f..7cb0ca65be40 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._event_hub_management_client_async import EventHubManagementClient +from ._event_hub_management_client import EventHubManagementClient __all__ = ['EventHubManagementClient'] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py index 454f0a453d6b..5c5831a12bf1 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py @@ -10,6 +10,7 @@ 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 @@ -43,8 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -56,6 +56,7 @@ def _configure( 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) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py similarity index 72% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py index 28f87f92b90b..b0155a6aeff0 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py @@ -15,15 +15,17 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import EventHubManagementClientConfiguration -from .operations_async import ClustersOperations -from .operations_async import NamespacesOperations -from .operations_async import ConfigurationOperations -from .operations_async import DisasterRecoveryConfigsOperations -from .operations_async import EventHubsOperations -from .operations_async import ConsumerGroupsOperations -from .operations_async import Operations -from .operations_async import RegionsOperations +from ._configuration import EventHubManagementClientConfiguration +from .operations import ClustersOperations +from .operations import NamespacesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ConfigurationOperations +from .operations import DisasterRecoveryConfigsOperations +from .operations import EventHubsOperations +from .operations import ConsumerGroupsOperations +from .operations import Operations +from .operations import RegionsOperations from .. import models @@ -31,21 +33,25 @@ class EventHubManagementClient(object): """Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. :ivar clusters: ClustersOperations operations - :vartype clusters: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.ClustersOperations + :vartype clusters: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.ClustersOperations :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.NamespacesOperations + :vartype namespaces: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.NamespacesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.PrivateLinkResourcesOperations :ivar configuration: ConfigurationOperations operations - :vartype configuration: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.ConfigurationOperations + :vartype configuration: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.ConfigurationOperations :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations - :vartype disaster_recovery_configs: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.DisasterRecoveryConfigsOperations + :vartype disaster_recovery_configs: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.DisasterRecoveryConfigsOperations :ivar event_hubs: EventHubsOperations operations - :vartype event_hubs: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.EventHubsOperations + :vartype event_hubs: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.EventHubsOperations :ivar consumer_groups: ConsumerGroupsOperations operations - :vartype consumer_groups: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.ConsumerGroupsOperations + :vartype consumer_groups: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.ConsumerGroupsOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.Operations + :vartype operations: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.Operations :ivar regions: RegionsOperations operations - :vartype regions: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations_async.RegionsOperations + :vartype regions: azure.mgmt.eventhub.v2018_01_01_preview.aio.operations.RegionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -68,12 +74,17 @@ 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.clusters = ClustersOperations( self._client, self._config, self._serialize, self._deserialize) self.namespaces = NamespacesOperations( self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) self.configuration = ConfigurationOperations( self._client, self._config, self._serialize, self._deserialize) self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..05f8ee6b9789 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/__init__.py @@ -0,0 +1,31 @@ +# 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 ._clusters_operations import ClustersOperations +from ._namespaces_operations import NamespacesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._configuration_operations import ConfigurationOperations +from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from ._event_hubs_operations import EventHubsOperations +from ._consumer_groups_operations import ConsumerGroupsOperations +from ._operations import Operations +from ._regions_operations import RegionsOperations + +__all__ = [ + 'ClustersOperations', + 'NamespacesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ConfigurationOperations', + 'DisasterRecoveryConfigsOperations', + 'EventHubsOperations', + 'ConsumerGroupsOperations', + 'Operations', + 'RegionsOperations', +] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_clusters_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py similarity index 90% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_clusters_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py index 8ce1461cff07..452423dfa432 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_clusters_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -55,9 +55,12 @@ async def list_available_cluster_region( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableClustersList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.list_available_cluster_region.metadata['url'] # type: ignore @@ -72,9 +75,8 @@ async def list_available_cluster_region( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -107,11 +109,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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 @@ -124,15 +133,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -178,9 +183,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -197,9 +205,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -223,12 +230,15 @@ async def _create_or_update_initial( cluster_name: str, parameters: "models.Cluster", **kwargs - ) -> "models.Cluster": - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.Cluster"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -246,14 +256,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Cluster') 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 @@ -281,7 +289,7 @@ async def begin_create_or_update( cluster_name: str, parameters: "models.Cluster", **kwargs - ) -> "models.Cluster": + ) -> AsyncLROPoller["models.Cluster"]: """Creates or updates an instance of an Event Hubs Cluster. :param resource_group_name: Name of the resource group within the azure subscription. @@ -296,8 +304,8 @@ async def begin_create_or_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Cluster, or the result of cls(response) - :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster + :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -346,12 +354,15 @@ async def _update_initial( cluster_name: str, parameters: "models.Cluster", **kwargs - ) -> "models.Cluster": - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.Cluster"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -369,14 +380,12 @@ async def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Cluster') 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 @@ -404,7 +413,7 @@ async def begin_update( cluster_name: str, parameters: "models.Cluster", **kwargs - ) -> "models.Cluster": + ) -> AsyncLROPoller["models.Cluster"]: """Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. @@ -419,8 +428,8 @@ async def begin_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Cluster, or the result of cls(response) - :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster + :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -470,9 +479,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -489,8 +501,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -510,7 +522,7 @@ async def begin_delete( resource_group_name: str, cluster_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an existing Event Hubs Cluster. This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. @@ -523,8 +535,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -581,9 +593,12 @@ async def list_namespaces( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceIdListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.list_namespaces.metadata['url'] # type: ignore @@ -600,9 +615,8 @@ async def list_namespaces( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_configuration_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_configuration_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py index 60d34d59b57f..bf94e76a7818 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_configuration_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -46,7 +46,7 @@ async def patch( cluster_name: str, parameters: "models.ClusterQuotaConfigurationProperties", **kwargs - ) -> "models.ClusterQuotaConfigurationProperties": + ) -> Optional["models.ClusterQuotaConfigurationProperties"]: """Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. @@ -61,11 +61,14 @@ async def patch( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterQuotaConfigurationProperties or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterQuotaConfigurationProperties"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ClusterQuotaConfigurationProperties"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.patch.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def patch( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ClusterQuotaConfigurationProperties') 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 @@ -131,9 +132,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterQuotaConfigurationProperties"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -150,9 +154,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_consumer_groups_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py similarity index 90% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_consumer_groups_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py index 41e32b45f411..b03c6f512493 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_consumer_groups_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -68,17 +68,20 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -91,14 +94,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConsumerGroup') 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 @@ -139,16 +140,19 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -160,8 +164,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -200,16 +204,19 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -221,9 +228,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -251,7 +257,7 @@ def list_by_event_hub( **kwargs ) -> AsyncIterable["models.ConsumerGroupListResult"]: """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - exists in the Namespace. + exists in the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -260,8 +266,8 @@ def list_by_event_hub( :param event_hub_name: The Event Hub name. :type event_hub_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -271,18 +277,25 @@ def list_by_event_hub( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_event_hub.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -294,15 +307,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_disaster_recovery_configs_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_disaster_recovery_configs_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py index 21f1e1335319..8364bd946363 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_disaster_recovery_configs_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,11 +62,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -81,15 +88,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -141,9 +144,12 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -162,9 +168,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -206,9 +211,12 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -227,9 +235,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -268,10 +275,13 @@ async def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -289,14 +299,12 @@ async def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -331,11 +339,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -349,15 +364,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -392,7 +403,7 @@ async def create_or_update( alias: str, parameters: "models.ArmDisasterRecovery", **kwargs - ) -> "models.ArmDisasterRecovery": + ) -> Optional["models.ArmDisasterRecovery"]: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the resource group within the azure subscription. @@ -408,11 +419,14 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ArmDisasterRecovery or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ArmDisasterRecovery"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -431,14 +445,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ArmDisasterRecovery') 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 @@ -478,9 +490,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -498,8 +513,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -535,9 +550,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -555,9 +573,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -597,9 +614,12 @@ async def break_pairing( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.break_pairing.metadata['url'] # type: ignore @@ -617,8 +637,8 @@ async def break_pairing( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -654,9 +674,12 @@ async def fail_over( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.fail_over.metadata['url'] # type: ignore @@ -674,8 +697,8 @@ async def fail_over( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_event_hubs_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py similarity index 90% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_event_hubs_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py index fe10c91d941c..795a31a77094 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_event_hubs_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -62,18 +62,25 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -81,15 +88,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -145,17 +148,20 @@ async def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -168,14 +174,12 @@ async def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -216,16 +220,19 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -237,9 +244,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -281,16 +287,19 @@ async def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -302,8 +311,8 @@ async def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -342,16 +351,19 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -363,9 +375,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -411,17 +422,20 @@ async def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -434,14 +448,12 @@ async def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -473,8 +485,8 @@ def list_by_namespace( :param namespace_name: The Namespace name. :type namespace_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -484,11 +496,18 @@ def list_by_namespace( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_namespace.metadata['url'] # type: ignore @@ -506,15 +525,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -566,17 +581,20 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -588,14 +606,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Eventhub') 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 @@ -633,16 +649,19 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -653,8 +672,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -690,16 +709,19 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -710,9 +732,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_namespaces_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py similarity index 91% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_namespaces_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py index de2ad05e2c6e..7b2ffd2f00cc 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_namespaces_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -61,11 +61,18 @@ def list_ip_filter_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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_ip_filter_rules.metadata['url'] # type: ignore @@ -79,15 +86,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -139,10 +142,13 @@ async def create_or_update_ip_filter_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_ip_filter_rule.metadata['url'] # type: ignore @@ -161,14 +167,12 @@ async def create_or_update_ip_filter_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpFilterRule') 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 @@ -206,9 +210,12 @@ async def delete_ip_filter_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.delete_ip_filter_rule.metadata['url'] # type: ignore @@ -226,8 +233,8 @@ async def delete_ip_filter_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -263,9 +270,12 @@ async def get_ip_filter_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get_ip_filter_rule.metadata['url'] # type: ignore @@ -283,9 +293,8 @@ async def get_ip_filter_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -315,11 +324,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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.metadata['url'] # type: ignore @@ -331,15 +347,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -382,11 +394,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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 @@ -399,15 +418,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -441,12 +456,15 @@ async def _create_or_update_initial( namespace_name: str, parameters: "models.EHNamespace", **kwargs - ) -> "models.EHNamespace": - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.EHNamespace"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -464,14 +482,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -499,9 +515,9 @@ async def begin_create_or_update( namespace_name: str, parameters: "models.EHNamespace", **kwargs - ) -> "models.EHNamespace": + ) -> AsyncLROPoller["models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. + This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -515,8 +531,8 @@ async def begin_create_or_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: EHNamespace, or the result of cls(response) - :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespace + :return: An instance of AsyncLROPoller that returns either EHNamespace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespace] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -566,9 +582,12 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -585,8 +604,8 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -606,9 +625,9 @@ async def begin_delete( resource_group_name: str, namespace_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. + namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -620,8 +639,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -678,9 +697,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -697,9 +719,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -709,7 +730,6 @@ async def get( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('EHNamespace', pipeline_response) @@ -728,7 +748,7 @@ async def update( namespace_name: str, parameters: "models.EHNamespace", **kwargs - ) -> "models.EHNamespace": + ) -> Optional["models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -743,11 +763,14 @@ async def update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespace or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -765,14 +788,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -812,11 +833,18 @@ def list_virtual_network_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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_virtual_network_rules.metadata['url'] # type: ignore @@ -830,15 +858,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -890,10 +914,13 @@ async def create_or_update_virtual_network_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_virtual_network_rule.metadata['url'] # type: ignore @@ -912,14 +939,12 @@ async def create_or_update_virtual_network_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkRule') 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 @@ -957,9 +982,12 @@ async def delete_virtual_network_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.delete_virtual_network_rule.metadata['url'] # type: ignore @@ -977,8 +1005,8 @@ async def delete_virtual_network_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1014,9 +1042,12 @@ async def get_virtual_network_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get_virtual_network_rule.metadata['url'] # type: ignore @@ -1034,9 +1065,8 @@ async def get_virtual_network_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1075,10 +1105,13 @@ async def create_or_update_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_network_rule_set.metadata['url'] # type: ignore @@ -1096,14 +1129,12 @@ async def create_or_update_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkRuleSet') 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 @@ -1138,9 +1169,12 @@ async def get_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get_network_rule_set.metadata['url'] # type: ignore @@ -1157,9 +1191,8 @@ async def get_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1195,11 +1228,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -1213,15 +1253,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -1273,10 +1309,13 @@ async def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -1295,14 +1334,12 @@ async def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -1340,9 +1377,12 @@ async def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore @@ -1360,8 +1400,8 @@ async def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1397,9 +1437,12 @@ async def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -1417,9 +1460,8 @@ async def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request 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 @@ -1458,9 +1500,12 @@ async def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -1478,9 +1523,8 @@ async def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1522,10 +1566,13 @@ async def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -1544,14 +1591,12 @@ async def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1583,10 +1628,13 @@ async def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -1602,14 +1650,12 @@ async def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py similarity index 88% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py index 5364c624d622..622dd8af3513 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -53,11 +53,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -65,15 +72,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..3092ec9ff140 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,368 @@ +# 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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations 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: ~azure.mgmt.eventhub.v2018_01_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( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + """Gets the available PrivateEndpointConnections within a namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-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.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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('PrivateEndpointConnectionListResult', 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + parameters: "models.PrivateEndpointConnection", + **kwargs + ) -> "models.PrivateEndpointConnection": + """Creates or updates PrivateEndpointConnections of service namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to + namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-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', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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, 'PrivateEndpointConnection') + 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('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + 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 = "2018-01-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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, 202, 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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets a description for the specified Private Endpoint Connection name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + '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') + + # 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..67d1f8814294 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,100 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar +import warnings + +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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations 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: ~azure.mgmt.eventhub.v2018_01_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 + + async def get( + self, + resource_group_name: str, + namespace_name: str, + **kwargs + ) -> "models.PrivateLinkResourcesListResult": + """Gets lists of resources that supports Privatelinks. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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') + + # 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('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateLinkResources'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_regions_operations_async.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py similarity index 89% rename from sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_regions_operations_async.py rename to sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py index c342fad5d250..23c81502d8d6 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/_regions_operations_async.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -56,11 +56,18 @@ def list_by_sku( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_sku.metadata['url'] # type: ignore @@ -73,15 +80,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/__init__.py deleted file mode 100644 index 6cd6e795bebc..000000000000 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations_async/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._clusters_operations_async import ClustersOperations -from ._namespaces_operations_async import NamespacesOperations -from ._configuration_operations_async import ConfigurationOperations -from ._disaster_recovery_configs_operations_async import DisasterRecoveryConfigsOperations -from ._event_hubs_operations_async import EventHubsOperations -from ._consumer_groups_operations_async import ConsumerGroupsOperations -from ._operations_async import Operations -from ._regions_operations_async import RegionsOperations - -__all__ = [ - 'ClustersOperations', - 'NamespacesOperations', - 'ConfigurationOperations', - 'DisasterRecoveryConfigsOperations', - 'EventHubsOperations', - 'ConsumerGroupsOperations', - 'Operations', - 'RegionsOperations', -] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py index 2dd761d7cdc8..27c5eee8d87b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/__init__.py @@ -21,6 +21,7 @@ from ._models_py3 import ClusterListResult from ._models_py3 import ClusterQuotaConfigurationProperties from ._models_py3 import ClusterSku + from ._models_py3 import ConnectionState from ._models_py3 import ConsumerGroup from ._models_py3 import ConsumerGroupListResult from ._models_py3 import Destination @@ -45,6 +46,11 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourcesListResult from ._models_py3 import RegenerateAccessKeyParameters from ._models_py3 import Resource from ._models_py3 import Sku @@ -67,6 +73,7 @@ from ._models import ClusterListResult # type: ignore from ._models import ClusterQuotaConfigurationProperties # type: ignore from ._models import ClusterSku # type: ignore + from ._models import ConnectionState # type: ignore from ._models import ConsumerGroup # type: ignore from ._models import ConsumerGroupListResult # type: ignore from ._models import Destination # type: ignore @@ -91,6 +98,11 @@ from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourcesListResult # type: ignore from ._models import RegenerateAccessKeyParameters # type: ignore from ._models import Resource # type: ignore from ._models import Sku # type: ignore @@ -101,11 +113,15 @@ from ._event_hub_management_client_enums import ( AccessRights, + ClusterSkuName, DefaultAction, EncodingCaptureDescription, + EndPointProvisioningState, EntityStatus, IPAction, KeyType, + NetworkRuleIPAction, + PrivateLinkConnectionStatus, ProvisioningStateDR, RoleDisasterRecovery, SkuName, @@ -128,6 +144,7 @@ 'ClusterListResult', 'ClusterQuotaConfigurationProperties', 'ClusterSku', + 'ConnectionState', 'ConsumerGroup', 'ConsumerGroupListResult', 'Destination', @@ -152,6 +169,11 @@ 'Operation', 'OperationDisplay', 'OperationListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', 'RegenerateAccessKeyParameters', 'Resource', 'Sku', @@ -160,11 +182,15 @@ 'VirtualNetworkRule', 'VirtualNetworkRuleListResult', 'AccessRights', + 'ClusterSkuName', 'DefaultAction', 'EncodingCaptureDescription', + 'EndPointProvisioningState', 'EntityStatus', 'IPAction', 'KeyType', + 'NetworkRuleIPAction', + 'PrivateLinkConnectionStatus', 'ProvisioningStateDR', 'RoleDisasterRecovery', 'SkuName', diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_event_hub_management_client_enums.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_event_hub_management_client_enums.py index 09960f7acf1b..25f287460b5a 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_event_hub_management_client_enums.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_event_hub_management_client_enums.py @@ -6,96 +6,146 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AccessRights(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - manage = "Manage" - send = "Send" - listen = "Listen" + 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 DefaultAction(str, Enum): + +class AccessRights(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGE = "Manage" + SEND = "Send" + LISTEN = "Listen" + +class ClusterSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of this SKU. + """ + + DEDICATED = "Dedicated" + +class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Default Action for Network Rule Set """ - allow = "Allow" - deny = "Deny" + ALLOW = "Allow" + DENY = "Deny" -class EncodingCaptureDescription(str, Enum): +class EncodingCaptureDescription(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version """ - avro = "Avro" - avro_deflate = "AvroDeflate" + AVRO = "Avro" + AVRO_DEFLATE = "AvroDeflate" + +class EndPointProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of the Private Endpoint Connection. + """ -class EntityStatus(str, Enum): + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + +class EntityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Enumerates the possible values for the status of the Event Hub. """ - active = "Active" - disabled = "Disabled" - restoring = "Restoring" - send_disabled = "SendDisabled" - receive_disabled = "ReceiveDisabled" - creating = "Creating" - deleting = "Deleting" - renaming = "Renaming" - unknown = "Unknown" - -class IPAction(str, Enum): + ACTIVE = "Active" + DISABLED = "Disabled" + RESTORING = "Restoring" + SEND_DISABLED = "SendDisabled" + RECEIVE_DISABLED = "ReceiveDisabled" + CREATING = "Creating" + DELETING = "Deleting" + RENAMING = "Renaming" + UNKNOWN = "Unknown" + +class IPAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The IP Filter Action """ - accept = "Accept" - reject = "Reject" + ACCEPT = "Accept" + REJECT = "Reject" -class KeyType(str, Enum): +class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The access key to regenerate. """ - primary_key = "PrimaryKey" - secondary_key = "SecondaryKey" + PRIMARY_KEY = "PrimaryKey" + SECONDARY_KEY = "SecondaryKey" + +class NetworkRuleIPAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IP Filter Action + """ + + ALLOW = "Allow" + +class PrivateLinkConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the connection. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" -class ProvisioningStateDR(str, Enum): +class ProvisioningStateDR(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed' """ - accepted = "Accepted" - succeeded = "Succeeded" - failed = "Failed" + ACCEPTED = "Accepted" + SUCCEEDED = "Succeeded" + FAILED = "Failed" -class RoleDisasterRecovery(str, Enum): +class RoleDisasterRecovery(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary' """ - primary = "Primary" - primary_not_replicating = "PrimaryNotReplicating" - secondary = "Secondary" + PRIMARY = "Primary" + PRIMARY_NOT_REPLICATING = "PrimaryNotReplicating" + SECONDARY = "Secondary" -class SkuName(str, Enum): +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Name of this SKU. """ - basic = "Basic" - standard = "Standard" + BASIC = "Basic" + STANDARD = "Standard" -class SkuTier(str, Enum): +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The billing tier of this particular SKU. """ - basic = "Basic" - standard = "Standard" + BASIC = "Basic" + STANDARD = "Standard" -class UnavailableReason(str, Enum): +class UnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the reason for the unavailability of the service. """ - none = "None" - invalid_name = "InvalidName" - subscription_is_disabled = "SubscriptionIsDisabled" - name_in_use = "NameInUse" - name_in_lockdown = "NameInLockdown" - too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription" + NONE = "None" + INVALID_NAME = "InvalidName" + SUBSCRIPTION_IS_DISABLED = "SubscriptionIsDisabled" + NAME_IN_USE = "NameInUse" + NAME_IN_LOCKDOWN = "NameInLockdown" + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py index 069dd2e6e7fa..1287e38dd97e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py @@ -556,18 +556,16 @@ def __init__( class ClusterSku(msrest.serialization.Model): """SKU parameters particular to a cluster instance. - 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 name: Required. Name of this SKU. Default value: "Dedicated". - :vartype name: str + :param name: Required. Name of this SKU. Possible values include: "Dedicated". + :type name: str or ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterSkuName :param capacity: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. :type capacity: int """ _validation = { - 'name': {'required': True, 'constant': True}, + 'name': {'required': True}, 'capacity': {'maximum': 32, 'minimum': 1}, } @@ -576,16 +574,40 @@ class ClusterSku(msrest.serialization.Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - name = "Dedicated" - def __init__( self, **kwargs ): super(ClusterSku, self).__init__(**kwargs) + self.name = kwargs['name'] self.capacity = kwargs.get('capacity', None) +class ConnectionState(msrest.serialization.Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or + ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkConnectionStatus + :param description: Description of the connection state. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + + class ConsumerGroup(Resource): """Single item in List or Get Consumer group operation. @@ -1244,6 +1266,9 @@ class NetworkRuleSet(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str + :param trusted_service_access_enabled: Value that indicates whether Trusted Service Access is + Enabled or not. + :type trusted_service_access_enabled: bool :param default_action: Default Action for Network Rule Set. Possible values include: "Allow", "Deny". :type default_action: str or ~azure.mgmt.eventhub.v2018_01_01_preview.models.DefaultAction @@ -1264,6 +1289,7 @@ class NetworkRuleSet(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'trusted_service_access_enabled': {'key': 'properties.trustedServiceAccessEnabled', 'type': 'bool'}, 'default_action': {'key': 'properties.defaultAction', 'type': 'str'}, 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[NWRuleSetVirtualNetworkRules]'}, 'ip_rules': {'key': 'properties.ipRules', 'type': '[NWRuleSetIpRules]'}, @@ -1274,6 +1300,7 @@ def __init__( **kwargs ): super(NetworkRuleSet, self).__init__(**kwargs) + self.trusted_service_access_enabled = kwargs.get('trusted_service_access_enabled', None) self.default_action = kwargs.get('default_action', None) self.virtual_network_rules = kwargs.get('virtual_network_rules', None) self.ip_rules = kwargs.get('ip_rules', None) @@ -1282,31 +1309,24 @@ def __init__( class NWRuleSetIpRules(msrest.serialization.Model): """The response from the List namespace operation. - Variables are only populated by the server, and will be ignored when sending a request. - :param ip_mask: IP Mask. :type ip_mask: str - :ivar action: The IP Filter Action. Default value: "Allow". - :vartype action: str + :param action: The IP Filter Action. Possible values include: "Allow". + :type action: str or ~azure.mgmt.eventhub.v2018_01_01_preview.models.NetworkRuleIPAction """ - _validation = { - 'action': {'constant': True}, - } - _attribute_map = { 'ip_mask': {'key': 'ipMask', 'type': 'str'}, 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(NWRuleSetIpRules, self).__init__(**kwargs) self.ip_mask = kwargs.get('ip_mask', None) + self.action = kwargs.get('action', None) class NWRuleSetVirtualNetworkRules(msrest.serialization.Model): @@ -1428,6 +1448,157 @@ def __init__( self.next_link = None +class PrivateEndpoint(msrest.serialization.Model): + """PrivateEndpoint information. + + :param id: The ARM identifier for Private Endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(Resource): + """Properties of the PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param private_endpoint: The Private Endpoint resource for this Connection. + :type private_endpoint: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: Details about the state of the connection. + :type private_link_service_connection_state: + ~azure.mgmt.eventhub.v2018_01_01_preview.models.ConnectionState + :param provisioning_state: Provisioning state of the Private Endpoint Connection. Possible + values include: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed". + :type provisioning_state: str or + ~azure.mgmt.eventhub.v2018_01_01_preview.models.EndPointProvisioningState + """ + + _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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """Result of the list of all private endpoint connections operation. + + :param value: A collection of private endpoint connection resources. + :type value: list[~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection] + :param next_link: A link for the next page of private endpoint connection resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """Information of the private link resource. + + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :type type: str + :param group_id: The private link resource group id. + :type group_id: str + :param required_members: The private link resource required member names. + :type required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.group_id = kwargs.get('group_id', None) + self.required_members = kwargs.get('required_members', None) + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """Result of the List private link resources operation. + + :param value: A collection of private link resources. + :type value: list[~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkResource] + :param next_link: A link for the next page of private link resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + class RegenerateAccessKeyParameters(msrest.serialization.Model): """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py index aadccf8d2c77..f9539a1d126e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py @@ -598,18 +598,16 @@ def __init__( class ClusterSku(msrest.serialization.Model): """SKU parameters particular to a cluster instance. - 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 name: Required. Name of this SKU. Default value: "Dedicated". - :vartype name: str + :param name: Required. Name of this SKU. Possible values include: "Dedicated". + :type name: str or ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterSkuName :param capacity: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. :type capacity: int """ _validation = { - 'name': {'required': True, 'constant': True}, + 'name': {'required': True}, 'capacity': {'maximum': 32, 'minimum': 1}, } @@ -618,18 +616,46 @@ class ClusterSku(msrest.serialization.Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - name = "Dedicated" - def __init__( self, *, + name: Union[str, "ClusterSkuName"], capacity: Optional[int] = None, **kwargs ): super(ClusterSku, self).__init__(**kwargs) + self.name = name self.capacity = capacity +class ConnectionState(msrest.serialization.Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or + ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkConnectionStatus + :param description: Description of the connection state. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateLinkConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(ConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + class ConsumerGroup(Resource): """Single item in List or Get Consumer group operation. @@ -1349,6 +1375,9 @@ class NetworkRuleSet(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str + :param trusted_service_access_enabled: Value that indicates whether Trusted Service Access is + Enabled or not. + :type trusted_service_access_enabled: bool :param default_action: Default Action for Network Rule Set. Possible values include: "Allow", "Deny". :type default_action: str or ~azure.mgmt.eventhub.v2018_01_01_preview.models.DefaultAction @@ -1369,6 +1398,7 @@ class NetworkRuleSet(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'trusted_service_access_enabled': {'key': 'properties.trustedServiceAccessEnabled', 'type': 'bool'}, 'default_action': {'key': 'properties.defaultAction', 'type': 'str'}, 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[NWRuleSetVirtualNetworkRules]'}, 'ip_rules': {'key': 'properties.ipRules', 'type': '[NWRuleSetIpRules]'}, @@ -1377,12 +1407,14 @@ class NetworkRuleSet(Resource): def __init__( self, *, + trusted_service_access_enabled: Optional[bool] = None, default_action: Optional[Union[str, "DefaultAction"]] = None, virtual_network_rules: Optional[List["NWRuleSetVirtualNetworkRules"]] = None, ip_rules: Optional[List["NWRuleSetIpRules"]] = None, **kwargs ): super(NetworkRuleSet, self).__init__(**kwargs) + self.trusted_service_access_enabled = trusted_service_access_enabled self.default_action = default_action self.virtual_network_rules = virtual_network_rules self.ip_rules = ip_rules @@ -1391,33 +1423,27 @@ def __init__( class NWRuleSetIpRules(msrest.serialization.Model): """The response from the List namespace operation. - Variables are only populated by the server, and will be ignored when sending a request. - :param ip_mask: IP Mask. :type ip_mask: str - :ivar action: The IP Filter Action. Default value: "Allow". - :vartype action: str + :param action: The IP Filter Action. Possible values include: "Allow". + :type action: str or ~azure.mgmt.eventhub.v2018_01_01_preview.models.NetworkRuleIPAction """ - _validation = { - 'action': {'constant': True}, - } - _attribute_map = { 'ip_mask': {'key': 'ipMask', 'type': 'str'}, 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_mask: Optional[str] = None, + action: Optional[Union[str, "NetworkRuleIPAction"]] = None, **kwargs ): super(NWRuleSetIpRules, self).__init__(**kwargs) self.ip_mask = ip_mask + self.action = action class NWRuleSetVirtualNetworkRules(msrest.serialization.Model): @@ -1544,6 +1570,176 @@ def __init__( self.next_link = None +class PrivateEndpoint(msrest.serialization.Model): + """PrivateEndpoint information. + + :param id: The ARM identifier for Private Endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(Resource): + """Properties of the PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param private_endpoint: The Private Endpoint resource for this Connection. + :type private_endpoint: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: Details about the state of the connection. + :type private_link_service_connection_state: + ~azure.mgmt.eventhub.v2018_01_01_preview.models.ConnectionState + :param provisioning_state: Provisioning state of the Private Endpoint Connection. Possible + values include: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed". + :type provisioning_state: str or + ~azure.mgmt.eventhub.v2018_01_01_preview.models.EndPointProvisioningState + """ + + _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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["ConnectionState"] = None, + provisioning_state: Optional[Union[str, "EndPointProvisioningState"]] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """Result of the list of all private endpoint connections operation. + + :param value: A collection of private endpoint connection resources. + :type value: list[~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection] + :param next_link: A link for the next page of private endpoint connection resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PrivateLinkResource(msrest.serialization.Model): + """Information of the private link resource. + + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :type type: str + :param group_id: The private link resource group id. + :type group_id: str + :param required_members: The private link resource required member names. + :type required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.required_zone_names = required_zone_names + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """Result of the List private link resources operation. + + :param value: A collection of private link resources. + :type value: list[~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkResource] + :param next_link: A link for the next page of private link resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class RegenerateAccessKeyParameters(msrest.serialization.Model): """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/__init__.py index 775c6d960b86..05f8ee6b9789 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/__init__.py @@ -8,6 +8,8 @@ from ._clusters_operations import ClustersOperations from ._namespaces_operations import NamespacesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._configuration_operations import ConfigurationOperations from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations from ._event_hubs_operations import EventHubsOperations @@ -18,6 +20,8 @@ __all__ = [ 'ClustersOperations', 'NamespacesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', 'ConfigurationOperations', 'DisasterRecoveryConfigsOperations', 'EventHubsOperations', diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py index d66350520e01..8ee261ea596e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_clusters_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -60,9 +60,12 @@ def list_available_cluster_region( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableClustersList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.list_available_cluster_region.metadata['url'] # type: ignore @@ -77,9 +80,8 @@ def list_available_cluster_region( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -113,11 +115,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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 @@ -130,15 +139,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -185,9 +190,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -204,9 +212,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -231,12 +238,15 @@ def _create_or_update_initial( parameters, # type: "models.Cluster" **kwargs # type: Any ): - # type: (...) -> "models.Cluster" - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -254,14 +264,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Cluster') 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 @@ -290,7 +298,7 @@ def begin_create_or_update( parameters, # type: "models.Cluster" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Cluster"] """Creates or updates an instance of an Event Hubs Cluster. :param resource_group_name: Name of the resource group within the azure subscription. @@ -356,12 +364,15 @@ def _update_initial( parameters, # type: "models.Cluster" **kwargs # type: Any ): - # type: (...) -> "models.Cluster" - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore @@ -379,14 +390,12 @@ def _update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Cluster') 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 @@ -415,7 +424,7 @@ def begin_update( parameters, # type: "models.Cluster" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Cluster"] """Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. @@ -482,9 +491,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -501,8 +513,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -523,7 +535,7 @@ def begin_delete( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an existing Event Hubs Cluster. This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. @@ -595,9 +607,12 @@ def list_namespaces( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceIdListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.list_namespaces.metadata['url'] # type: ignore @@ -614,9 +629,8 @@ def list_namespaces( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_configuration_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_configuration_operations.py index 7e226b2a3978..65ea0b5c6991 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_configuration_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_configuration_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -51,7 +51,7 @@ def patch( parameters, # type: "models.ClusterQuotaConfigurationProperties" **kwargs # type: Any ): - # type: (...) -> "models.ClusterQuotaConfigurationProperties" + # type: (...) -> Optional["models.ClusterQuotaConfigurationProperties"] """Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings not specified in the request body unmodified. @@ -66,11 +66,14 @@ def patch( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterQuotaConfigurationProperties or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterQuotaConfigurationProperties"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ClusterQuotaConfigurationProperties"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.patch.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def patch( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ClusterQuotaConfigurationProperties') 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 @@ -137,9 +138,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterQuotaConfigurationProperties"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -156,9 +160,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_consumer_groups_operations.py index 8dbf8bd061e1..06d2e27877dc 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_consumer_groups_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_consumer_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -73,17 +73,20 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -96,14 +99,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ConsumerGroup') 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 @@ -145,16 +146,19 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -166,8 +170,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -207,16 +211,19 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -228,9 +235,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,7 +265,7 @@ def list_by_event_hub( ): # type: (...) -> Iterable["models.ConsumerGroupListResult"] """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group - exists in the Namespace. + exists in the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -268,8 +274,8 @@ def list_by_event_hub( :param event_hub_name: The Event Hub name. :type event_hub_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -279,18 +285,25 @@ def list_by_event_hub( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_event_hub.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -302,15 +315,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_disaster_recovery_configs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_disaster_recovery_configs_operations.py index 6c7e71846e2c..3d05c2eff931 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_disaster_recovery_configs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_disaster_recovery_configs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,11 +67,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -86,15 +93,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -147,9 +150,12 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -168,9 +174,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -213,9 +218,12 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -234,9 +242,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -276,10 +283,13 @@ def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -297,14 +307,12 @@ def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -340,11 +348,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -358,15 +373,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -402,7 +413,7 @@ def create_or_update( parameters, # type: "models.ArmDisasterRecovery" **kwargs # type: Any ): - # type: (...) -> "models.ArmDisasterRecovery" + # type: (...) -> Optional["models.ArmDisasterRecovery"] """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the resource group within the azure subscription. @@ -418,11 +429,14 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ArmDisasterRecovery or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ArmDisasterRecovery"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -441,14 +455,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ArmDisasterRecovery') 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 @@ -489,9 +501,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -509,8 +524,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -547,9 +562,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -567,9 +585,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,9 +627,12 @@ def break_pairing( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.break_pairing.metadata['url'] # type: ignore @@ -630,8 +650,8 @@ def break_pairing( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -668,9 +688,12 @@ def fail_over( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.fail_over.metadata['url'] # type: ignore @@ -688,8 +711,8 @@ def fail_over( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_event_hubs_operations.py index 53a634c162c7..e5756ae78844 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_event_hubs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_event_hubs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -67,18 +67,25 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -86,15 +93,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -151,17 +154,20 @@ def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -174,14 +180,12 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -223,16 +227,19 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -244,9 +251,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,16 +295,19 @@ def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -310,8 +319,8 @@ def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -351,16 +360,19 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -372,9 +384,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -421,17 +432,20 @@ def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } @@ -444,14 +458,12 @@ def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -484,8 +496,8 @@ def list_by_namespace( :param namespace_name: The Namespace name. :type namespace_name: str :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. :type skip: int :param top: May be used to limit the number of results to the most recent N usageDetails. :type top: int @@ -495,11 +507,18 @@ def list_by_namespace( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_namespace.metadata['url'] # type: ignore @@ -517,15 +536,11 @@ def prepare_request(next_link=None): if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -578,17 +593,20 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" 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 = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -600,14 +618,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'Eventhub') 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 @@ -646,16 +662,19 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -666,8 +685,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -704,16 +723,19 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), - 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=50, min_length=1), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -724,9 +746,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_namespaces_operations.py index 84f920bacfb2..38dd9027edc2 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_namespaces_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_namespaces_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -66,11 +66,18 @@ def list_ip_filter_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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_ip_filter_rules.metadata['url'] # type: ignore @@ -84,15 +91,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -145,10 +148,13 @@ def create_or_update_ip_filter_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_ip_filter_rule.metadata['url'] # type: ignore @@ -167,14 +173,12 @@ def create_or_update_ip_filter_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'IpFilterRule') 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 @@ -213,9 +217,12 @@ def delete_ip_filter_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.delete_ip_filter_rule.metadata['url'] # type: ignore @@ -233,8 +240,8 @@ def delete_ip_filter_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -271,9 +278,12 @@ def get_ip_filter_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get_ip_filter_rule.metadata['url'] # type: ignore @@ -291,9 +301,8 @@ def get_ip_filter_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -324,11 +333,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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.metadata['url'] # type: ignore @@ -340,15 +356,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -392,11 +404,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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 @@ -409,15 +428,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -452,12 +467,15 @@ def _create_or_update_initial( parameters, # type: "models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> "models.EHNamespace" - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -475,14 +493,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -511,9 +527,9 @@ def begin_create_or_update( parameters, # type: "models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. + This operation is idempotent. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -579,9 +595,12 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -598,8 +617,8 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -620,9 +639,9 @@ def begin_delete( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. + namespace. :param resource_group_name: Name of the resource group within the azure subscription. :type resource_group_name: str @@ -693,9 +712,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -712,9 +734,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -724,7 +745,6 @@ def get( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('EHNamespace', pipeline_response) @@ -744,7 +764,7 @@ def update( parameters, # type: "models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> "models.EHNamespace" + # type: (...) -> Optional["models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -759,11 +779,14 @@ def update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespace or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -781,14 +804,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'EHNamespace') 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 @@ -829,11 +850,18 @@ def list_virtual_network_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-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_virtual_network_rules.metadata['url'] # type: ignore @@ -847,15 +875,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -908,10 +932,13 @@ def create_or_update_virtual_network_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_virtual_network_rule.metadata['url'] # type: ignore @@ -930,14 +957,12 @@ def create_or_update_virtual_network_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'VirtualNetworkRule') 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 @@ -976,9 +1001,12 @@ def delete_virtual_network_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.delete_virtual_network_rule.metadata['url'] # type: ignore @@ -996,8 +1024,8 @@ def delete_virtual_network_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1034,9 +1062,12 @@ def get_virtual_network_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get_virtual_network_rule.metadata['url'] # type: ignore @@ -1054,9 +1085,8 @@ def get_virtual_network_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1096,10 +1126,13 @@ def create_or_update_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_network_rule_set.metadata['url'] # type: ignore @@ -1117,14 +1150,12 @@ def create_or_update_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'NetworkRuleSet') 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 @@ -1160,9 +1191,12 @@ def get_network_rule_set( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01-preview" + accept = "application/json" # Construct URL url = self.get_network_rule_set.metadata['url'] # type: ignore @@ -1179,9 +1213,8 @@ def get_network_rule_set( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1218,11 +1251,18 @@ def list_authorization_rules( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_authorization_rules.metadata['url'] # type: ignore @@ -1236,15 +1276,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -1297,10 +1333,13 @@ def create_or_update_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore @@ -1319,14 +1358,12 @@ def create_or_update_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AuthorizationRule') 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 @@ -1365,9 +1402,12 @@ def delete_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete_authorization_rule.metadata['url'] # type: ignore @@ -1385,8 +1425,8 @@ def delete_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1423,9 +1463,12 @@ def get_authorization_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get_authorization_rule.metadata['url'] # type: ignore @@ -1443,9 +1486,8 @@ def get_authorization_rule( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1485,9 +1527,12 @@ def list_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.list_keys.metadata['url'] # type: ignore @@ -1505,9 +1550,8 @@ def list_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1550,10 +1594,13 @@ def regenerate_keys( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.regenerate_keys.metadata['url'] # type: ignore @@ -1572,14 +1619,12 @@ def regenerate_keys( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1612,10 +1657,13 @@ def check_name_availability( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.check_name_availability.metadata['url'] # type: ignore @@ -1631,14 +1679,12 @@ def check_name_availability( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_operations.py index b7f1ac7ba83c..9cb1b808c769 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -58,11 +58,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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.metadata['url'] # type: ignore @@ -70,15 +77,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..b1daf2a1aaf3 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,377 @@ +# 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.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import 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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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: ~azure.mgmt.eventhub.v2018_01_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( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + """Gets the available PrivateEndpointConnections within a namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-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.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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('PrivateEndpointConnectionListResult', 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Creates or updates PrivateEndpointConnections of service namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to + namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-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', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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, 'PrivateEndpointConnection') + 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('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + 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 = "2018-01-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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, 202, 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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Gets a description for the specified Private Endpoint Connection name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + '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') + + # 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_link_resources_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..f650a7e0a1a1 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,105 @@ +# 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.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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: ~azure.mgmt.eventhub.v2018_01_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 get( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateLinkResourcesListResult" + """Gets lists of resources that supports Privatelinks. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + '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') + + # 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('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateLinkResources'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_regions_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_regions_operations.py index cf09d7598860..e0e6252fe5ca 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_regions_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/operations/_regions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -61,11 +61,18 @@ def list_by_sku( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + 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_sku.metadata['url'] # type: ignore @@ -78,15 +85,11 @@ def prepare_request(next_link=None): 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] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_disaster_recovery_configs.yaml b/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_disaster_recovery_configs.yaml index d2930a21b675..a178cc2215ee 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_disaster_recovery_configs.yaml +++ b/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_disaster_recovery_configs.yaml @@ -14,22 +14,22 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee?api-version=2017-04-01 response: body: - string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee","name":"namespace2test4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:namespace2test4eb615ee","createdAt":"2020-05-26T08:04:50.59Z","updatedAt":"2020-05-26T08:13:14.647Z","serviceBusEndpoint":"https://namespace2test4eb615ee.servicebus.windows.net:443/","status":"Activating"}}' + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee","name":"namesp2test4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"South + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namesp2test4eb615ee","createdAt":"2020-09-16T07:11:21.83Z","updatedAt":"2020-09-16T07:11:21.83Z","serviceBusEndpoint":"https://namesp2test4eb615ee.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '775' + - '761' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:13:18 GMT + - Wed, 16 Sep 2020 07:11:23 GMT expires: - '-1' pragma: @@ -62,22 +62,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee?api-version=2017-04-01 response: body: - string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee","name":"namespace2test4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace2test4eb615ee","createdAt":"2020-05-26T08:04:50.59Z","updatedAt":"2020-05-26T08:13:17.113Z","serviceBusEndpoint":"https://namespace2test4eb615ee.servicebus.windows.net:443/","status":"Active"}}' + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee","name":"namesp2test4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"South + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namesp2test4eb615ee","createdAt":"2020-09-16T07:11:21.83Z","updatedAt":"2020-09-16T07:11:21.83Z","serviceBusEndpoint":"https://namesp2test4eb615ee.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '772' + - '761' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:13:49 GMT + - Wed, 16 Sep 2020 07:11:53 GMT expires: - '-1' pragma: @@ -99,37 +99,31 @@ interactions: code: 200 message: OK - request: - body: '{"properties": {"rights": ["Listen", "Send"]}}' + body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive - Content-Length: - - '46' - Content-Type: - - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/authorizationRules/authorizationrule4eb615ee?api-version=2017-04-01 + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee?api-version=2017-04-01 response: body: - string: '{"error":{"message":"Disaster recovery operation in progress. For more - information visit https://aka.ms/eventhubsarmexceptions. CorrelationId: f9731b5e-fe25-48a4-877f-700e61ebf20e","code":"429"}}' + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee","name":"namesp2test4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"South + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namesp2test4eb615ee","createdAt":"2020-09-16T07:11:21.83Z","updatedAt":"2020-09-16T07:12:03.62Z","serviceBusEndpoint":"https://namesp2test4eb615ee.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache - connection: - - close content-length: - - '195' + - '759' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:13:49 GMT + - Wed, 16 Sep 2020 07:12:23 GMT expires: - '-1' pragma: @@ -141,15 +135,18 @@ interactions: - Service-Bus-Resource-Provider/SN1 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' status: - code: 429 - message: '' + code: 200 + message: OK - request: - body: '{"properties": {"rights": ["Listen", "Send"]}}' + body: '{"location": "NorthCentralUS", "tags": {"tag1": "value1", "tag2": "value2"}, + "sku": {"name": "Standard", "tier": "Standard"}}' headers: Accept: - application/json @@ -158,26 +155,120 @@ interactions: Connection: - keep-alive Content-Length: - - '46' + - '125' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/authorizationRules/authorizationrule4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/authorizationRules/authorizationrule4eb615ee","name":"authorizationrule4eb615ee","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"South - Central US","properties":{"rights":["Listen","Send"]}}' + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","name":"namesptest4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"North + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namesptest4eb615ee","createdAt":"2020-09-16T07:12:43.457Z","updatedAt":"2020-09-16T07:12:43.457Z","serviceBusEndpoint":"https://namesptest4eb615ee.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '410' + - '759' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:18:23 GMT + - Wed, 16 Sep 2020 07:12:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/SN1 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/SN1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '48' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","name":"namesptest4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"North + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namesptest4eb615ee","createdAt":"2020-09-16T07:12:43.457Z","updatedAt":"2020-09-16T07:12:43.457Z","serviceBusEndpoint":"https://namesptest4eb615ee.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '759' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 07:13:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/SN1 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/SN1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","name":"namesptest4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"North + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namesptest4eb615ee","createdAt":"2020-09-16T07:12:43.457Z","updatedAt":"2020-09-16T07:13:31.007Z","serviceBusEndpoint":"https://namesptest4eb615ee.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Sep 2020 07:13:45 GMT expires: - '-1' pragma: @@ -195,14 +286,11 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' status: code: 200 message: OK - request: - body: '{"location": "eastus", "tags": {"tag1": "value1", "tag2": "value2"}, "sku": - {"name": "Standard", "tier": "Standard"}}' + body: '{"properties": {"rights": ["Send"]}}' headers: Accept: - application/json @@ -211,26 +299,26 @@ interactions: Connection: - keep-alive Content-Length: - - '117' + - '36' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/authorizationRules/authorizationrule4eb615ee?api-version=2017-04-01 response: body: - string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","name":"namespacetest4eb615ee","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespacetest4eb615ee","createdAt":"2020-05-26T08:06:11.267Z","updatedAt":"2020-05-26T08:14:24.547Z","serviceBusEndpoint":"https://namespacetest4eb615ee.servicebus.windows.net:443/","status":"Active"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/authorizationRules/authorizationrule4eb615ee","name":"authorizationrule4eb615ee","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"South + Central US","properties":{"rights":["Send"]}}' headers: cache-control: - no-cache content-length: - - '760' + - '398' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:18:28 GMT + - Wed, 16 Sep 2020 07:14:07 GMT expires: - '-1' pragma: @@ -248,8 +336,8 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: - - '47' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' status: code: 200 message: OK @@ -267,9 +355,9 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/checkNameAvailability?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/checkNameAvailability?api-version=2017-04-01 response: body: string: '{"nameAvailable":true,"reason":"None"}' @@ -281,7 +369,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:18:29 GMT + - Wed, 16 Sep 2020 07:14:07 GMT expires: - '-1' pragma: @@ -300,12 +388,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK - request: - body: 'b''{"properties": {"partnerNamespace": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee"}}''' + body: 'b''b\''{"properties": {"partnerNamespace": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee"}}\''''' headers: Accept: - application/json @@ -314,25 +402,25 @@ interactions: Connection: - keep-alive Content-Length: - - '230' + - '227' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee","name":"disasterdecoveryconfigtest4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","role":"Primary","type":"MetadataReplication"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee","name":"disasterdecoveryconfig4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","role":"Primary","type":"MetadataReplication"}}' headers: cache-control: - no-cache content-length: - - '670' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:18:29 GMT + - Wed, 16 Sep 2020 07:14:15 GMT expires: - '-1' pragma: @@ -351,7 +439,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -365,21 +453,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee","name":"disasterdecoveryconfigtest4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","role":"Primary","type":"MetadataReplication"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee","name":"disasterdecoveryconfig4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","role":"Primary","type":"MetadataReplication"}}' headers: cache-control: - no-cache content-length: - - '670' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:18:29 GMT + - Wed, 16 Sep 2020 07:14:15 GMT expires: - '-1' pragma: @@ -410,21 +498,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee","name":"disasterdecoveryconfigtest4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","role":"Primary","type":"MetadataReplication"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee","name":"disasterdecoveryconfig4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","role":"Primary","type":"MetadataReplication"}}' headers: cache-control: - no-cache content-length: - - '670' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:18:30 GMT + - Wed, 16 Sep 2020 07:14:15 GMT expires: - '-1' pragma: @@ -455,30 +543,30 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee","name":"disasterdecoveryconfigtest4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","role":"Primary","type":"MetadataReplication"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee","name":"disasterdecoveryconfig4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","role":"Primary","type":"MetadataReplication"}}' headers: cache-control: - no-cache content-length: - - '670' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:19:00 GMT + - Wed, 16 Sep 2020 07:14:47 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -500,21 +588,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee","name":"disasterdecoveryconfigtest4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","role":"Primary","type":"MetadataReplication"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee","name":"disasterdecoveryconfig4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","role":"Primary","type":"MetadataReplication"}}' headers: cache-control: - no-cache content-length: - - '670' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:19:31 GMT + - Wed, 16 Sep 2020 07:15:17 GMT expires: - '-1' pragma: @@ -545,30 +633,30 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee","name":"disasterdecoveryconfigtest4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Succeeded","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee","role":"Primary","type":"MetadataReplication","pendingReplicationOperationsCount":0}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee","name":"disasterdecoveryconfig4eb615ee","type":"Microsoft.EventHub/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Succeeded","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee","role":"Primary","type":"MetadataReplication","pendingReplicationOperationsCount":0}}' headers: cache-control: - no-cache content-length: - - '709' + - '695' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:20:01 GMT + - Wed, 16 Sep 2020 07:15:52 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -590,30 +678,30 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/messagingplan?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/messagingplan?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/messagingplan","name":"2","type":"Microsoft.EventHub/MessagingSKUPlan","location":null,"tags":null,"properties":{"sku":2,"selectedEventHubUnit":1,"updatedAt":"2020-05-26T08:13:09.3491307Z","revision":4}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/messagingplan","name":"2","type":"Microsoft.EventHub/MessagingSKUPlan","location":null,"tags":null,"properties":{"sku":2,"selectedEventHubUnit":1,"updatedAt":"2020-09-16T07:11:22.6816823Z","revision":3}}' headers: cache-control: - no-cache content-length: - - '402' + - '399' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:20:32 GMT + - Wed, 16 Sep 2020 07:16:22 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -635,31 +723,31 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee/authorizationRules/authorizationrule4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee/authorizationRules/authorizationrule4eb615ee?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee/authorizationRules/authorizationrule4eb615ee","name":"authorizationrule4eb615ee","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"South - Central US","properties":{"rights":["Listen","Send"]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee/authorizationRules/authorizationrule4eb615ee","name":"authorizationrule4eb615ee","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"South + Central US","properties":{"rights":["Send"]}}' headers: cache-control: - no-cache content-length: - - '469' + - '453' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:20:32 GMT + - Wed, 16 Sep 2020 07:16:23 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -683,30 +771,30 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee/authorizationRules/authorizationrule4eb615ee/listKeys?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee/authorizationRules/authorizationrule4eb615ee/listKeys?api-version=2017-04-01 response: body: - string: '{"aliasPrimaryConnectionString":"Endpoint=sb://disasterdecoveryconfigtest4eb615ee.servicebus.windows.net/;SharedAccessKeyName=authorizationrule4eb615ee;SharedAccessKey=R/Agz2rpyRCJc/HFusa8QgRXZtuDBv5alQcjHhZmL7I=","aliasSecondaryConnectionString":"Endpoint=sb://disasterdecoveryconfigtest4eb615ee.servicebus.windows.net/;SharedAccessKeyName=authorizationrule4eb615ee;SharedAccessKey=3zdY7fO8pCzB6mfx1GL486S6gUWlD2vob/dyZG+/RjA=","primaryKey":"R/Agz2rpyRCJc/HFusa8QgRXZtuDBv5alQcjHhZmL7I=","secondaryKey":"3zdY7fO8pCzB6mfx1GL486S6gUWlD2vob/dyZG+/RjA=","keyName":"authorizationrule4eb615ee"}' + string: '{"aliasPrimaryConnectionString":"Endpoint=sb://disasterdecoveryconfig4eb615ee.servicebus.windows.net/;SharedAccessKeyName=authorizationrule4eb615ee;SharedAccessKey=l7V9r5Gjbmqlb0Koehg1U4YD4+m8+78aXR//8LFUykI=","aliasSecondaryConnectionString":"Endpoint=sb://disasterdecoveryconfig4eb615ee.servicebus.windows.net/;SharedAccessKeyName=authorizationrule4eb615ee;SharedAccessKey=KL0F9Nriwd6+Uq+HBlUllsVOMj6qXWzOxBNdBfmAjCg=","primaryKey":"l7V9r5Gjbmqlb0Koehg1U4YD4+m8+78aXR//8LFUykI=","secondaryKey":"KL0F9Nriwd6+Uq+HBlUllsVOMj6qXWzOxBNdBfmAjCg=","keyName":"authorizationrule4eb615ee"}' headers: cache-control: - no-cache content-length: - - '589' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:20:33 GMT + - Wed, 16 Sep 2020 07:16:24 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -716,7 +804,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -724,7 +812,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -732,9 +820,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee/breakPairing?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesp2test4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee/breakPairing?api-version=2017-04-01 response: body: string: '' @@ -744,22 +832,22 @@ interactions: content-length: - '0' date: - - Tue, 26 May 2020 08:20:33 GMT + - Wed, 16 Sep 2020 07:16:25 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1197' status: code: 200 message: OK @@ -767,7 +855,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -775,9 +863,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee/failover?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee/failover?api-version=2017-04-01 response: body: string: '' @@ -787,22 +875,22 @@ interactions: content-length: - '0' date: - - Tue, 26 May 2020 08:20:34 GMT + - Wed, 16 Sep 2020 07:16:25 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1196' status: code: 200 message: OK @@ -810,7 +898,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -818,13 +906,13 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: string: '{"error":{"message":"Delete operation is only allowed when primary - namespace does not have secondary namespace. CorrelationId: 94038533-b284-42c0-a67e-7320ba3d1e48","code":"BadRequest"}}' + namespace does not have secondary namespace. CorrelationId: 78c57f58-748c-498c-b96f-b3699c19573d","code":"BadRequest"}}' headers: cache-control: - no-cache @@ -833,16 +921,16 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:20:35 GMT + - Wed, 16 Sep 2020 07:16:26 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: @@ -856,7 +944,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -864,13 +952,13 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: string: '{"error":{"message":"Delete operation is only allowed when primary - namespace does not have secondary namespace. CorrelationId: 3fb38396-e628-483e-9410-0c1dda7c2cb4","code":"BadRequest"}}' + namespace does not have secondary namespace. CorrelationId: 2ebda4fc-0c2d-4958-b974-43a0f03c1116","code":"BadRequest"}}' headers: cache-control: - no-cache @@ -879,16 +967,16 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:21:05 GMT + - Wed, 16 Sep 2020 07:16:56 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: @@ -902,7 +990,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -910,13 +998,13 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: string: '{"error":{"message":"Delete operation is only allowed when primary - namespace does not have secondary namespace. CorrelationId: 4389c697-a29f-45c9-8587-25597f87b239","code":"BadRequest"}}' + namespace does not have secondary namespace. CorrelationId: a5fc17d3-d2c8-46e4-a6af-be620d1adfeb","code":"BadRequest"}}' headers: cache-control: - no-cache @@ -925,16 +1013,16 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 08:21:35 GMT + - Wed, 16 Sep 2020 07:17:26 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: @@ -948,7 +1036,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -956,9 +1044,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacetest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfigtest4eb615ee?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_eventhub_test_disaster_recovery_configs4eb615ee/providers/Microsoft.EventHub/namespaces/namesptest4eb615ee/disasterRecoveryConfigs/disasterdecoveryconfig4eb615ee?api-version=2017-04-01 response: body: string: '' @@ -968,16 +1056,16 @@ interactions: content-length: - '0' date: - - Tue, 26 May 2020 08:22:06 GMT + - Wed, 16 Sep 2020 07:17:58 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: diff --git a/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_eventhub.yaml b/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_eventhub.yaml index 156be4fef7c5..137472abde3d 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_eventhub.yaml +++ b/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub.test_eventhub.yaml @@ -14,11 +14,11 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/10.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda?api-version=2019-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda?api-version=2019-04-01 response: body: string: '' @@ -30,11 +30,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Tue, 19 May 2020 17:44:55 GMT + - Wed, 16 Sep 2020 03:28:35 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/ef1d0535-f4ba-464e-a31b-e6ab3389e647?monitor=true&api-version=2019-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/3d6793c0-2f29-4476-bdd1-2c0aa0ccac9b?monitor=true&api-version=2019-04-01 pragma: - no-cache server: @@ -59,21 +59,21 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/10.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/ef1d0535-f4ba-464e-a31b-e6ab3389e647?monitor=true&api-version=2019-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/3d6793c0-2f29-4476-bdd1-2c0aa0ccac9b?monitor=true&api-version=2019-04-01 response: body: - string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda","name":"storageaccount13130eda","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-05-19T17:44:55.5289057Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-05-19T17:44:55.5289057Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-05-19T17:44:55.4663421Z","primaryEndpoints":{"blob":"https://storageaccount13130eda.blob.core.windows.net/","queue":"https://storageaccount13130eda.queue.core.windows.net/","table":"https://storageaccount13130eda.table.core.windows.net/","file":"https://storageaccount13130eda.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda","name":"storageaccount13130eda","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-09-16T03:28:35.4204338Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-09-16T03:28:35.4204338Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-09-16T03:28:35.3110634Z","primaryEndpoints":{"blob":"https://storageaccount13130eda.blob.core.windows.net/","queue":"https://storageaccount13130eda.queue.core.windows.net/","table":"https://storageaccount13130eda.table.core.windows.net/","file":"https://storageaccount13130eda.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' headers: cache-control: - no-cache content-length: - - '1197' + - '1156' content-type: - application/json date: - - Tue, 19 May 2020 17:45:13 GMT + - Wed, 16 Sep 2020 03:28:53 GMT expires: - '-1' pragma: @@ -109,22 +109,22 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"virtualnetwork13130eda\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda\"\ - ,\r\n \"etag\": \"W/\\\"b62c123b-7dd4-443f-8174-22c7b038a77e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"f92c40bd-34d5-4ee2-9a2c-5730b4e29c3b\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"e9b51bc4-3bd0-43cd-9be7-652b74c35186\",\r\n \"\ + \ \"resourceGuid\": \"75bfcdb2-3ab2-407e-9bf8-8834a85a888e\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"subnet13130eda\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda\"\ - ,\r\n \"etag\": \"W/\\\"b62c123b-7dd4-443f-8174-22c7b038a77e\\\"\"\ + ,\r\n \"etag\": \"W/\\\"f92c40bd-34d5-4ee2-9a2c-5730b4e29c3b\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\"\ : [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \ @@ -136,15 +136,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0db3167e-b2b7-4486-bb34-734d7aef1fc5?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/cc9564ec-fa8d-415a-8a70-0162dfa164a9?api-version=2019-09-01 cache-control: - no-cache content-length: - - '1371' + - '1433' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:45:19 GMT + - Wed, 16 Sep 2020 03:29:01 GMT expires: - '-1' pragma: @@ -157,9 +157,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2df56853-80db-4329-aad9-11a45f6af8a7 + - dafdd5fb-3e73-480c-b49f-98866e4319b8 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1198' status: code: 201 message: Created @@ -174,9 +174,9 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0db3167e-b2b7-4486-bb34-734d7aef1fc5?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/cc9564ec-fa8d-415a-8a70-0162dfa164a9?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -188,7 +188,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:45:23 GMT + - Wed, 16 Sep 2020 03:29:05 GMT expires: - '-1' pragma: @@ -205,7 +205,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b164b98a-1ee7-4bbb-a5b9-f075a18e792b + - 49759dde-699f-41fb-933e-529037c24093 status: code: 200 message: OK @@ -220,20 +220,20 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"virtualnetwork13130eda\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda\"\ - ,\r\n \"etag\": \"W/\\\"2639b727-49d7-480a-ba8c-83460919add9\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"cca1a9d1-c36a-41e5-b123-6b5e0e11bc4f\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"e9b51bc4-3bd0-43cd-9be7-652b74c35186\",\r\n \"\ + \ \"resourceGuid\": \"75bfcdb2-3ab2-407e-9bf8-8834a85a888e\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"subnet13130eda\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda\"\ - ,\r\n \"etag\": \"W/\\\"2639b727-49d7-480a-ba8c-83460919add9\\\"\"\ + ,\r\n \"etag\": \"W/\\\"cca1a9d1-c36a-41e5-b123-6b5e0e11bc4f\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\"\ : [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \ @@ -245,13 +245,13 @@ interactions: cache-control: - no-cache content-length: - - '1373' + - '1435' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:45:23 GMT + - Wed, 16 Sep 2020 03:29:05 GMT etag: - - W/"2639b727-49d7-480a-ba8c-83460919add9" + - W/"cca1a9d1-c36a-41e5-b123-6b5e0e11bc4f" expires: - '-1' pragma: @@ -268,7 +268,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 80315a8c-6c49-47fd-8776-b51a6adec17b + - 26e7bc57-73e8-47a7-8811-c6326e2c9c64 status: code: 200 message: OK @@ -283,15 +283,15 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"subnet13130eda\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda\"\ - ,\r\n \"etag\": \"W/\\\"2639b727-49d7-480a-ba8c-83460919add9\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"cca1a9d1-c36a-41e5-b123-6b5e0e11bc4f\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -300,13 +300,13 @@ interactions: cache-control: - no-cache content-length: - - '586' + - '617' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:45:24 GMT + - Wed, 16 Sep 2020 03:29:06 GMT etag: - - W/"2639b727-49d7-480a-ba8c-83460919add9" + - W/"cca1a9d1-c36a-41e5-b123-6b5e0e11bc4f" expires: - '-1' pragma: @@ -323,7 +323,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fc6dd127-67f6-413c-9fd9-9f6376834e00 + - 8236c6c7-9162-43fe-b9a7-cbf87fa68cc5 status: code: 200 message: OK @@ -342,22 +342,22 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda","name":"namespace13130eda","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-05-19T17:45:28.713Z","updatedAt":"2020-05-19T17:45:28.713Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Activating"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-09-16T03:29:13.98Z","updatedAt":"2020-09-16T03:29:13.98Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '738' + - '767' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:45:29 GMT + - Wed, 16 Sep 2020 03:29:15 GMT expires: - '-1' pragma: @@ -390,22 +390,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda","name":"namespace13130eda","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-05-19T17:45:28.713Z","updatedAt":"2020-05-19T17:45:28.713Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Activating"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-09-16T03:29:13.98Z","updatedAt":"2020-09-16T03:29:13.98Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '738' + - '767' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:45:59 GMT + - Wed, 16 Sep 2020 03:29:46 GMT expires: - '-1' pragma: @@ -436,22 +436,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda","name":"namespace13130eda","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-05-19T17:45:28.713Z","updatedAt":"2020-05-19T17:46:12.687Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Active"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-09-16T03:29:13.98Z","updatedAt":"2020-09-16T03:30:01.053Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache content-length: - - '736' + - '766' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:46:29 GMT + - Wed, 16 Sep 2020 03:30:16 GMT expires: - '-1' pragma: @@ -482,21 +482,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/messagingplan?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/messagingplan","name":"2","type":"Microsoft.EventHub/MessagingSKUPlan","location":null,"tags":null,"properties":{"sku":2,"selectedEventHubUnit":1,"updatedAt":"2020-05-19T17:45:31.7678098Z","revision":3}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/messagingplan","name":"2","type":"Microsoft.EventHub/MessagingSKUPlan","location":null,"tags":null,"properties":{"sku":2,"selectedEventHubUnit":1,"updatedAt":"2020-09-16T03:29:15.6954303Z","revision":1}}' headers: cache-control: - no-cache content-length: - - '380' + - '411' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:46:35 GMT + - Wed, 16 Sep 2020 03:30:17 GMT expires: - '-1' pragma: @@ -518,11 +518,12 @@ interactions: code: 200 message: OK - request: - body: 'b''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, "status": - "Active", "captureDescription": {"enabled": true, "encoding": "Avro", "intervalInSeconds": - 120, "sizeLimitInBytes": 10485763, "destination": {"name": "EventHubArchive.AzureBlockBlob", - "properties": {"storageAccountResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda", - "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}''' + body: 'b''b\''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, + "status": "Active", "captureDescription": {"enabled": true, "encoding": "Avro", + "intervalInSeconds": 120, "sizeLimitInBytes": 10485763, "destination": {"name": + "EventHubArchive.AzureBlockBlob", "properties": {"storageAccountResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda", + "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}\''''' headers: Accept: - application/json @@ -531,26 +532,26 @@ interactions: Connection: - keep-alive Content-Length: - - '625' + - '656' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda","name":"eventhub13130eda","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"South - Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-19T17:46:39.37Z","updatedAt":"2020-05-19T17:46:39.86Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' + Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:30:21.01Z","updatedAt":"2020-09-16T03:30:21.527Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' headers: cache-control: - no-cache content-length: - - '1018' + - '1081' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:46:40 GMT + - Wed, 16 Sep 2020 03:30:21 GMT expires: - '-1' pragma: @@ -574,10 +575,10 @@ interactions: code: 200 message: OK - request: - body: 'b''{"properties": {"defaultAction": "Deny", "virtualNetworkRules": [{"subnet": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda"}, + body: 'b''b\''{"properties": {"defaultAction": "Deny", "virtualNetworkRules": + [{"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork13130eda/subnets/subnet13130eda"}, "ignoreMissingVnetServiceEndpoint": true}], "ipRules": [{"ipMask": "1.1.1.1", - "action": "Allow"}]}}''' + "action": "Allow"}]}}\''''' headers: Accept: - application/json @@ -586,11 +587,11 @@ interactions: Connection: - keep-alive Content-Length: - - '388' + - '419' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/networkRuleSets/default?api-version=2017-04-01 response: @@ -601,11 +602,11 @@ interactions: cache-control: - no-cache content-length: - - '678' + - '740' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:46:58 GMT + - Wed, 16 Sep 2020 03:30:38 GMT expires: - '-1' pragma: @@ -642,7 +643,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/authorizationRules/authorizationrule13130eda?api-version=2017-04-01 response: @@ -653,11 +654,11 @@ interactions: cache-control: - no-cache content-length: - - '388' + - '419' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:05 GMT + - Wed, 16 Sep 2020 03:30:45 GMT expires: - '-1' pragma: @@ -694,23 +695,23 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/consumergroups/consumergroup13130eda?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/consumergroups/consumergroup13130eda","name":"consumergroup13130eda","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South - Central US","properties":{"createdAt":"2020-05-19T17:47:07.0300542Z","updatedAt":"2020-05-19T17:47:07.0300542Z","userMetadata":"New + Central US","properties":{"createdAt":"2020-09-16T03:30:47.6021966Z","updatedAt":"2020-09-16T03:30:47.6021966Z","userMetadata":"New consumergroup"}}' headers: cache-control: - no-cache content-length: - - '503' + - '534' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:06 GMT + - Wed, 16 Sep 2020 03:30:46 GMT expires: - '-1' pragma: @@ -747,7 +748,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/authorizationRules/authorizationrule13130eda?api-version=2017-04-01 response: @@ -758,11 +759,11 @@ interactions: cache-control: - no-cache content-length: - - '425' + - '456' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:07 GMT + - Wed, 16 Sep 2020 03:30:48 GMT expires: - '-1' pragma: @@ -795,7 +796,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/authorizationRules/authorizationrule13130eda?api-version=2017-04-01 response: @@ -806,11 +807,11 @@ interactions: cache-control: - no-cache content-length: - - '388' + - '419' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:08 GMT + - Wed, 16 Sep 2020 03:30:49 GMT expires: - '-1' pragma: @@ -841,7 +842,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/authorizationRules/authorizationrule13130eda?api-version=2017-04-01 response: @@ -852,11 +853,11 @@ interactions: cache-control: - no-cache content-length: - - '425' + - '456' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:08 GMT + - Wed, 16 Sep 2020 03:30:49 GMT expires: - '-1' pragma: @@ -887,23 +888,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/consumergroups/consumergroup13130eda?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/consumergroups/consumergroup13130eda","name":"consumergroup13130eda","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South - Central US","properties":{"createdAt":"2020-05-19T17:47:07.033Z","updatedAt":"2020-05-19T17:47:07.033Z","userMetadata":"New + Central US","properties":{"createdAt":"2020-09-16T03:30:47.622Z","updatedAt":"2020-09-16T03:30:47.622Z","userMetadata":"New consumergroup"}}' headers: cache-control: - no-cache content-length: - - '495' + - '526' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:08 GMT + - Wed, 16 Sep 2020 03:30:50 GMT expires: - '-1' pragma: @@ -934,7 +935,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/networkRuleSets/default?api-version=2017-04-01 response: @@ -945,11 +946,11 @@ interactions: cache-control: - no-cache content-length: - - '678' + - '740' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:09 GMT + - Wed, 16 Sep 2020 03:30:51 GMT expires: - '-1' pragma: @@ -980,22 +981,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda","name":"eventhub13130eda","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"South - Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-19T17:46:39.37","updatedAt":"2020-05-19T17:47:08.227","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' + Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:30:21.01","updatedAt":"2020-09-16T03:30:48.827","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount13130eda","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' headers: cache-control: - no-cache content-length: - - '1017' + - '1079' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:10 GMT + - Wed, 16 Sep 2020 03:30:51 GMT expires: - '-1' pragma: @@ -1026,22 +1027,22 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda","name":"namespace13130eda","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-05-19T17:45:28.713Z","updatedAt":"2020-05-19T17:46:12.687Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Active"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-09-16T03:29:13.98Z","updatedAt":"2020-09-16T03:30:01.053Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache content-length: - - '736' + - '766' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:10 GMT + - Wed, 16 Sep 2020 03:30:51 GMT expires: - '-1' pragma: @@ -1076,12 +1077,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/authorizationRules/authorizationrule13130eda/regenerateKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=Bk4P/2lf43ElugT0yEZtEqLgST0wQ2pKeXb/1Z7rf+8=;EntityPath=eventhub13130eda","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=L9SiAcyy2tSkoWKHRkbzdnirBPgIYpCme9DLtikpMkY=;EntityPath=eventhub13130eda","primaryKey":"Bk4P/2lf43ElugT0yEZtEqLgST0wQ2pKeXb/1Z7rf+8=","secondaryKey":"L9SiAcyy2tSkoWKHRkbzdnirBPgIYpCme9DLtikpMkY=","keyName":"authorizationrule13130eda"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=KmUiElEE9ZN2NDkMXVAiOn8QTMLwXLjhFHKYjmPQKGg=;EntityPath=eventhub13130eda","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=J6drTin5nVTlOMPiyC0EWqcQR5XIXc6VQvl/UPmSvZ4=;EntityPath=eventhub13130eda","primaryKey":"KmUiElEE9ZN2NDkMXVAiOn8QTMLwXLjhFHKYjmPQKGg=","secondaryKey":"J6drTin5nVTlOMPiyC0EWqcQR5XIXc6VQvl/UPmSvZ4=","keyName":"authorizationrule13130eda"}' headers: cache-control: - no-cache @@ -1090,7 +1091,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:11 GMT + - Wed, 16 Sep 2020 03:30:53 GMT expires: - '-1' pragma: @@ -1125,12 +1126,12 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/authorizationRules/authorizationrule13130eda/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=Bk4P/2lf43ElugT0yEZtEqLgST0wQ2pKeXb/1Z7rf+8=;EntityPath=eventhub13130eda","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=L9SiAcyy2tSkoWKHRkbzdnirBPgIYpCme9DLtikpMkY=;EntityPath=eventhub13130eda","primaryKey":"Bk4P/2lf43ElugT0yEZtEqLgST0wQ2pKeXb/1Z7rf+8=","secondaryKey":"L9SiAcyy2tSkoWKHRkbzdnirBPgIYpCme9DLtikpMkY=","keyName":"authorizationrule13130eda"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=KmUiElEE9ZN2NDkMXVAiOn8QTMLwXLjhFHKYjmPQKGg=;EntityPath=eventhub13130eda","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=J6drTin5nVTlOMPiyC0EWqcQR5XIXc6VQvl/UPmSvZ4=;EntityPath=eventhub13130eda","primaryKey":"KmUiElEE9ZN2NDkMXVAiOn8QTMLwXLjhFHKYjmPQKGg=","secondaryKey":"J6drTin5nVTlOMPiyC0EWqcQR5XIXc6VQvl/UPmSvZ4=","keyName":"authorizationrule13130eda"}' headers: cache-control: - no-cache @@ -1139,7 +1140,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:14 GMT + - Wed, 16 Sep 2020 03:30:54 GMT expires: - '-1' pragma: @@ -1176,12 +1177,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/authorizationRules/authorizationrule13130eda/regenerateKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=IJ62sUFH8uhQnMeZeFxOKmE9bunMTjXZYw53gyErDRo=","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=sADfpTVahhkPjSzpUNaKGTZYp2nwaARD6DIOwGXN6L4=","primaryKey":"IJ62sUFH8uhQnMeZeFxOKmE9bunMTjXZYw53gyErDRo=","secondaryKey":"sADfpTVahhkPjSzpUNaKGTZYp2nwaARD6DIOwGXN6L4=","keyName":"authorizationrule13130eda"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=Ttj7CbtNRfJvDUkRTgrwx63wTH9UmFYhz6pARFz3zRM=","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=8Y/d/jMih48rhVIj9WrayqEM0Sx+4iRxvLzHNW1coxM=","primaryKey":"Ttj7CbtNRfJvDUkRTgrwx63wTH9UmFYhz6pARFz3zRM=","secondaryKey":"8Y/d/jMih48rhVIj9WrayqEM0Sx+4iRxvLzHNW1coxM=","keyName":"authorizationrule13130eda"}' headers: cache-control: - no-cache @@ -1190,7 +1191,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:20 GMT + - Wed, 16 Sep 2020 03:31:00 GMT expires: - '-1' pragma: @@ -1225,12 +1226,12 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/authorizationRules/authorizationrule13130eda/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=IJ62sUFH8uhQnMeZeFxOKmE9bunMTjXZYw53gyErDRo=","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=sADfpTVahhkPjSzpUNaKGTZYp2nwaARD6DIOwGXN6L4=","primaryKey":"IJ62sUFH8uhQnMeZeFxOKmE9bunMTjXZYw53gyErDRo=","secondaryKey":"sADfpTVahhkPjSzpUNaKGTZYp2nwaARD6DIOwGXN6L4=","keyName":"authorizationrule13130eda"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=Ttj7CbtNRfJvDUkRTgrwx63wTH9UmFYhz6pARFz3zRM=","secondaryConnectionString":"Endpoint=sb://namespace13130eda.servicebus.windows.net/;SharedAccessKeyName=authorizationrule13130eda;SharedAccessKey=8Y/d/jMih48rhVIj9WrayqEM0Sx+4iRxvLzHNW1coxM=","primaryKey":"Ttj7CbtNRfJvDUkRTgrwx63wTH9UmFYhz6pARFz3zRM=","secondaryKey":"8Y/d/jMih48rhVIj9WrayqEM0Sx+4iRxvLzHNW1coxM=","keyName":"authorizationrule13130eda"}' headers: cache-control: - no-cache @@ -1239,7 +1240,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:21 GMT + - Wed, 16 Sep 2020 03:31:01 GMT expires: - '-1' pragma: @@ -1276,22 +1277,22 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda","name":"namespace13130eda","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag3":"value3","tag4":"value4"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-05-19T17:45:28.713Z","updatedAt":"2020-05-19T17:47:22.743Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Activating"}}' + Central US","tags":{"tag3":"value3","tag4":"value4"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:namespace13130eda","createdAt":"2020-09-16T03:29:13.98Z","updatedAt":"2020-09-16T03:31:02.723Z","serviceBusEndpoint":"https://namespace13130eda.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '739' + - '769' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:24 GMT + - Wed, 16 Sep 2020 03:31:06 GMT expires: - '-1' pragma: @@ -1328,7 +1329,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/checkNameAvailability?api-version=2017-04-01 response: @@ -1342,7 +1343,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 17:47:24 GMT + - Wed, 16 Sep 2020 03:31:07 GMT expires: - '-1' pragma: @@ -1369,7 +1370,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -1377,7 +1378,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/authorizationRules/authorizationrule13130eda?api-version=2017-04-01 response: @@ -1389,7 +1390,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 17:47:25 GMT + - Wed, 16 Sep 2020 03:31:08 GMT expires: - '-1' pragma: @@ -1404,7 +1405,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 200 message: OK @@ -1412,7 +1413,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -1420,7 +1421,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda/consumergroups/consumergroup13130eda?api-version=2017-04-01 response: @@ -1432,7 +1433,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 17:47:27 GMT + - Wed, 16 Sep 2020 03:31:08 GMT expires: - '-1' pragma: @@ -1447,7 +1448,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14998' status: code: 200 message: OK @@ -1455,7 +1456,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -1463,7 +1464,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/authorizationRules/authorizationrule13130eda?api-version=2017-04-01 response: @@ -1475,7 +1476,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 17:47:33 GMT + - Wed, 16 Sep 2020 03:31:15 GMT expires: - '-1' pragma: @@ -1490,7 +1491,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14997' status: code: 200 message: OK @@ -1498,7 +1499,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -1506,7 +1507,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/eventhubs/eventhub13130eda?api-version=2017-04-01 response: @@ -1518,7 +1519,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 17:47:34 GMT + - Wed, 16 Sep 2020 03:31:16 GMT expires: - '-1' pragma: @@ -1533,7 +1534,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14995' + - '14996' status: code: 200 message: OK @@ -1541,7 +1542,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -1549,7 +1550,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda?api-version=2017-04-01 response: @@ -1561,7 +1562,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 17:47:45 GMT + - Wed, 16 Sep 2020 03:31:18 GMT expires: - '-1' location: @@ -1578,7 +1579,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14994' + - '14995' status: code: 202 message: Accepted @@ -1592,7 +1593,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace13130eda/operationresults/namespace13130eda?api-version=2017-04-01 response: @@ -1604,7 +1605,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 17:48:16 GMT + - Wed, 16 Sep 2020 03:31:48 GMT expires: - '-1' pragma: diff --git a/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub_async.test_eventhub.yaml b/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub_async.test_eventhub.yaml index 0f0ac72ef643..c374af4e4cdc 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub_async.test_eventhub.yaml +++ b/sdk/eventhub/azure-mgmt-eventhub/tests/recordings/test_cli_mgmt_eventhub_async.test_eventhub.yaml @@ -30,11 +30,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Tue, 26 May 2020 09:26:40 GMT + - Wed, 16 Sep 2020 03:32:05 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/1dc7a385-4b62-402a-9e54-95351122e05f?monitor=true&api-version=2019-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/5bafcb9e-1204-439c-976d-2ff61b898607?monitor=true&api-version=2019-04-01 pragma: - no-cache server: @@ -61,19 +61,19 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/1dc7a385-4b62-402a-9e54-95351122e05f?monitor=true&api-version=2019-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/5bafcb9e-1204-439c-976d-2ff61b898607?monitor=true&api-version=2019-04-01 response: body: - string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","name":"storageaccount75861157","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-05-26T09:26:39.9369563Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-05-26T09:26:39.9369563Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-05-26T09:26:39.8431994Z","primaryEndpoints":{"blob":"https://storageaccount75861157.blob.core.windows.net/","queue":"https://storageaccount75861157.queue.core.windows.net/","table":"https://storageaccount75861157.table.core.windows.net/","file":"https://storageaccount75861157.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","name":"storageaccount75861157","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-09-16T03:32:06.2490774Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-09-16T03:32:06.2490774Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-09-16T03:32:06.1396628Z","primaryEndpoints":{"blob":"https://storageaccount75861157.blob.core.windows.net/","queue":"https://storageaccount75861157.queue.core.windows.net/","table":"https://storageaccount75861157.table.core.windows.net/","file":"https://storageaccount75861157.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' headers: cache-control: - no-cache content-length: - - '1131' + - '1156' content-type: - application/json date: - - Tue, 26 May 2020 09:26:58 GMT + - Wed, 16 Sep 2020 03:32:24 GMT expires: - '-1' pragma: @@ -117,14 +117,14 @@ interactions: response: body: string: "{\r\n \"name\": \"virtualnetwork75861157\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157\"\ - ,\r\n \"etag\": \"W/\\\"2bc0c762-db3e-466b-8831-2d5fc8b527b1\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"05a7436d-44fb-4b25-ba53-6faf46fecc3d\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"7cae4761-af6d-49d1-97db-5dbda8ce347d\",\r\n \"\ + \ \"resourceGuid\": \"31efd706-4599-41ae-83ab-12ddbf4b8383\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"subnet75861157\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157/subnets/subnet75861157\"\ - ,\r\n \"etag\": \"W/\\\"2bc0c762-db3e-466b-8831-2d5fc8b527b1\\\"\"\ + ,\r\n \"etag\": \"W/\\\"05a7436d-44fb-4b25-ba53-6faf46fecc3d\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\"\ : [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \ @@ -136,15 +136,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7cd351b1-d0ee-4837-829c-f5418506354f?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4384d76a-9a2a-46af-939d-1f341ea6a4b8?api-version=2019-09-01 cache-control: - no-cache content-length: - - '1383' + - '1433' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 09:27:13 GMT + - Wed, 16 Sep 2020 03:32:29 GMT expires: - '-1' pragma: @@ -157,9 +157,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 07e18411-aa70-497a-bef8-18e6f9f552d3 + - ed3d3337-ea14-469d-93c1-a7a6444754a1 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 201 message: Created @@ -176,53 +176,7 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7cd351b1-d0ee-4837-829c-f5418506354f?api-version=2019-09-01 - response: - body: - string: "{\r\n \"status\": \"InProgress\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '30' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 26 May 2020 09:27:17 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 00df9460-0c3a-42d8-bd79-6d10e8c2dd17 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/7cd351b1-d0ee-4837-829c-f5418506354f?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4384d76a-9a2a-46af-939d-1f341ea6a4b8?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -234,7 +188,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 09:27:28 GMT + - Wed, 16 Sep 2020 03:32:35 GMT expires: - '-1' pragma: @@ -251,7 +205,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 61f85ef4-3783-4af3-8eb6-11949c7081bd + - f72d395d-5f51-4095-bdb6-5129d60f4d86 status: code: 200 message: OK @@ -272,14 +226,14 @@ interactions: response: body: string: "{\r\n \"name\": \"virtualnetwork75861157\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157\"\ - ,\r\n \"etag\": \"W/\\\"308ec8a9-641a-4bce-9bd7-be1c44d63d7c\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"6a7919c1-0bd6-49f2-8dc4-dfd1a3c722fe\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"7cae4761-af6d-49d1-97db-5dbda8ce347d\",\r\n \"\ + \ \"resourceGuid\": \"31efd706-4599-41ae-83ab-12ddbf4b8383\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\"\ : \"subnet75861157\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157/subnets/subnet75861157\"\ - ,\r\n \"etag\": \"W/\\\"308ec8a9-641a-4bce-9bd7-be1c44d63d7c\\\"\"\ + ,\r\n \"etag\": \"W/\\\"6a7919c1-0bd6-49f2-8dc4-dfd1a3c722fe\\\"\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\"\ : [],\r\n \"privateEndpointNetworkPolicies\": \"Enabled\",\r\n \ @@ -291,13 +245,13 @@ interactions: cache-control: - no-cache content-length: - - '1385' + - '1435' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 09:27:28 GMT + - Wed, 16 Sep 2020 03:32:35 GMT etag: - - W/"308ec8a9-641a-4bce-9bd7-be1c44d63d7c" + - W/"6a7919c1-0bd6-49f2-8dc4-dfd1a3c722fe" expires: - '-1' pragma: @@ -314,7 +268,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ab496790-f83a-451e-833f-cd69e1e8cc59 + - e8029cd9-73d8-43a4-b286-79ae17c37989 status: code: 200 message: OK @@ -337,7 +291,7 @@ interactions: response: body: string: "{\r\n \"name\": \"subnet75861157\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157/subnets/subnet75861157\"\ - ,\r\n \"etag\": \"W/\\\"308ec8a9-641a-4bce-9bd7-be1c44d63d7c\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"6a7919c1-0bd6-49f2-8dc4-dfd1a3c722fe\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -346,13 +300,13 @@ interactions: cache-control: - no-cache content-length: - - '592' + - '617' content-type: - application/json; charset=utf-8 date: - - Tue, 26 May 2020 09:27:29 GMT + - Wed, 16 Sep 2020 03:32:36 GMT etag: - - W/"308ec8a9-641a-4bce-9bd7-be1c44d63d7c" + - W/"6a7919c1-0bd6-49f2-8dc4-dfd1a3c722fe" expires: - '-1' pragma: @@ -369,7 +323,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b1dd8aad-eb08-4851-bf61-34e6b146c51e + - 7d923e15-fb3c-49e6-a836-3c6afe0828dd status: code: 200 message: OK @@ -384,47 +338,47 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:27:40.367Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Activating"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:32:46.16Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:27:41 GMT + date: Wed, 16 Sep 2020 03:32:47 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: '49' + x-ms-ratelimit-remaining-subscription-resource-requests: '47' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:27:40.367Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Activating"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:32:46.16Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:28:13 GMT + date: Wed, 16 Sep 2020 03:33:18 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 @@ -436,27 +390,27 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:28:24.093Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:33:32.26Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:28:44 GMT + date: Wed, 16 Sep 2020 03:33:49 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -464,28 +418,28 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/messagingplan?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/messagingplan","name":"2","type":"Microsoft.EventHub/MessagingSKUPlan","location":null,"tags":null,"properties":{"sku":2,"selectedEventHubUnit":1,"updatedAt":"2020-05-26T09:27:42.3183966Z","revision":3}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/messagingplan","name":"2","type":"Microsoft.EventHub/MessagingSKUPlan","location":null,"tags":null,"properties":{"sku":2,"selectedEventHubUnit":1,"updatedAt":"2020-09-16T03:32:46.5659797Z","revision":1}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:28:51 GMT + date: Wed, 16 Sep 2020 03:33:49 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -493,60 +447,61 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/messagingplan?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/messagingplan?api-version=2017-04-01 - request: - body: 'b''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, "status": - "Active", "captureDescription": {"enabled": true, "encoding": "Avro", "intervalInSeconds": - 120, "sizeLimitInBytes": 10485763, "destination": {"name": "EventHubArchive.AzureBlockBlob", - "properties": {"storageAccountResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157", - "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}''' + body: 'b''b\''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, + "status": "Active", "captureDescription": {"enabled": true, "encoding": "Avro", + "intervalInSeconds": 120, "sizeLimitInBytes": 10485763, "destination": {"name": + "EventHubArchive.AzureBlockBlob", "properties": {"storageAccountResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157", + "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}\''''' headers: Accept: - application/json Content-Length: - - '631' + - '656' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157","name":"eventhub75861157","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"South - Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-26T09:28:54.57Z","updatedAt":"2020-05-26T09:28:55.22Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' + Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:33:53.07Z","updatedAt":"2020-09-16T03:33:53.37Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:28:54 GMT + date: Wed, 16 Sep 2020 03:33:53 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-writes: '1199' + x-ms-ratelimit-remaining-subscription-writes: '1197' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 - request: - body: 'b''{"properties": {"defaultAction": "Deny", "virtualNetworkRules": [{"subnet": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157/subnets/subnet75861157"}, + body: 'b''b\''{"properties": {"defaultAction": "Deny", "virtualNetworkRules": + [{"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtualnetwork75861157/subnets/subnet75861157"}, "ignoreMissingVnetServiceEndpoint": true}], "ipRules": [{"ipMask": "1.1.1.1", - "action": "Allow"}]}}''' + "action": "Allow"}]}}\''''' headers: Accept: - application/json Content-Length: - - '394' + - '419' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets/default?api-version=2017-04-01 response: @@ -557,20 +512,20 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:18 GMT + date: Wed, 16 Sep 2020 03:34:10 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-writes: '1198' + x-ms-ratelimit-remaining-subscription-writes: '1196' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets/default?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets/default?api-version=2017-04-01 - request: body: '{"properties": {"rights": ["Listen", "Send"]}}' headers: @@ -581,7 +536,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 response: @@ -592,20 +547,20 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:25 GMT + date: Wed, 16 Sep 2020 03:34:17 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-writes: '1197' + x-ms-ratelimit-remaining-subscription-writes: '1195' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 - request: body: '{"properties": {"userMetadata": "New consumergroup"}}' headers: @@ -616,32 +571,32 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157","name":"consumergroup75861157","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South - Central US","properties":{"createdAt":"2020-05-26T09:29:27.1938923Z","updatedAt":"2020-05-26T09:29:27.1938923Z","userMetadata":"New + Central US","properties":{"createdAt":"2020-09-16T03:34:19.4735733Z","updatedAt":"2020-09-16T03:34:19.4735733Z","userMetadata":"New consumergroup"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:27 GMT + date: Wed, 16 Sep 2020 03:34:18 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-writes: '1196' + x-ms-ratelimit-remaining-subscription-writes: '1194' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 - request: body: '{"properties": {"rights": ["Listen", "Send"]}}' headers: @@ -652,7 +607,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 response: @@ -663,27 +618,27 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:28 GMT + date: Wed, 16 Sep 2020 03:34:19 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-writes: '1195' + x-ms-ratelimit-remaining-subscription-writes: '1193' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 response: @@ -694,11 +649,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:29 GMT + date: Wed, 16 Sep 2020 03:34:20 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -706,14 +661,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 response: @@ -724,11 +679,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:29 GMT + date: Wed, 16 Sep 2020 03:34:20 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -736,30 +691,30 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157","name":"consumergroup75861157","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South - Central US","properties":{"createdAt":"2020-05-26T09:29:27.189Z","updatedAt":"2020-05-26T09:29:27.189Z","userMetadata":"New + Central US","properties":{"createdAt":"2020-09-16T03:34:19.482Z","updatedAt":"2020-09-16T03:34:19.482Z","userMetadata":"New consumergroup"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:40 GMT + date: Wed, 16 Sep 2020 03:34:21 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -767,14 +722,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules?api-version=2017-04-01 response: @@ -785,11 +740,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:40 GMT + date: Wed, 16 Sep 2020 03:34:21 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -797,31 +752,31 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups?api-version=2017-04-01 response: body: string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/$Default","name":"$Default","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South - Central US","properties":{"createdAt":"2020-05-26T09:28:54.672Z","updatedAt":"2020-05-26T09:28:54.672Z"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157","name":"consumergroup75861157","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South - Central US","properties":{"createdAt":"2020-05-26T09:29:27.189Z","updatedAt":"2020-05-26T09:29:27.189Z","userMetadata":"New + Central US","properties":{"createdAt":"2020-09-16T03:33:53.122Z","updatedAt":"2020-09-16T03:33:53.122Z"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157","name":"consumergroup75861157","type":"Microsoft.EventHub/Namespaces/EventHubs/ConsumerGroups","location":"South + Central US","properties":{"createdAt":"2020-09-16T03:34:19.478Z","updatedAt":"2020-09-16T03:34:19.478Z","userMetadata":"New consumergroup"}}]}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:40 GMT + date: Wed, 16 Sep 2020 03:34:21 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -830,14 +785,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets/default?api-version=2017-04-01 response: @@ -848,11 +803,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:41 GMT + date: Wed, 16 Sep 2020 03:34:23 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -860,29 +815,29 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets/default?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets/default?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157","name":"eventhub75861157","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"South - Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-26T09:28:54.57","updatedAt":"2020-05-26T09:29:28.17","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' + Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:33:53.07","updatedAt":"2020-09-16T03:34:20.507","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:42 GMT + date: Wed, 16 Sep 2020 03:34:23 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -890,14 +845,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules?api-version=2017-04-01 response: @@ -909,11 +864,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:42 GMT + date: Wed, 16 Sep 2020 03:34:24 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -921,14 +876,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets?api-version=2017-04-01 response: @@ -939,11 +894,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:43 GMT + date: Wed, 16 Sep 2020 03:34:25 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -951,29 +906,29 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/networkRuleSets?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs?api-version=2017-04-01 response: body: string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157","name":"eventhub75861157","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"South - Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-26T09:28:54.57","updatedAt":"2020-05-26T09:29:28.17","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}]}' + Central US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:33:53.07","updatedAt":"2020-09-16T03:34:20.507","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccount75861157","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}]}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:44 GMT + date: Wed, 16 Sep 2020 03:34:26 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -982,29 +937,29 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:28:24.093Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:33:32.26Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:45 GMT + date: Wed, 16 Sep 2020 03:34:26 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1012,29 +967,29 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces?api-version=2017-04-01 response: body: string: '{"value":[{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:28:24.093Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}]}' + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:33:32.26Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}]}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:46 GMT + date: Wed, 16 Sep 2020 03:34:26 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1042,14 +997,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/sku/Basic/regions?api-version=2017-04-01 response: @@ -1142,16 +1097,18 @@ interactions: East","type":"Microsoft.EventHub/sku/Regions","location":null,"tags":null,"properties":{"code":"Norway East","fullName":"Norway East"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/sku/Basic/regions/NorwayWest","name":"Norway West","type":"Microsoft.EventHub/sku/Regions","location":null,"tags":null,"properties":{"code":"Norway - West","fullName":"Norway West"}}],"nextLink":null}' + West","fullName":"Norway West"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/sku/Basic/regions/BrazilSoutheast","name":"Brazil + Southeast","type":"Microsoft.EventHub/sku/Regions","location":null,"tags":null,"properties":{"code":"Brazil + Southeast","fullName":"Brazil Southeast"}}],"nextLink":null}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:48 GMT + date: Wed, 16 Sep 2020 03:34:27 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1166,22 +1123,25 @@ interactions: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/namespaces?api-version=2017-04-01 response: body: - string: '{"value":[{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:28:24.093Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}]}' + string: '{"value":[{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/7vx5onejribdkm3bpke5mddlz57worfeu7edc4sdd5xec2dng2m4hhit6yy7d5u6asotq6vmh6a/providers/Microsoft.EventHub/namespaces/myNamespacexxyyzzykk","name":"myNamespacexxyyzzykk","type":"Microsoft.EventHub/Namespaces","location":"East + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:mynamespacexxyyzzykk","createdAt":"2020-08-18T05:04:57.527Z","updatedAt":"2020-08-18T05:11:09.503Z","serviceBusEndpoint":"https://myNamespacexxyyzzykk.servicebus.windows.net:443/","status":"Active","alternateName":"postmigrationxxxy"}},{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9","name":"namespacexf7e318f9","type":"Microsoft.EventHub/Namespaces","location":"East + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-09-16T03:32:46.977Z","updatedAt":"2020-09-16T03:33:36.487Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_servicebus_namespace_test_migration_configsa9a51771/providers/Microsoft.EventHub/namespaces/myNamespacexxyyzzy","name":"myNamespacexxyyzzy","type":"Microsoft.EventHub/Namespaces","location":"East + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:mynamespacexxyyzzy","createdAt":"2020-08-17T08:07:13.307Z","updatedAt":"2020-08-17T08:27:01.143Z","serviceBusEndpoint":"https://myNamespacexxyyzzy.servicebus.windows.net:443/","status":"Active","alternateName":"postmigrationxxy"}},{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South + Central US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:33:32.26Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Active"}}]}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:48 GMT + date: Wed, 16 Sep 2020 03:34:27 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1196,7 +1156,7 @@ interactions: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/providers/Microsoft.EventHub/operations?api-version=2017-04-01 response: @@ -1253,7 +1213,13 @@ interactions: Authorization Rule (Deprecated)","description":"Updates Namespace Authorization Rule. This API is depricated. Please use a PUT call to update the Namespace Authorization Rule instead.. This operation is not supported on API version - 2017-04-01."},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/eventhubs/write","display":{"provider":"Microsoft + 2017-04-01."},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/schemagroups/write","display":{"provider":"Microsoft + Azure EventHub","resource":"SchemaGroup","operation":"Create or Update SchemaGroup","description":"Create + or Update SchemaGroup properties."},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/schemagroups/read","display":{"provider":"Microsoft + Azure EventHub","resource":"SchemaGroup","operation":"Get SchemaGroup","description":"Get + list of SchemaGroup Resource Descriptions"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/schemagroups/delete","display":{"provider":"Microsoft + Azure EventHub","resource":"SchemaGroup","operation":"Delete SchemaGroup","description":"Operation + to delete SchemaGroup Resource"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/eventhubs/write","display":{"provider":"Microsoft Azure EventHub","resource":"EventHub","operation":"Create or Update EventHub","description":"Create or Update EventHub properties."},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/eventhubs/read","display":{"provider":"Microsoft Azure EventHub","resource":"EventHub","operation":"Get EventHub","description":"Get @@ -1369,8 +1335,8 @@ interactions: utilization for the Event Hub Cluster as a percentage","unit":"Percent","aggregationType":"Maximum","internalMetricName":"Processor\\% Processor Time","resourceIdDimensionNameOverride":"ScaleUnit","sourceMdmAccount":"servicebus","sourceMdmNamespace":"PerformanceCountersV2","availabilities":[{"timeGrain":"PT1M","blobDuration":"P30D"}],"dimensions":[{"name":"Role","toBeExportedForShoebox":true}],"fillGapWithZero":true},{"name":"AvailableMemory","displayName":"Available Memory","displayDescription":"Available memory for the Event Hub Cluster as - a percentage of total memory.","unit":"Percent","aggregationType":"Maximum","internalMetricName":"NodeMemoryUtilization","resourceIdDimensionNameOverride":"ScaleUnit","sourceMdmAccount":"servicebus","sourceMdmNamespace":"OperationQoSMetrics","availabilities":[{"timeGrain":"PT1M","blobDuration":"P30D"}],"dimensions":[{"name":"Role","toBeExportedForShoebox":true}],"fillGapWithZero":true},{"name":"Size","displayName":"Size - of an EventHub in Bytes.","displayDescription":"Size of an EventHub in Bytes.","unit":"Bytes","aggregationType":"Average","internalMetricName":"EntitySize","isDimensionRequired":false,"sourceMdmAccount":"servicebus","sourceMdmNamespace":"OperationQoSMetrics","lockAggregationType":"Total","availabilities":[{"timeGrain":"PT1M","blobDuration":"P30D"}],"dimensions":[{"name":"Role","toBeExportedForShoebox":true}],"supportedAggregationTypes":["Average","Min","Max"],"fillGapWithZero":true}]}},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/providers/Microsoft.Insights/diagnosticSettings/read","display":{"provider":"Microsoft + a percentage of total memory.","unit":"Percent","aggregationType":"Maximum","internalMetricName":"NodeMemoryUtilization","resourceIdDimensionNameOverride":"ScaleUnit","sourceMdmAccount":"servicebus","sourceMdmNamespace":"OperationQoSMetrics","availabilities":[{"timeGrain":"PT1M","blobDuration":"P30D"}],"dimensions":[{"name":"Role","toBeExportedForShoebox":true}],"fillGapWithZero":true},{"name":"Size","displayName":"Size","displayDescription":"Size + of an EventHub in Bytes.","unit":"Bytes","aggregationType":"Average","internalMetricName":"EntitySize","isDimensionRequired":false,"sourceMdmAccount":"servicebus","sourceMdmNamespace":"OperationQoSMetrics","lockAggregationType":"Total","availabilities":[{"timeGrain":"PT1M","blobDuration":"P30D"}],"dimensions":[{"name":"Role","toBeExportedForShoebox":true}],"supportedAggregationTypes":["Average","Min","Max"],"fillGapWithZero":true}]}},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/providers/Microsoft.Insights/diagnosticSettings/read","display":{"provider":"Microsoft Azure EventHub","resource":"Namespace diagnostic settings","operation":"Get Namespace diagnostic settings","description":"Get list of Namespace diagnostic settings Resource Descriptions"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/providers/Microsoft.Insights/diagnosticSettings/write","display":{"provider":"Microsoft @@ -1414,7 +1380,13 @@ interactions: Azure EventHub","resource":"Messages","operation":"Send messages","description":"Send messages"},"isDataAction":true},{"name":"Microsoft.EventHub/namespaces/messages/receive/action","display":{"provider":"Microsoft Azure EventHub","resource":"Messages","operation":"Receive messages","description":"Receive - messages"},"isDataAction":true},{"name":"Microsoft.EventHub/namespaces/removeAcsNamepsace/action","display":{"provider":"Microsoft + messages"},"isDataAction":true},{"name":"Microsoft.EventHub/namespaces/schemas/read","display":{"provider":"Microsoft + Azure EventHub","resource":"Schemas","operation":"Retrieve schemas","description":"Retrieve + schemas"},"isDataAction":true},{"name":"Microsoft.EventHub/namespaces/schemas/write","display":{"provider":"Microsoft + Azure EventHub","resource":"Schemas","operation":"Write schemas","description":"Write + schemas"},"isDataAction":true},{"name":"Microsoft.EventHub/namespaces/schemas/delete","display":{"provider":"Microsoft + Azure EventHub","resource":"Schemas","operation":"Delete schemas","description":"Delete + schemas"},"isDataAction":true},{"name":"Microsoft.EventHub/namespaces/removeAcsNamepsace/action","display":{"provider":"Microsoft Azure EventHub","resource":"Remove ACS namespace","operation":"Remove ACS namespace","description":"Remove ACS namespace"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/ipFilterRules/read","display":{"provider":"Microsoft Azure EventHub","resource":"IPFilter","operation":"Get IP Filter Resource","description":"Get @@ -1466,16 +1438,32 @@ interactions: Connection Proxy"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateEndpointConnectionProxies/delete","display":{"provider":"Microsoft Azure EventHub","resource":"Private Endpoint Connection Proxy","operation":"Delete Private Endpoint Connection Proxy","description":"Delete Private Endpoint - Connection Proxy"},"isDataAction":false}],"nextLink":""}' + Connection Proxy"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateEndpointConnectionProxies/operationstatus/read","display":{"provider":"Microsoft + Azure EventHub","resource":"Non Resource Operation","operation":"Private endpoint + operation status","description":"Get the status of an asynchronous private + endpoint operation"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateEndpointConnections/read","display":{"provider":"Microsoft + Azure EventHub","resource":"Private Endpoint Connection","operation":"Get + Private Endpoint Connection","description":"Get Private Endpoint Connection"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateEndpointConnections/write","display":{"provider":"Microsoft + Azure EventHub","resource":"Private Endpoint Connection","operation":"Create + or Update Private Endpoint Connection","description":"Create or Update Private + Endpoint Connection"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateEndpointConnections/delete","display":{"provider":"Microsoft + Azure EventHub","resource":"Private Endpoint Connection","operation":"Removes + Private Endpoint Connection","description":"Removes Private Endpoint Connection"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateLinkResources/read","display":{"provider":"Microsoft + Azure EventHub","resource":"PrivateLinks","operation":"Gets the resource types + that support private endpoint connections","description":"Gets the resource + types that support private endpoint connections"},"isDataAction":false},{"name":"Microsoft.EventHub/namespaces/privateEndpointConnections/operationstatus/read","display":{"provider":"Microsoft + Azure EventHub","resource":"Non Resource Operation","operation":"Private endpoint + operation status","description":"Get the status of an asynchronous private + endpoint operation"},"isDataAction":false}],"nextLink":""}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:49 GMT + date: Wed, 16 Sep 2020 03:34:27 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1494,21 +1482,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157/regenerateKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=XmddPAoTx1/rCJybpo+XwqTG6cMClocfQJxmvVpA7CA=;EntityPath=eventhub75861157","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=KsEvOfxf25LTaJu2dJ+xD0OYdcESRz8/c+GKMr2yiLU=;EntityPath=eventhub75861157","primaryKey":"XmddPAoTx1/rCJybpo+XwqTG6cMClocfQJxmvVpA7CA=","secondaryKey":"KsEvOfxf25LTaJu2dJ+xD0OYdcESRz8/c+GKMr2yiLU=","keyName":"authorizationrule75861157"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=CZCxHdd79rH8kMfw8TT95OMWzrO0ejsUePsuYIlhbZM=;EntityPath=eventhub75861157","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=r9jrnqiCV0vq7XSyxD7CbCco94X+Vxno26J5Bo75uvw=;EntityPath=eventhub75861157","primaryKey":"CZCxHdd79rH8kMfw8TT95OMWzrO0ejsUePsuYIlhbZM=","secondaryKey":"r9jrnqiCV0vq7XSyxD7CbCco94X+Vxno26J5Bo75uvw=","keyName":"authorizationrule75861157"}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:50 GMT + date: Wed, 16 Sep 2020 03:34:28 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1517,28 +1505,28 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157/regenerateKeys?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157/regenerateKeys?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=XmddPAoTx1/rCJybpo+XwqTG6cMClocfQJxmvVpA7CA=;EntityPath=eventhub75861157","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=KsEvOfxf25LTaJu2dJ+xD0OYdcESRz8/c+GKMr2yiLU=;EntityPath=eventhub75861157","primaryKey":"XmddPAoTx1/rCJybpo+XwqTG6cMClocfQJxmvVpA7CA=","secondaryKey":"KsEvOfxf25LTaJu2dJ+xD0OYdcESRz8/c+GKMr2yiLU=","keyName":"authorizationrule75861157"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=CZCxHdd79rH8kMfw8TT95OMWzrO0ejsUePsuYIlhbZM=;EntityPath=eventhub75861157","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=r9jrnqiCV0vq7XSyxD7CbCco94X+Vxno26J5Bo75uvw=;EntityPath=eventhub75861157","primaryKey":"CZCxHdd79rH8kMfw8TT95OMWzrO0ejsUePsuYIlhbZM=","secondaryKey":"r9jrnqiCV0vq7XSyxD7CbCco94X+Vxno26J5Bo75uvw=","keyName":"authorizationrule75861157"}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:50 GMT + date: Wed, 16 Sep 2020 03:34:28 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1547,7 +1535,7 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157/listKeys?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157/listKeys?api-version=2017-04-01 - request: body: '{"keyType": "PrimaryKey"}' headers: @@ -1558,21 +1546,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157/regenerateKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=ea+qgt5h9AjMeBgjOjR6twCWqh2T8rNgVWxtfkeVZMo=","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=3A0sluHf6h3K8tfPLXzsM3zniumqNBIArWiJBCnkjpo=","primaryKey":"ea+qgt5h9AjMeBgjOjR6twCWqh2T8rNgVWxtfkeVZMo=","secondaryKey":"3A0sluHf6h3K8tfPLXzsM3zniumqNBIArWiJBCnkjpo=","keyName":"authorizationrule75861157"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=KB7Q+5PcOdkx5KlyH98Y7/kFasn8FTWFKK9H6okufGw=","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=ILU4lF4Neqek49ux6cK5B+iVWWmCWMM/rMw8R0dTtFI=","primaryKey":"KB7Q+5PcOdkx5KlyH98Y7/kFasn8FTWFKK9H6okufGw=","secondaryKey":"ILU4lF4Neqek49ux6cK5B+iVWWmCWMM/rMw8R0dTtFI=","keyName":"authorizationrule75861157"}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:56 GMT + date: Wed, 16 Sep 2020 03:34:34 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1581,28 +1569,28 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157/regenerateKeys?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157/regenerateKeys?api-version=2017-04-01 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157/listKeys?api-version=2017-04-01 response: body: - string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=ea+qgt5h9AjMeBgjOjR6twCWqh2T8rNgVWxtfkeVZMo=","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=3A0sluHf6h3K8tfPLXzsM3zniumqNBIArWiJBCnkjpo=","primaryKey":"ea+qgt5h9AjMeBgjOjR6twCWqh2T8rNgVWxtfkeVZMo=","secondaryKey":"3A0sluHf6h3K8tfPLXzsM3zniumqNBIArWiJBCnkjpo=","keyName":"authorizationrule75861157"}' + string: '{"primaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=KB7Q+5PcOdkx5KlyH98Y7/kFasn8FTWFKK9H6okufGw=","secondaryConnectionString":"Endpoint=sb://namespace75861157.servicebus.windows.net/;SharedAccessKeyName=authorizationrule75861157;SharedAccessKey=ILU4lF4Neqek49ux6cK5B+iVWWmCWMM/rMw8R0dTtFI=","primaryKey":"KB7Q+5PcOdkx5KlyH98Y7/kFasn8FTWFKK9H6okufGw=","secondaryKey":"ILU4lF4Neqek49ux6cK5B+iVWWmCWMM/rMw8R0dTtFI=","keyName":"authorizationrule75861157"}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:29:58 GMT + date: Wed, 16 Sep 2020 03:34:35 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1611,7 +1599,7 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157/listKeys?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157/listKeys?api-version=2017-04-01 - request: body: '{"location": "South Central US", "tags": {"tag3": "value3", "tag4": "value4"}}' headers: @@ -1622,31 +1610,31 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157","name":"namespace75861157","type":"Microsoft.EventHub/Namespaces","location":"South - Central US","tags":{"tag3":"value3","tag4":"value4"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-05-26T09:27:40.367Z","updatedAt":"2020-05-26T09:30:00.48Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Activating"}}' + Central US","tags":{"tag3":"value3","tag4":"value4"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:namespace75861157","createdAt":"2020-09-16T03:32:46.16Z","updatedAt":"2020-09-16T03:34:36.993Z","serviceBusEndpoint":"https://namespace75861157.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:30:04 GMT + date: Wed, 16 Sep 2020 03:34:39 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-resource-requests: '49' + x-ms-ratelimit-remaining-subscription-resource-requests: '46' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 - request: body: '{"name": "sdk-DisasterRecovery-9474"}' headers: @@ -1657,7 +1645,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.EventHub/checkNameAvailability?api-version=2017-04-01 response: @@ -1667,11 +1655,11 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Tue, 26 May 2020 09:30:04 GMT + date: Wed, 16 Sep 2020 03:34:40 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains transfer-encoding: chunked vary: Accept-Encoding @@ -1684,8 +1672,10 @@ interactions: - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 response: @@ -1694,23 +1684,25 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Tue, 26 May 2020 09:30:05 GMT + date: Wed, 16 Sep 2020 03:34:40 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-deletes: '14999' + x-ms-ratelimit-remaining-subscription-deletes: '14997' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 response: @@ -1719,23 +1711,25 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Tue, 26 May 2020 09:30:06 GMT + date: Wed, 16 Sep 2020 03:34:41 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-deletes: '14998' + x-ms-ratelimit-remaining-subscription-deletes: '14996' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157/consumergroups/consumergroup75861157?api-version=2017-04-01 - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 response: @@ -1744,23 +1738,25 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Tue, 26 May 2020 09:30:13 GMT + date: Wed, 16 Sep 2020 03:34:47 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-deletes: '14997' + x-ms-ratelimit-remaining-subscription-deletes: '14995' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/authorizationRules/authorizationrule75861157?api-version=2017-04-01 - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 response: @@ -1769,23 +1765,25 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Tue, 26 May 2020 09:30:28 GMT + date: Wed, 16 Sep 2020 03:34:49 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-deletes: '14996' + x-ms-ratelimit-remaining-subscription-deletes: '14994' status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/eventhubs/eventhub75861157?api-version=2017-04-01 - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 response: @@ -1794,24 +1792,24 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Tue, 26 May 2020 09:30:30 GMT + date: Wed, 16 Sep 2020 03:34:50 GMT expires: '-1' location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/operationresults/namespace75861157?api-version=2017-04-01 pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/CH3 + server-sb: Service-Bus-Resource-Provider/SN1 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff - x-ms-ratelimit-remaining-subscription-deletes: '14995' + x-ms-ratelimit-remaining-subscription-deletes: '14993' status: code: 202 message: Accepted - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157?api-version=2017-04-01 - request: body: null headers: User-Agent: - - azsdk-python-azure-mgmt-eventhub/4.0.0b1 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/8.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/operationresults/namespace75861157?api-version=2017-04-01 response: @@ -1820,15 +1818,15 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Tue, 26 May 2020 09:31:04 GMT + date: Wed, 16 Sep 2020 03:35:21 GMT expires: '-1' pragma: no-cache server: Microsoft-HTTPAPI/2.0 - server-sb: Service-Bus-Resource-Provider/SN1 + server-sb: Service-Bus-Resource-Provider/CH3 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespace75861157/operationresults/namespace75861157?api-version=2017-04-01 + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/7wtij4p6f6esljsgpllyyqddjvezv3htie5d5lei4pkcw3o57fo5l5khn2nxdqkwyjbbw5e6y6z/providers/Microsoft.EventHub/namespaces/namespace75861157/operationresults/namespace75861157?api-version=2017-04-01 version: 1 diff --git a/sdk/eventhub/azure-mgmt-eventhub/tests/test_cli_mgmt_eventhub.py b/sdk/eventhub/azure-mgmt-eventhub/tests/test_cli_mgmt_eventhub.py index 3a6ee03609c8..1d28dc901b12 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/tests/test_cli_mgmt_eventhub.py +++ b/sdk/eventhub/azure-mgmt-eventhub/tests/test_cli_mgmt_eventhub.py @@ -33,7 +33,7 @@ # import azure.mgmt.network.models # import azure.mgmt.storage # import azure.mgmt.storage.models -from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer +from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer, RandomNameResourceGroupPreparer AZURE_LOCATION = 'eastus' @@ -303,14 +303,14 @@ def test_eventhub(self, resource_group): result = self.mgmt_client.namespaces.begin_delete(resource_group.name, NAMESPACE_NAME) result = result.result() - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @ResourceGroupPreparer(location=AZURE_LOCATION) def test_disaster_recovery_configs(self, resource_group): RESOURCE_GROUP = resource_group.name SUBSCRIPTION_ID = self.settings.SUBSCRIPTION_ID - NAMESPACE_NAME = self.get_resource_name("namespace2test") - NAMESPACE_NAME_2 = self.get_resource_name("namespacetest") + NAMESPACE_NAME = self.get_resource_name("namesp2test") + NAMESPACE_NAME_2 = self.get_resource_name("namesptest") AUTHORIZATION_RULE_NAME = self.get_resource_name("authorizationrule") - DISASTER_RECOVERY_CONFIG_NAME = self.get_resource_name("disasterdecoveryconfigtest") + DISASTER_RECOVERY_CONFIG_NAME = self.get_resource_name("disasterdecoveryconfig") # NamespaceCreate[put] BODY = { @@ -327,22 +327,13 @@ def test_disaster_recovery_configs(self, resource_group): result = self.mgmt_client.namespaces.begin_create_or_update(resource_group.name, NAMESPACE_NAME, BODY) primery_namespace = result.result() - # NameSpaceAuthorizationRuleCreate[put] - BODY = { - "rights": [ - "Listen", - "Send" - ] - } - result = self.mgmt_client.namespaces.create_or_update_authorization_rule(resource_group.name, NAMESPACE_NAME, AUTHORIZATION_RULE_NAME, BODY) - # Second namespace [put] BODY = { "sku": { "name": "Standard", "tier": "Standard" }, - "location": "eastus", + "location": "NorthCentralUS", "tags": { "tag1": "value1", "tag2": "value2" @@ -351,6 +342,15 @@ def test_disaster_recovery_configs(self, resource_group): result = self.mgmt_client.namespaces.begin_create_or_update(resource_group.name, NAMESPACE_NAME_2, BODY) second_namespace = result.result() + # NameSpaceAuthorizationRuleCreate[put] + BODY = { + "rights": [ + # "Listen", + "Send" + ] + } + result = self.mgmt_client.namespaces.create_or_update_authorization_rule(resource_group.name, NAMESPACE_NAME, AUTHORIZATION_RULE_NAME, BODY) + # DRCCheckNameAvailability[post] BODY = { "name": "sdk-DisasterRecovery-9474"