From f0fc0f2b73b39c4cab1fecbdb3fea8d4df4c9533 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 22 Feb 2021 06:20:06 +0000 Subject: [PATCH] CodeGen from PR 12591 in Azure/azure-rest-api-specs fix readme Configuration Tags for eventhub (#12591) --- .../_event_hub_management_client.py | 1 - .../mgmt/eventhub/v2015_08_01/_metadata.json | 15 +- .../aio/_event_hub_management_client.py | 1 - .../operations/_consumer_groups_operations.py | 18 +- .../aio/operations/_event_hubs_operations.py | 46 ++--- .../aio/operations/_namespaces_operations.py | 80 ++++---- .../v2015_08_01/aio/operations/_operations.py | 8 +- .../operations/_consumer_groups_operations.py | 18 +- .../operations/_event_hubs_operations.py | 46 ++--- .../operations/_namespaces_operations.py | 80 ++++---- .../v2015_08_01/operations/_operations.py | 8 +- .../_event_hub_management_client.py | 1 - .../mgmt/eventhub/v2017_04_01/_metadata.json | 15 +- .../aio/_event_hub_management_client.py | 1 - .../operations/_consumer_groups_operations.py | 26 +-- .../_disaster_recovery_configs_operations.py | 56 +++--- .../aio/operations/_event_hubs_operations.py | 62 +++--- .../aio/operations/_namespaces_operations.py | 132 +++++++------ .../v2017_04_01/aio/operations/_operations.py | 10 +- .../aio/operations/_regions_operations.py | 10 +- .../operations/_consumer_groups_operations.py | 26 +-- .../_disaster_recovery_configs_operations.py | 56 +++--- .../operations/_event_hubs_operations.py | 62 +++--- .../operations/_namespaces_operations.py | 132 +++++++------ .../v2017_04_01/operations/_operations.py | 10 +- .../operations/_regions_operations.py | 10 +- .../v2018_01_01_preview/_configuration.py | 1 + .../_event_hub_management_client.py | 1 - .../v2018_01_01_preview/_metadata.json | 17 +- .../v2018_01_01_preview/aio/_configuration.py | 1 + .../aio/_event_hub_management_client.py | 1 - .../aio/operations/_clusters_operations.py | 82 ++++---- .../operations/_configuration_operations.py | 18 +- .../operations/_consumer_groups_operations.py | 34 ++-- .../_disaster_recovery_configs_operations.py | 76 ++++---- .../aio/operations/_event_hubs_operations.py | 82 ++++---- .../aio/operations/_namespaces_operations.py | 178 ++++++++++-------- .../aio/operations/_operations.py | 12 +- ...private_endpoint_connections_operations.py | 35 ++-- .../_private_link_resources_operations.py | 10 +- .../aio/operations/_regions_operations.py | 12 +- .../operations/_clusters_operations.py | 82 ++++---- .../operations/_configuration_operations.py | 18 +- .../operations/_consumer_groups_operations.py | 34 ++-- .../_disaster_recovery_configs_operations.py | 76 ++++---- .../operations/_event_hubs_operations.py | 82 ++++---- .../operations/_namespaces_operations.py | 178 ++++++++++-------- .../operations/_operations.py | 12 +- ...private_endpoint_connections_operations.py | 35 ++-- .../_private_link_resources_operations.py | 10 +- .../operations/_regions_operations.py | 12 +- 51 files changed, 1075 insertions(+), 954 deletions(-) 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 f35c3cb08d1f8..96d00c6123ce2 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,7 +59,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.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 8af35ccbed59a..3a68f5ffd39d4 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 @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py index 23aa2ba3b02e3..383d1e06419cf 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_event_hub_management_client.py @@ -56,7 +56,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py index 6aa560deaf870..9147adc465347 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_consumer_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ConsumerGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( namespace_name: str, event_hub_name: str, consumer_group_name: str, - parameters: "models.ConsumerGroupCreateOrUpdateParameters", + parameters: "_models.ConsumerGroupCreateOrUpdateParameters", **kwargs - ) -> "models.ConsumerGroupResource": + ) -> "_models.ConsumerGroupResource": """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -67,7 +67,7 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ConsumerGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -183,7 +183,7 @@ async def get( event_hub_name: str, consumer_group_name: str, **kwargs - ) -> "models.ConsumerGroupResource": + ) -> "_models.ConsumerGroupResource": """Gets a description for the specified consumer group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -199,7 +199,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ConsumerGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,7 +248,7 @@ def list_all( namespace_name: str, event_hub_name: str, **kwargs - ) -> AsyncIterable["models.ConsumerGroupListResult"]: + ) -> AsyncIterable["_models.ConsumerGroupListResult"]: """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. @@ -263,7 +263,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.ConsumerGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py index 98ecfba9f9b41..2e4fb4d9ce25c 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_event_hubs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EventHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def list_all( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.EventHubListResult"]: + ) -> AsyncIterable["_models.EventHubListResult"]: """Gets all the Event Hubs in a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -58,7 +58,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.EventHubListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,9 +120,9 @@ async def create_or_update( resource_group_name: str, namespace_name: str, event_hub_name: str, - parameters: "models.EventHubCreateOrUpdateParameters", + parameters: "_models.EventHubCreateOrUpdateParameters", **kwargs - ) -> "models.EventHubResource": + ) -> "_models.EventHubResource": """Creates or updates a new Event Hub as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -138,7 +138,7 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.EventHubResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,7 +248,7 @@ async def get( namespace_name: str, event_hub_name: str, **kwargs - ) -> "models.EventHubResource": + ) -> "_models.EventHubResource": """Gets an Event Hubs description for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -262,7 +262,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.EventHubResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ def list_authorization_rules( namespace_name: str, event_hub_name: str, **kwargs - ) -> AsyncIterable["models.SharedAccessAuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.SharedAccessAuthorizationRuleListResult"]: """Gets the authorization rules for an Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -324,7 +324,7 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -388,9 +388,9 @@ async def create_or_update_authorization_rule( namespace_name: str, event_hub_name: str, authorization_rule_name: str, - parameters: "models.SharedAccessAuthorizationRuleCreateOrUpdateParameters", + parameters: "_models.SharedAccessAuthorizationRuleCreateOrUpdateParameters", **kwargs - ) -> "models.SharedAccessAuthorizationRuleResource": + ) -> "_models.SharedAccessAuthorizationRuleResource": """Creates or updates an AuthorizationRule for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -408,7 +408,7 @@ async def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +463,7 @@ async def get_authorization_rule( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.SharedAccessAuthorizationRuleResource": + ) -> "_models.SharedAccessAuthorizationRuleResource": """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -479,7 +479,7 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,7 +529,7 @@ async def post_authorization_rule( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.SharedAccessAuthorizationRuleResource": + ) -> "_models.SharedAccessAuthorizationRuleResource": """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -545,7 +545,7 @@ async def post_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -656,7 +656,7 @@ async def list_keys( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.ResourceListKeys": + ) -> "_models.ResourceListKeys": """Gets the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -672,7 +672,7 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -721,9 +721,9 @@ async def regenerate_keys( namespace_name: str, event_hub_name: str, authorization_rule_name: str, - parameters: "models.RegenerateKeysParameters", + parameters: "_models.RegenerateKeysParameters", **kwargs - ) -> "models.ResourceListKeys": + ) -> "_models.ResourceListKeys": """Regenerates the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -742,7 +742,7 @@ async def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py index bb87871d572bc..6a3cee1c73d65 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NamespacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, - parameters: "models.CheckNameAvailabilityParameter", + parameters: "_models.CheckNameAvailabilityParameter", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Check the give Namespace name availability. :param parameters: Parameters to check availability of the given Namespace name. @@ -57,7 +57,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,7 +104,7 @@ async def check_name_availability( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.NamespaceListResult"]: + ) -> AsyncIterable["_models.NamespaceListResult"]: """Lists all the available Namespaces within a subscription, irrespective of the resource groups. :keyword callable cls: A custom type or function that will be passed the direct response @@ -112,7 +112,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.NamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -171,7 +171,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.NamespaceListResult"]: + ) -> AsyncIterable["_models.NamespaceListResult"]: """Lists the available Namespaces within a resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -181,7 +181,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.NamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -241,10 +241,10 @@ async def _create_or_update_initial( self, resource_group_name: str, namespace_name: str, - parameters: "models.NamespaceCreateOrUpdateParameters", + parameters: "_models.NamespaceCreateOrUpdateParameters", **kwargs - ) -> Optional["models.NamespaceResource"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.NamespaceResource"]] + ) -> Optional["_models.NamespaceResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NamespaceResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -299,9 +299,9 @@ async def begin_create_or_update( self, resource_group_name: str, namespace_name: str, - parameters: "models.NamespaceCreateOrUpdateParameters", + parameters: "_models.NamespaceCreateOrUpdateParameters", **kwargs - ) -> AsyncLROPoller["models.NamespaceResource"]: + ) -> AsyncLROPoller["_models.NamespaceResource"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -322,7 +322,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -347,7 +347,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -448,7 +454,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -467,7 +479,7 @@ async def get( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.NamespaceResource": + ) -> "_models.NamespaceResource": """Gets the description of the specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -479,7 +491,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.NamespaceResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,9 +540,9 @@ async def update( self, resource_group_name: str, namespace_name: str, - parameters: "models.NamespaceUpdateParameter", + parameters: "_models.NamespaceUpdateParameter", **kwargs - ) -> Optional["models.NamespaceResource"]: + ) -> Optional["_models.NamespaceResource"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -545,7 +557,7 @@ 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[Optional["models.NamespaceResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NamespaceResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -601,7 +613,7 @@ def list_authorization_rules( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.SharedAccessAuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.SharedAccessAuthorizationRuleListResult"]: """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -613,7 +625,7 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -675,9 +687,9 @@ async def create_or_update_authorization_rule( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - parameters: "models.SharedAccessAuthorizationRuleCreateOrUpdateParameters", + parameters: "_models.SharedAccessAuthorizationRuleCreateOrUpdateParameters", **kwargs - ) -> "models.SharedAccessAuthorizationRuleResource": + ) -> "_models.SharedAccessAuthorizationRuleResource": """Creates or updates an AuthorizationRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -693,7 +705,7 @@ async def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +815,7 @@ async def get_authorization_rule( namespace_name: str, authorization_rule_name: str, **kwargs - ) -> "models.SharedAccessAuthorizationRuleResource": + ) -> "_models.SharedAccessAuthorizationRuleResource": """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -817,7 +829,7 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -865,7 +877,7 @@ async def list_keys( namespace_name: str, authorization_rule_name: str, **kwargs - ) -> "models.ResourceListKeys": + ) -> "_models.ResourceListKeys": """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -879,7 +891,7 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -926,9 +938,9 @@ async def regenerate_keys( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - parameters: "models.RegenerateKeysParameters", + parameters: "_models.RegenerateKeysParameters", **kwargs - ) -> "models.ResourceListKeys": + ) -> "_models.ResourceListKeys": """Regenerates the primary or secondary connection strings for the specified Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -944,7 +956,7 @@ async def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py index 0a3183b1deb22..21f6562125923 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Event Hub REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/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 fcc93107b5ac3..07862b1b09259 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ConsumerGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( namespace_name, # type: str event_hub_name, # type: str consumer_group_name, # type: str - parameters, # type: "models.ConsumerGroupCreateOrUpdateParameters" + parameters, # type: "_models.ConsumerGroupCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.ConsumerGroupResource" + # type: (...) -> "_models.ConsumerGroupResource" """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -72,7 +72,7 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ConsumerGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -190,7 +190,7 @@ def get( consumer_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConsumerGroupResource" + # type: (...) -> "_models.ConsumerGroupResource" """Gets a description for the specified consumer group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -206,7 +206,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ConsumerGroupResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,7 +256,7 @@ def list_all( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConsumerGroupListResult"] + # 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. @@ -271,7 +271,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.ConsumerGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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 462cd9ea69234..752999aaf8a0c 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EventHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list_all( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EventHubListResult"] + # type: (...) -> Iterable["_models.EventHubListResult"] """Gets all the Event Hubs in a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -63,7 +63,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.EventHubListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -125,10 +125,10 @@ def create_or_update( resource_group_name, # type: str namespace_name, # type: str event_hub_name, # type: str - parameters, # type: "models.EventHubCreateOrUpdateParameters" + parameters, # type: "_models.EventHubCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.EventHubResource" + # type: (...) -> "_models.EventHubResource" """Creates or updates a new Event Hub as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -144,7 +144,7 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.EventHubResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,7 +256,7 @@ def get( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EventHubResource" + # type: (...) -> "_models.EventHubResource" """Gets an Event Hubs description for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -270,7 +270,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.EventHubResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_authorization_rules( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SharedAccessAuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.SharedAccessAuthorizationRuleListResult"] """Gets the authorization rules for an Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -333,7 +333,7 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -397,10 +397,10 @@ def create_or_update_authorization_rule( namespace_name, # type: str event_hub_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.SharedAccessAuthorizationRuleCreateOrUpdateParameters" + parameters, # type: "_models.SharedAccessAuthorizationRuleCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.SharedAccessAuthorizationRuleResource" + # type: (...) -> "_models.SharedAccessAuthorizationRuleResource" """Creates or updates an AuthorizationRule for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -418,7 +418,7 @@ def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -474,7 +474,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SharedAccessAuthorizationRuleResource" + # type: (...) -> "_models.SharedAccessAuthorizationRuleResource" """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -490,7 +490,7 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +541,7 @@ def post_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SharedAccessAuthorizationRuleResource" + # type: (...) -> "_models.SharedAccessAuthorizationRuleResource" """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -557,7 +557,7 @@ def post_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,7 +670,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceListKeys" + # type: (...) -> "_models.ResourceListKeys" """Gets the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -686,7 +686,7 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -735,10 +735,10 @@ def regenerate_keys( namespace_name, # type: str event_hub_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.RegenerateKeysParameters" + parameters, # type: "_models.RegenerateKeysParameters" **kwargs # type: Any ): - # type: (...) -> "models.ResourceListKeys" + # type: (...) -> "_models.ResourceListKeys" """Regenerates the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -757,7 +757,7 @@ def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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 410e570e7ff58..826a89e6bc0c9 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NamespacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def __init__(self, client, config, serializer, deserializer): def check_name_availability( self, - parameters, # type: "models.CheckNameAvailabilityParameter" + parameters, # type: "_models.CheckNameAvailabilityParameter" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Check the give Namespace name availability. :param parameters: Parameters to check availability of the given Namespace name. @@ -62,7 +62,7 @@ def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.NamespaceListResult"] + # type: (...) -> Iterable["_models.NamespaceListResult"] """Lists all the available Namespaces within a subscription, irrespective of the resource groups. :keyword callable cls: A custom type or function that will be passed the direct response @@ -118,7 +118,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.NamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,7 +178,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NamespaceListResult"] + # type: (...) -> Iterable["_models.NamespaceListResult"] """Lists the available Namespaces within a resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -188,7 +188,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.NamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -248,11 +248,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.NamespaceCreateOrUpdateParameters" + parameters, # type: "_models.NamespaceCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.NamespaceResource"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.NamespaceResource"]] + # type: (...) -> Optional["_models.NamespaceResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NamespaceResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -307,10 +307,10 @@ def begin_create_or_update( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.NamespaceCreateOrUpdateParameters" + parameters, # type: "_models.NamespaceCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.NamespaceResource"] + # type: (...) -> LROPoller["_models.NamespaceResource"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -331,7 +331,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -356,7 +356,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -459,7 +465,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -479,7 +491,7 @@ def get( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NamespaceResource" + # type: (...) -> "_models.NamespaceResource" """Gets the description of the specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -491,7 +503,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.NamespaceResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NamespaceResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamespaceResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,10 +552,10 @@ def update( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.NamespaceUpdateParameter" + parameters, # type: "_models.NamespaceUpdateParameter" **kwargs # type: Any ): - # type: (...) -> Optional["models.NamespaceResource"] + # type: (...) -> Optional["_models.NamespaceResource"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -558,7 +570,7 @@ 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[Optional["models.NamespaceResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NamespaceResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,7 +627,7 @@ def list_authorization_rules( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SharedAccessAuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.SharedAccessAuthorizationRuleListResult"] """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -627,7 +639,7 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -689,10 +701,10 @@ def create_or_update_authorization_rule( resource_group_name, # type: str namespace_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.SharedAccessAuthorizationRuleCreateOrUpdateParameters" + parameters, # type: "_models.SharedAccessAuthorizationRuleCreateOrUpdateParameters" **kwargs # type: Any ): - # type: (...) -> "models.SharedAccessAuthorizationRuleResource" + # type: (...) -> "_models.SharedAccessAuthorizationRuleResource" """Creates or updates an AuthorizationRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -708,7 +720,7 @@ def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -820,7 +832,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SharedAccessAuthorizationRuleResource" + # type: (...) -> "_models.SharedAccessAuthorizationRuleResource" """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -834,7 +846,7 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.SharedAccessAuthorizationRuleResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SharedAccessAuthorizationRuleResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedAccessAuthorizationRuleResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -883,7 +895,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ResourceListKeys" + # type: (...) -> "_models.ResourceListKeys" """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -897,7 +909,7 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -944,10 +956,10 @@ def regenerate_keys( resource_group_name, # type: str namespace_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.RegenerateKeysParameters" + parameters, # type: "_models.RegenerateKeysParameters" **kwargs # type: Any ): - # type: (...) -> "models.ResourceListKeys" + # type: (...) -> "_models.ResourceListKeys" """Regenerates the primary or secondary connection strings for the specified Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -963,7 +975,7 @@ def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2015_08_01.models.ResourceListKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceListKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceListKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } 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 732f4b07a14ea..07e8641d8e05b 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Event Hub REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2015_08_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/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 c60829a72e12a..16d777033ae4e 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,7 +65,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.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 41acda9663f8a..1002caf8b7712 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 @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py index b1bdbb90668f1..4247f8df37977 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_event_hub_management_client.py @@ -62,7 +62,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.namespaces = NamespacesOperations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py index aea2e7a6bdb86..8285ff0fd8506 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_consumer_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ConsumerGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( namespace_name: str, event_hub_name: str, consumer_group_name: str, - parameters: "models.ConsumerGroup", + parameters: "_models.ConsumerGroup", **kwargs - ) -> "models.ConsumerGroup": + ) -> "_models.ConsumerGroup": """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -67,7 +67,7 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -105,7 +105,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -172,7 +172,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -187,7 +187,7 @@ async def get( event_hub_name: str, consumer_group_name: str, **kwargs - ) -> "models.ConsumerGroup": + ) -> "_models.ConsumerGroup": """Gets a description for the specified consumer group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -203,7 +203,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,7 +236,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -255,7 +255,7 @@ def list_by_event_hub( skip: Optional[int] = None, top: Optional[int] = None, **kwargs - ) -> AsyncIterable["models.ConsumerGroupListResult"]: + ) -> AsyncIterable["_models.ConsumerGroupListResult"]: """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. @@ -276,7 +276,7 @@ def list_by_event_hub( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.ConsumerGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -328,7 +328,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py index c0fd5f5516fc8..bffd28ed78b8f 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_disaster_recovery_configs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DisasterRecoveryConfigsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_authorization_rules( namespace_name: str, alias: str, **kwargs - ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -61,7 +61,7 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,7 +109,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -127,7 +127,7 @@ async def get_authorization_rule( alias: str, authorization_rule_name: str, **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -143,7 +143,7 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -176,7 +176,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -194,7 +194,7 @@ async def list_keys( alias: str, authorization_rule_name: str, **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -210,7 +210,7 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,7 +243,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -258,9 +258,9 @@ async def check_name_availability( self, resource_group_name: str, namespace_name: str, - parameters: "models.CheckNameAvailabilityParameter", + parameters: "_models.CheckNameAvailabilityParameter", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Check the give Namespace name availability. :param resource_group_name: Name of the resource group within the azure subscription. @@ -274,7 +274,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -326,7 +326,7 @@ def list( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.ArmDisasterRecoveryListResult"]: + ) -> AsyncIterable["_models.ArmDisasterRecoveryListResult"]: """Gets all Alias(Disaster Recovery configurations). :param resource_group_name: Name of the resource group within the azure subscription. @@ -338,7 +338,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecoveryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecoveryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -385,7 +385,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -401,9 +401,9 @@ async def create_or_update( resource_group_name: str, namespace_name: str, alias: str, - parameters: "models.ArmDisasterRecovery", + parameters: "_models.ArmDisasterRecovery", **kwargs - ) -> Optional["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. @@ -419,7 +419,7 @@ 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[Optional["models.ArmDisasterRecovery"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArmDisasterRecovery"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +456,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -521,7 +521,7 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -535,7 +535,7 @@ async def get( namespace_name: str, alias: str, **kwargs - ) -> "models.ArmDisasterRecovery": + ) -> "_models.ArmDisasterRecovery": """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -549,7 +549,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecovery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecovery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -581,7 +581,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) @@ -645,7 +645,7 @@ async def break_pairing( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -705,7 +705,7 @@ async def fail_over( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py index 28b84ad6402ec..8cca2e7a19c21 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_event_hubs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EventHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_authorization_rules( namespace_name: str, event_hub_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Gets the authorization rules for an Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -61,7 +61,7 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,7 +109,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -126,9 +126,9 @@ async def create_or_update_authorization_rule( namespace_name: str, event_hub_name: str, authorization_rule_name: str, - parameters: "models.AuthorizationRule", + parameters: "_models.AuthorizationRule", **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. @@ -147,7 +147,7 @@ async def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -185,7 +185,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -203,7 +203,7 @@ async def get_authorization_rule( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -219,7 +219,7 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -252,7 +252,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -319,7 +319,7 @@ async def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -334,7 +334,7 @@ async def list_keys( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Gets the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -350,7 +350,7 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +383,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -400,9 +400,9 @@ async def regenerate_keys( namespace_name: str, event_hub_name: str, authorization_rule_name: str, - parameters: "models.RegenerateAccessKeyParameters", + parameters: "_models.RegenerateAccessKeyParameters", **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Regenerates the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -421,7 +421,7 @@ async def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -459,7 +459,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -477,7 +477,7 @@ def list_by_namespace( skip: Optional[int] = None, top: Optional[int] = None, **kwargs - ) -> AsyncIterable["models.EventHubListResult"]: + ) -> AsyncIterable["_models.EventHubListResult"]: """Gets all the Event Hubs in a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -495,7 +495,7 @@ def list_by_namespace( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.EventHubListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,7 +546,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -562,9 +562,9 @@ async def create_or_update( resource_group_name: str, namespace_name: str, event_hub_name: str, - parameters: "models.Eventhub", + parameters: "_models.Eventhub", **kwargs - ) -> "models.Eventhub": + ) -> "_models.Eventhub": """Creates or updates a new Event Hub as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -580,7 +580,7 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -617,7 +617,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_response) @@ -680,7 +680,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -694,7 +694,7 @@ async def get( namespace_name: str, event_hub_name: str, **kwargs - ) -> "models.Eventhub": + ) -> "_models.Eventhub": """Gets an Event Hubs description for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -708,7 +708,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -740,7 +740,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_response) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py index 8662db8019c07..97babc20766dc 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NamespacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list_authorization_rules( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -60,7 +60,7 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -123,9 +123,9 @@ async def create_or_update_authorization_rule( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - parameters: "models.AuthorizationRule", + parameters: "_models.AuthorizationRule", **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Creates or updates an AuthorizationRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -141,7 +141,7 @@ async def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,7 +178,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -241,7 +241,7 @@ async def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -255,7 +255,7 @@ async def get_authorization_rule( namespace_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -269,7 +269,7 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -318,7 +318,7 @@ async def list_keys( namespace_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -332,7 +332,7 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -380,9 +380,9 @@ async def regenerate_keys( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - parameters: "models.RegenerateAccessKeyParameters", + parameters: "_models.RegenerateAccessKeyParameters", **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Regenerates the primary or secondary connection strings for the specified Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -398,7 +398,7 @@ async def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -435,7 +435,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -448,9 +448,9 @@ async def regenerate_keys( async def check_name_availability( self, - parameters: "models.CheckNameAvailabilityParameter", + parameters: "_models.CheckNameAvailabilityParameter", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Check the give Namespace name availability. :param parameters: Parameters to check availability of the given Namespace name. @@ -460,7 +460,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -494,7 +494,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -508,7 +508,7 @@ async def check_name_availability( def list( self, **kwargs - ) -> AsyncIterable["models.EHNamespaceListResult"]: + ) -> AsyncIterable["_models.EHNamespaceListResult"]: """Lists all the available Namespaces within a subscription, irrespective of the resource groups. :keyword callable cls: A custom type or function that will be passed the direct response @@ -516,7 +516,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -561,7 +561,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -576,7 +576,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.EHNamespaceListResult"]: + ) -> AsyncIterable["_models.EHNamespaceListResult"]: """Lists the available Namespaces within a resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -586,7 +586,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +632,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -647,10 +647,10 @@ async def _create_or_update_initial( self, resource_group_name: str, namespace_name: str, - parameters: "models.EHNamespace", + parameters: "_models.EHNamespace", **kwargs - ) -> Optional["models.EHNamespace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + ) -> Optional["_models.EHNamespace"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -686,7 +686,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -706,9 +706,9 @@ async def begin_create_or_update( self, resource_group_name: str, namespace_name: str, - parameters: "models.EHNamespace", + parameters: "_models.EHNamespace", **kwargs - ) -> AsyncLROPoller["models.EHNamespace"]: + ) -> AsyncLROPoller["_models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -729,7 +729,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -754,7 +754,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -805,7 +811,7 @@ async def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -858,7 +864,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -877,7 +889,7 @@ async def get( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.EHNamespace": + ) -> "_models.EHNamespace": """Gets the description of the specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -889,7 +901,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.EHNamespace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -920,7 +932,7 @@ async def get( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -939,9 +951,9 @@ async def update( self, resource_group_name: str, namespace_name: str, - parameters: "models.EHNamespace", + parameters: "_models.EHNamespace", **kwargs - ) -> Optional["models.EHNamespace"]: + ) -> Optional["_models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -956,7 +968,7 @@ 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[Optional["models.EHNamespace"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -992,7 +1004,7 @@ async def update( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1013,7 +1025,7 @@ async def get_messaging_plan( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.MessagingPlan": + ) -> "_models.MessagingPlan": """Gets messaging plan for specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1025,7 +1037,7 @@ async def get_messaging_plan( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.MessagingPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MessagingPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1056,7 +1068,7 @@ async def get_messaging_plan( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MessagingPlan', pipeline_response) @@ -1071,9 +1083,9 @@ async def create_or_update_network_rule_set( self, resource_group_name: str, namespace_name: str, - parameters: "models.NetworkRuleSet", + parameters: "_models.NetworkRuleSet", **kwargs - ) -> "models.NetworkRuleSet": + ) -> "_models.NetworkRuleSet": """Create or update NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1087,7 +1099,7 @@ async def create_or_update_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1123,7 +1135,7 @@ async def create_or_update_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1139,7 +1151,7 @@ async def get_network_rule_set( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.NetworkRuleSet": + ) -> "_models.NetworkRuleSet": """Gets NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1151,7 +1163,7 @@ async def get_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1182,7 +1194,7 @@ async def get_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1198,7 +1210,7 @@ def list_network_rule_sets( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.NetworkRuleSetListResult"]: + ) -> AsyncIterable["_models.NetworkRuleSetListResult"]: """Gets list of NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1210,7 +1222,7 @@ def list_network_rule_sets( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1257,7 +1269,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py index 2f391069c916d..2af3f397d7acd 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Event Hub REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py index 8481c48729d42..350f7ffd2ffee 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_regions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class RegionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_sku( self, sku: str, **kwargs - ) -> AsyncIterable["models.MessagingRegionsListResult"]: + ) -> AsyncIterable["_models.MessagingRegionsListResult"]: """Gets the available Regions for a given sku. :param sku: The sku type. @@ -55,7 +55,7 @@ def list_by_sku( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.MessagingRegionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MessagingRegionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -101,7 +101,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) 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 a245d6cdff267..2be4b3a727d1d 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ConsumerGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( namespace_name, # type: str event_hub_name, # type: str consumer_group_name, # type: str - parameters, # type: "models.ConsumerGroup" + parameters, # type: "_models.ConsumerGroup" **kwargs # type: Any ): - # type: (...) -> "models.ConsumerGroup" + # type: (...) -> "_models.ConsumerGroup" """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -72,7 +72,7 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -178,7 +178,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -194,7 +194,7 @@ def get( consumer_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConsumerGroup" + # type: (...) -> "_models.ConsumerGroup" """Gets a description for the specified consumer group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -210,7 +210,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,7 +243,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -263,7 +263,7 @@ def list_by_event_hub( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConsumerGroupListResult"] + # 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. @@ -284,7 +284,7 @@ def list_by_event_hub( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.ConsumerGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -336,7 +336,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/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 bfab5c3acf797..6abbec500a6f0 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DisasterRecoveryConfigsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_authorization_rules( alias, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -66,7 +66,7 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -133,7 +133,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -149,7 +149,7 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -182,7 +182,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -201,7 +201,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -217,7 +217,7 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -250,7 +250,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -265,10 +265,10 @@ def check_name_availability( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.CheckNameAvailabilityParameter" + parameters, # type: "_models.CheckNameAvailabilityParameter" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Check the give Namespace name availability. :param resource_group_name: Name of the resource group within the azure subscription. @@ -282,7 +282,7 @@ def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -318,7 +318,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -335,7 +335,7 @@ def list( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ArmDisasterRecoveryListResult"] + # type: (...) -> Iterable["_models.ArmDisasterRecoveryListResult"] """Gets all Alias(Disaster Recovery configurations). :param resource_group_name: Name of the resource group within the azure subscription. @@ -347,7 +347,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecoveryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecoveryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -394,7 +394,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -410,10 +410,10 @@ def create_or_update( resource_group_name, # type: str namespace_name, # type: str alias, # type: str - parameters, # type: "models.ArmDisasterRecovery" + parameters, # type: "_models.ArmDisasterRecovery" **kwargs # type: Any ): - # type: (...) -> Optional["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. @@ -429,7 +429,7 @@ 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[Optional["models.ArmDisasterRecovery"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArmDisasterRecovery"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +466,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -532,7 +532,7 @@ def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -547,7 +547,7 @@ def get( alias, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ArmDisasterRecovery" + # type: (...) -> "_models.ArmDisasterRecovery" """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -561,7 +561,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.ArmDisasterRecovery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecovery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,7 +593,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) @@ -658,7 +658,7 @@ def break_pairing( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -719,7 +719,7 @@ def fail_over( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: 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 861bf31dc47d6..1e4322cc585b3 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EventHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_authorization_rules( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] """Gets the authorization rules for an Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -66,7 +66,7 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,7 +114,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -131,10 +131,10 @@ def create_or_update_authorization_rule( namespace_name, # type: str event_hub_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.AuthorizationRule" + parameters, # type: "_models.AuthorizationRule" **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. @@ -153,7 +153,7 @@ def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -191,7 +191,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -210,7 +210,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -226,7 +226,7 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -259,7 +259,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -327,7 +327,7 @@ def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -343,7 +343,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Gets the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -359,7 +359,7 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -392,7 +392,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -409,10 +409,10 @@ def regenerate_keys( namespace_name, # type: str event_hub_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.RegenerateAccessKeyParameters" + parameters, # type: "_models.RegenerateAccessKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Regenerates the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -431,7 +431,7 @@ def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,7 +469,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -488,7 +488,7 @@ def list_by_namespace( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Iterable["models.EventHubListResult"] + # type: (...) -> Iterable["_models.EventHubListResult"] """Gets all the Event Hubs in a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -506,7 +506,7 @@ def list_by_namespace( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.EventHubListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -557,7 +557,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -573,10 +573,10 @@ def create_or_update( resource_group_name, # type: str namespace_name, # type: str event_hub_name, # type: str - parameters, # type: "models.Eventhub" + parameters, # type: "_models.Eventhub" **kwargs # type: Any ): - # type: (...) -> "models.Eventhub" + # type: (...) -> "_models.Eventhub" """Creates or updates a new Event Hub as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -592,7 +592,7 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,7 +629,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_response) @@ -693,7 +693,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -708,7 +708,7 @@ def get( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Eventhub" + # type: (...) -> "_models.Eventhub" """Gets an Event Hubs description for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -722,7 +722,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -754,7 +754,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_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 496ad0d86bf89..411a9a73e4b44 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NamespacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list_authorization_rules( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -65,7 +65,7 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -128,10 +128,10 @@ def create_or_update_authorization_rule( resource_group_name, # type: str namespace_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.AuthorizationRule" + parameters, # type: "_models.AuthorizationRule" **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Creates or updates an AuthorizationRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -147,7 +147,7 @@ def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -248,7 +248,7 @@ def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -263,7 +263,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -277,7 +277,7 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -327,7 +327,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -341,7 +341,7 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -373,7 +373,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -389,10 +389,10 @@ def regenerate_keys( resource_group_name, # type: str namespace_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.RegenerateAccessKeyParameters" + parameters, # type: "_models.RegenerateAccessKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Regenerates the primary or secondary connection strings for the specified Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -408,7 +408,7 @@ def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +445,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -458,10 +458,10 @@ def regenerate_keys( def check_name_availability( self, - parameters, # type: "models.CheckNameAvailabilityParameter" + parameters, # type: "_models.CheckNameAvailabilityParameter" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Check the give Namespace name availability. :param parameters: Parameters to check availability of the given Namespace name. @@ -471,7 +471,7 @@ def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -505,7 +505,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -520,7 +520,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.EHNamespaceListResult"] + # type: (...) -> Iterable["_models.EHNamespaceListResult"] """Lists all the available Namespaces within a subscription, irrespective of the resource groups. :keyword callable cls: A custom type or function that will be passed the direct response @@ -528,7 +528,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -573,7 +573,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -589,7 +589,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EHNamespaceListResult"] + # type: (...) -> Iterable["_models.EHNamespaceListResult"] """Lists the available Namespaces within a resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -599,7 +599,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -645,7 +645,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -660,11 +660,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.EHNamespace" + parameters, # type: "_models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> Optional["models.EHNamespace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + # type: (...) -> Optional["_models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -700,7 +700,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -720,10 +720,10 @@ def begin_create_or_update( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.EHNamespace" + parameters, # type: "_models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EHNamespace"] + # type: (...) -> LROPoller["_models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -744,7 +744,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -769,7 +769,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -821,7 +827,7 @@ def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -875,7 +881,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -895,7 +907,7 @@ def get( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EHNamespace" + # type: (...) -> "_models.EHNamespace" """Gets the description of the specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -907,7 +919,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.EHNamespace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -938,7 +950,7 @@ def get( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -957,10 +969,10 @@ def update( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.EHNamespace" + parameters, # type: "_models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> Optional["models.EHNamespace"] + # type: (...) -> Optional["_models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -975,7 +987,7 @@ 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[Optional["models.EHNamespace"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1011,7 +1023,7 @@ def update( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -1033,7 +1045,7 @@ def get_messaging_plan( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.MessagingPlan" + # type: (...) -> "_models.MessagingPlan" """Gets messaging plan for specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1045,7 +1057,7 @@ def get_messaging_plan( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.MessagingPlan :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingPlan"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MessagingPlan"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1076,7 +1088,7 @@ def get_messaging_plan( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MessagingPlan', pipeline_response) @@ -1091,10 +1103,10 @@ def create_or_update_network_rule_set( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.NetworkRuleSet" + parameters, # type: "_models.NetworkRuleSet" **kwargs # type: Any ): - # type: (...) -> "models.NetworkRuleSet" + # type: (...) -> "_models.NetworkRuleSet" """Create or update NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1108,7 +1120,7 @@ def create_or_update_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1144,7 +1156,7 @@ def create_or_update_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1161,7 +1173,7 @@ def get_network_rule_set( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkRuleSet" + # type: (...) -> "_models.NetworkRuleSet" """Gets NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1173,7 +1185,7 @@ def get_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1204,7 +1216,7 @@ def get_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1221,7 +1233,7 @@ def list_network_rule_sets( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.NetworkRuleSetListResult"] + # type: (...) -> Iterable["_models.NetworkRuleSetListResult"] """Gets list of NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1233,7 +1245,7 @@ def list_network_rule_sets( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.NetworkRuleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1280,7 +1292,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/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 d388cd1dc93c2..10bd33bbbcfb0 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Event Hub REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/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 bd6bb55d9d4c8..3d75220b08552 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class RegionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_sku( sku, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.MessagingRegionsListResult"] + # type: (...) -> Iterable["_models.MessagingRegionsListResult"] """Gets the available Regions for a given sku. :param sku: The sku type. @@ -60,7 +60,7 @@ def list_by_sku( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2017_04_01.models.MessagingRegionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MessagingRegionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) 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 63e76602f3e63..78cc5d1b0649e 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 @@ -47,6 +47,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2018-01-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**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 8103461339928..6664d274ac154 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 @@ -77,7 +77,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.clusters = ClustersOperations( 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 864f6a7fffaa3..3ef0a61c5662b 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 @@ -1,6 +1,6 @@ { "chosen_version": "2018-01-01-preview", - "total_api_version_list": ["2017-04-01", "2018-01-01-preview"], + "total_api_version_list": ["2018-01-01-preview"], "client": { "name": "EventHubManagementClient", "filename": "_event_hub_management_client", @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py index 5c5831a12bf1c..5ca84445a1f4e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py @@ -44,6 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2018-01-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py index b0155a6aeff03..e61adebc5455a 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_event_hub_management_client.py @@ -74,7 +74,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.clusters = ClustersOperations( diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py index 452423dfa432b..232786318953e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_clusters_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ClustersOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list_available_cluster_region( self, **kwargs - ) -> "models.AvailableClustersList": + ) -> "_models.AvailableClustersList": """List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. :keyword callable cls: A custom type or function that will be passed the direct response @@ -54,7 +54,7 @@ async def list_available_cluster_region( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AvailableClustersList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableClustersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableClustersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -83,7 +83,7 @@ async def list_available_cluster_region( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AvailableClustersList', pipeline_response) @@ -98,7 +98,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ClusterListResult"]: + ) -> AsyncIterable["_models.ClusterListResult"]: """Lists the available Event Hubs Clusters within an ARM resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -108,7 +108,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -154,7 +154,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -170,7 +170,7 @@ async def get( resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.Cluster": + ) -> "_models.Cluster": """Gets the resource description of the specified Event Hubs Cluster. :param resource_group_name: Name of the resource group within the azure subscription. @@ -182,7 +182,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,7 +213,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Cluster', pipeline_response) @@ -228,10 +228,10 @@ async def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, - parameters: "models.Cluster", + parameters: "_models.Cluster", **kwargs - ) -> Optional["models.Cluster"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + ) -> Optional["_models.Cluster"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -267,7 +267,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -287,9 +287,9 @@ async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - parameters: "models.Cluster", + parameters: "_models.Cluster", **kwargs - ) -> AsyncLROPoller["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. @@ -309,7 +309,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -334,7 +334,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -352,10 +358,10 @@ async def _update_initial( self, resource_group_name: str, cluster_name: str, - parameters: "models.Cluster", + parameters: "_models.Cluster", **kwargs - ) -> Optional["models.Cluster"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + ) -> Optional["_models.Cluster"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -391,7 +397,7 @@ async def _update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -411,9 +417,9 @@ async def begin_update( self, resource_group_name: str, cluster_name: str, - parameters: "models.Cluster", + parameters: "_models.Cluster", **kwargs - ) -> AsyncLROPoller["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. @@ -433,7 +439,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -458,7 +464,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -509,7 +521,7 @@ async def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -561,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -580,7 +598,7 @@ async def list_namespaces( resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.EHNamespaceIdListResult": + ) -> "_models.EHNamespaceIdListResult": """List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. :param resource_group_name: Name of the resource group within the azure subscription. @@ -592,7 +610,7 @@ async def list_namespaces( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceIdListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceIdListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceIdListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -623,7 +641,7 @@ async def list_namespaces( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EHNamespaceIdListResult', pipeline_response) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py index bf94e76a7818e..fdd4be018877e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_configuration_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class ConfigurationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,9 +44,9 @@ async def patch( self, resource_group_name: str, cluster_name: str, - parameters: "models.ClusterQuotaConfigurationProperties", + parameters: "_models.ClusterQuotaConfigurationProperties", **kwargs - ) -> Optional["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,7 +61,7 @@ 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[Optional["models.ClusterQuotaConfigurationProperties"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterQuotaConfigurationProperties"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def patch( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -118,7 +118,7 @@ async def get( resource_group_name: str, cluster_name: str, **kwargs - ) -> "models.ClusterQuotaConfigurationProperties": + ) -> "_models.ClusterQuotaConfigurationProperties": """Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed on the cluster. @@ -131,7 +131,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterQuotaConfigurationProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterQuotaConfigurationProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterQuotaConfigurationProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -162,7 +162,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py index b03c6f5124933..1d955b4466ddb 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_consumer_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ConsumerGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,9 +47,9 @@ async def create_or_update( namespace_name: str, event_hub_name: str, consumer_group_name: str, - parameters: "models.ConsumerGroup", + parameters: "_models.ConsumerGroup", **kwargs - ) -> "models.ConsumerGroup": + ) -> "_models.ConsumerGroup": """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -67,12 +67,12 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -105,7 +105,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -144,7 +144,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -172,7 +172,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -187,7 +187,7 @@ async def get( event_hub_name: str, consumer_group_name: str, **kwargs - ) -> "models.ConsumerGroup": + ) -> "_models.ConsumerGroup": """Gets a description for the specified consumer group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -203,12 +203,12 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -236,7 +236,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -255,7 +255,7 @@ def list_by_event_hub( skip: Optional[int] = None, top: Optional[int] = None, **kwargs - ) -> AsyncIterable["models.ConsumerGroupListResult"]: + ) -> AsyncIterable["_models.ConsumerGroupListResult"]: """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace. @@ -276,12 +276,12 @@ def list_by_event_hub( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.ConsumerGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -328,7 +328,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py index 8364bd9463630..400664ee13b42 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_disaster_recovery_configs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DisasterRecoveryConfigsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_authorization_rules( namespace_name: str, alias: str, **kwargs - ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -61,12 +61,12 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -109,7 +109,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -127,7 +127,7 @@ async def get_authorization_rule( alias: str, authorization_rule_name: str, **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -143,12 +143,12 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -176,7 +176,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -194,7 +194,7 @@ async def list_keys( alias: str, authorization_rule_name: str, **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -210,12 +210,12 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -243,7 +243,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -258,9 +258,9 @@ async def check_name_availability( self, resource_group_name: str, namespace_name: str, - parameters: "models.CheckNameAvailabilityParameter", + parameters: "_models.CheckNameAvailabilityParameter", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Check the give Namespace name availability. :param resource_group_name: Name of the resource group within the azure subscription. @@ -274,12 +274,12 @@ async def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -310,7 +310,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -326,7 +326,7 @@ def list( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.ArmDisasterRecoveryListResult"]: + ) -> AsyncIterable["_models.ArmDisasterRecoveryListResult"]: """Gets all Alias(Disaster Recovery configurations). :param resource_group_name: Name of the resource group within the azure subscription. @@ -338,12 +338,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.ArmDisasterRecoveryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecoveryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -385,7 +385,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -401,9 +401,9 @@ async def create_or_update( resource_group_name: str, namespace_name: str, alias: str, - parameters: "models.ArmDisasterRecovery", + parameters: "_models.ArmDisasterRecovery", **kwargs - ) -> Optional["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. @@ -419,12 +419,12 @@ 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[Optional["models.ArmDisasterRecovery"]] + 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" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -456,7 +456,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -494,7 +494,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -521,7 +521,7 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -535,7 +535,7 @@ async def get( namespace_name: str, alias: str, **kwargs - ) -> "models.ArmDisasterRecovery": + ) -> "_models.ArmDisasterRecovery": """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -549,12 +549,12 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ArmDisasterRecovery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecovery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -581,7 +581,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) @@ -618,7 +618,7 @@ async def break_pairing( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -645,7 +645,7 @@ async def break_pairing( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -678,7 +678,7 @@ async def fail_over( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -705,7 +705,7 @@ async def fail_over( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py index 795a31a770943..90a27e8b899e8 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_event_hubs_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class EventHubsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_authorization_rules( namespace_name: str, event_hub_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Gets the authorization rules for an Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -61,12 +61,12 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -109,7 +109,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -126,9 +126,9 @@ async def create_or_update_authorization_rule( namespace_name: str, event_hub_name: str, authorization_rule_name: str, - parameters: "models.AuthorizationRule", + parameters: "_models.AuthorizationRule", **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. @@ -147,12 +147,12 @@ async def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -185,7 +185,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -203,7 +203,7 @@ async def get_authorization_rule( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -219,12 +219,12 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -252,7 +252,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -291,7 +291,7 @@ async def delete_authorization_rule( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -319,7 +319,7 @@ async def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -334,7 +334,7 @@ async def list_keys( event_hub_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Gets the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -350,12 +350,12 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -383,7 +383,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -400,9 +400,9 @@ async def regenerate_keys( namespace_name: str, event_hub_name: str, authorization_rule_name: str, - parameters: "models.RegenerateAccessKeyParameters", + parameters: "_models.RegenerateAccessKeyParameters", **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Regenerates the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -421,12 +421,12 @@ async def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -459,7 +459,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -477,7 +477,7 @@ def list_by_namespace( skip: Optional[int] = None, top: Optional[int] = None, **kwargs - ) -> AsyncIterable["models.EventHubListResult"]: + ) -> AsyncIterable["_models.EventHubListResult"]: """Gets all the Event Hubs in a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -495,12 +495,12 @@ def list_by_namespace( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.EventHubListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -546,7 +546,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -562,9 +562,9 @@ async def create_or_update( resource_group_name: str, namespace_name: str, event_hub_name: str, - parameters: "models.Eventhub", + parameters: "_models.Eventhub", **kwargs - ) -> "models.Eventhub": + ) -> "_models.Eventhub": """Creates or updates a new Event Hub as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -580,12 +580,12 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -617,7 +617,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_response) @@ -653,7 +653,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -680,7 +680,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -694,7 +694,7 @@ async def get( namespace_name: str, event_hub_name: str, **kwargs - ) -> "models.Eventhub": + ) -> "_models.Eventhub": """Gets an Event Hubs description for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -708,12 +708,12 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -740,7 +740,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_response) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py index 7b2ffd2f00cc8..0f42f170a5618 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_namespaces_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class NamespacesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list_ip_filter_rules( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.IpFilterRuleListResult"]: + ) -> AsyncIterable["_models.IpFilterRuleListResult"]: """Gets a list of IP Filter rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -60,7 +60,7 @@ def list_ip_filter_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.IpFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -123,9 +123,9 @@ async def create_or_update_ip_filter_rule( resource_group_name: str, namespace_name: str, ip_filter_rule_name: str, - parameters: "models.IpFilterRule", + parameters: "_models.IpFilterRule", **kwargs - ) -> "models.IpFilterRule": + ) -> "_models.IpFilterRule": """Creates or updates an IpFilterRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -141,7 +141,7 @@ async def create_or_update_ip_filter_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.IpFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,7 +178,7 @@ async def create_or_update_ip_filter_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpFilterRule', pipeline_response) @@ -241,7 +241,7 @@ async def delete_ip_filter_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -255,7 +255,7 @@ async def get_ip_filter_rule( namespace_name: str, ip_filter_rule_name: str, **kwargs - ) -> "models.IpFilterRule": + ) -> "_models.IpFilterRule": """Gets an IpFilterRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -269,7 +269,7 @@ async def get_ip_filter_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.IpFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ async def get_ip_filter_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpFilterRule', pipeline_response) @@ -315,7 +315,7 @@ async def get_ip_filter_rule( def list( self, **kwargs - ) -> AsyncIterable["models.EHNamespaceListResult"]: + ) -> AsyncIterable["_models.EHNamespaceListResult"]: """Lists all the available Namespaces within a subscription, irrespective of the resource groups. :keyword callable cls: A custom type or function that will be passed the direct response @@ -323,7 +323,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,7 +368,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -383,7 +383,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.EHNamespaceListResult"]: + ) -> AsyncIterable["_models.EHNamespaceListResult"]: """Lists the available Namespaces within a resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -393,7 +393,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +439,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -454,10 +454,10 @@ async def _create_or_update_initial( self, resource_group_name: str, namespace_name: str, - parameters: "models.EHNamespace", + parameters: "_models.EHNamespace", **kwargs - ) -> Optional["models.EHNamespace"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + ) -> Optional["_models.EHNamespace"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -493,7 +493,7 @@ async def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -513,9 +513,9 @@ async def begin_create_or_update( self, resource_group_name: str, namespace_name: str, - parameters: "models.EHNamespace", + parameters: "_models.EHNamespace", **kwargs - ) -> AsyncLROPoller["models.EHNamespace"]: + ) -> AsyncLROPoller["_models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -536,7 +536,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -561,7 +561,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -612,7 +618,7 @@ async def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -665,7 +671,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -684,7 +696,7 @@ async def get( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.EHNamespace": + ) -> "_models.EHNamespace": """Gets the description of the specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -696,7 +708,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -727,7 +739,7 @@ async def get( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -746,9 +758,9 @@ async def update( self, resource_group_name: str, namespace_name: str, - parameters: "models.EHNamespace", + parameters: "_models.EHNamespace", **kwargs - ) -> Optional["models.EHNamespace"]: + ) -> Optional["_models.EHNamespace"]: """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -763,7 +775,7 @@ 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[Optional["models.EHNamespace"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -799,7 +811,7 @@ async def update( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -820,7 +832,7 @@ def list_virtual_network_rules( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.VirtualNetworkRuleListResult"]: + ) -> AsyncIterable["_models.VirtualNetworkRuleListResult"]: """Gets a list of VirtualNetwork rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -832,7 +844,7 @@ def list_virtual_network_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.VirtualNetworkRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,7 +891,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -895,9 +907,9 @@ async def create_or_update_virtual_network_rule( resource_group_name: str, namespace_name: str, virtual_network_rule_name: str, - parameters: "models.VirtualNetworkRule", + parameters: "_models.VirtualNetworkRule", **kwargs - ) -> "models.VirtualNetworkRule": + ) -> "_models.VirtualNetworkRule": """Creates or updates an VirtualNetworkRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -913,7 +925,7 @@ async def create_or_update_virtual_network_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.VirtualNetworkRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -950,7 +962,7 @@ async def create_or_update_virtual_network_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualNetworkRule', pipeline_response) @@ -1013,7 +1025,7 @@ async def delete_virtual_network_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1027,7 +1039,7 @@ async def get_virtual_network_rule( namespace_name: str, virtual_network_rule_name: str, **kwargs - ) -> "models.VirtualNetworkRule": + ) -> "_models.VirtualNetworkRule": """Gets an VirtualNetworkRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1041,7 +1053,7 @@ async def get_virtual_network_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.VirtualNetworkRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1073,7 +1085,7 @@ async def get_virtual_network_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualNetworkRule', pipeline_response) @@ -1088,9 +1100,9 @@ async def create_or_update_network_rule_set( self, resource_group_name: str, namespace_name: str, - parameters: "models.NetworkRuleSet", + parameters: "_models.NetworkRuleSet", **kwargs - ) -> "models.NetworkRuleSet": + ) -> "_models.NetworkRuleSet": """Create or update NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1104,7 +1116,7 @@ async def create_or_update_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1140,7 +1152,7 @@ async def create_or_update_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1156,7 +1168,7 @@ async def get_network_rule_set( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.NetworkRuleSet": + ) -> "_models.NetworkRuleSet": """Gets NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1168,7 +1180,7 @@ async def get_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1199,7 +1211,7 @@ async def get_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1215,7 +1227,7 @@ def list_authorization_rules( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.AuthorizationRuleListResult"]: + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1227,12 +1239,12 @@ def list_authorization_rules( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1274,7 +1286,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1290,9 +1302,9 @@ async def create_or_update_authorization_rule( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - parameters: "models.AuthorizationRule", + parameters: "_models.AuthorizationRule", **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Creates or updates an AuthorizationRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1308,12 +1320,12 @@ async def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1345,7 +1357,7 @@ async def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -1381,7 +1393,7 @@ async def delete_authorization_rule( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -1408,7 +1420,7 @@ async def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1422,7 +1434,7 @@ async def get_authorization_rule( namespace_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AuthorizationRule": + ) -> "_models.AuthorizationRule": """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1436,12 +1448,12 @@ async def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -1468,7 +1480,7 @@ async def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -1485,7 +1497,7 @@ async def list_keys( namespace_name: str, authorization_rule_name: str, **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1499,12 +1511,12 @@ async def list_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -1531,7 +1543,7 @@ async def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -1547,9 +1559,9 @@ async def regenerate_keys( resource_group_name: str, namespace_name: str, authorization_rule_name: str, - parameters: "models.RegenerateAccessKeyParameters", + parameters: "_models.RegenerateAccessKeyParameters", **kwargs - ) -> "models.AccessKeys": + ) -> "_models.AccessKeys": """Regenerates the primary or secondary connection strings for the specified Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1565,12 +1577,12 @@ async def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1602,7 +1614,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -1615,9 +1627,9 @@ async def regenerate_keys( async def check_name_availability( self, - parameters: "models.CheckNameAvailabilityParameter", + parameters: "_models.CheckNameAvailabilityParameter", **kwargs - ) -> "models.CheckNameAvailabilityResult": + ) -> "_models.CheckNameAvailabilityResult": """Check the give Namespace name availability. :param parameters: Parameters to check availability of the given Namespace name. @@ -1627,12 +1639,12 @@ async def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1661,7 +1673,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py index 622dd8af3513e..0b963899b88b1 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Event Hub REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,12 +52,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/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 index 3092ec9ff1409..4103f2136f5d1 100644 --- 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class PrivateEndpointConnectionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ def list( resource_group_name: str, namespace_name: str, **kwargs - ) -> AsyncIterable["models.PrivateEndpointConnectionListResult"]: + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """Gets the available PrivateEndpointConnections within a namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -60,7 +60,7 @@ def list( :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"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -123,9 +123,9 @@ async def create_or_update( resource_group_name: str, namespace_name: str, private_endpoint_connection_name: str, - parameters: "models.PrivateEndpointConnection", + parameters: "_models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_models.PrivateEndpointConnection": """Creates or updates PrivateEndpointConnections of service namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -142,7 +142,7 @@ async def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -233,7 +233,7 @@ async def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -290,7 +290,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -310,7 +317,7 @@ async def get( namespace_name: str, private_endpoint_connection_name: str, **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> "_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. @@ -324,7 +331,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,7 +363,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) 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 index 67d1f8814294d..606c0759649b0 100644 --- 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 @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class PrivateLinkResourcesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ async def get( resource_group_name: str, namespace_name: str, **kwargs - ) -> "models.PrivateLinkResourcesListResult": + ) -> "_models.PrivateLinkResourcesListResult": """Gets lists of resources that supports Privatelinks. :param resource_group_name: Name of the resource group within the azure subscription. @@ -57,7 +57,7 @@ async def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkResourcesListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourcesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py index 23c81502d8d6e..3a3fe3eb51cdc 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/operations/_regions_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class RegionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list_by_sku( self, sku: str, **kwargs - ) -> AsyncIterable["models.MessagingRegionsListResult"]: + ) -> AsyncIterable["_models.MessagingRegionsListResult"]: """Gets the available Regions for a given sku. :param sku: The sku type. @@ -55,12 +55,12 @@ def list_by_sku( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.MessagingRegionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MessagingRegionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -101,7 +101,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) 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 8ee261ea596e8..400f8294f1207 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ClustersOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list_available_cluster_region( self, **kwargs # type: Any ): - # type: (...) -> "models.AvailableClustersList" + # type: (...) -> "_models.AvailableClustersList" """List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. :keyword callable cls: A custom type or function that will be passed the direct response @@ -59,7 +59,7 @@ def list_available_cluster_region( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AvailableClustersList :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailableClustersList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableClustersList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -88,7 +88,7 @@ def list_available_cluster_region( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AvailableClustersList', pipeline_response) @@ -104,7 +104,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ClusterListResult"] + # type: (...) -> Iterable["_models.ClusterListResult"] """Lists the available Event Hubs Clusters within an ARM resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -114,7 +114,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -160,7 +160,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -177,7 +177,7 @@ def get( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Cluster" + # type: (...) -> "_models.Cluster" """Gets the resource description of the specified Event Hubs Cluster. :param resource_group_name: Name of the resource group within the azure subscription. @@ -189,7 +189,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,7 +220,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Cluster', pipeline_response) @@ -235,11 +235,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str cluster_name, # type: str - parameters, # type: "models.Cluster" + parameters, # type: "_models.Cluster" **kwargs # type: Any ): - # type: (...) -> Optional["models.Cluster"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + # type: (...) -> Optional["_models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,7 +275,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -295,10 +295,10 @@ def begin_create_or_update( self, resource_group_name, # type: str cluster_name, # type: str - parameters, # type: "models.Cluster" + parameters, # type: "_models.Cluster" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Cluster"] + # 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. @@ -318,7 +318,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +343,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -361,11 +367,11 @@ def _update_initial( self, resource_group_name, # type: str cluster_name, # type: str - parameters, # type: "models.Cluster" + parameters, # type: "_models.Cluster" **kwargs # type: Any ): - # type: (...) -> Optional["models.Cluster"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.Cluster"]] + # type: (...) -> Optional["_models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -401,7 +407,7 @@ def _update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -421,10 +427,10 @@ def begin_update( self, resource_group_name, # type: str cluster_name, # type: str - parameters, # type: "models.Cluster" + parameters, # type: "_models.Cluster" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Cluster"] + # 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. @@ -444,7 +450,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -469,7 +475,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -521,7 +533,7 @@ def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -574,7 +586,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,7 +612,7 @@ def list_namespaces( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EHNamespaceIdListResult" + # type: (...) -> "_models.EHNamespaceIdListResult" """List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. :param resource_group_name: Name of the resource group within the azure subscription. @@ -606,7 +624,7 @@ def list_namespaces( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceIdListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceIdListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceIdListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -637,7 +655,7 @@ def list_namespaces( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EHNamespaceIdListResult', pipeline_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 65ea0b5c69916..985d611549f2e 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 @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class ConfigurationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -48,10 +48,10 @@ def patch( self, resource_group_name, # type: str cluster_name, # type: str - parameters, # type: "models.ClusterQuotaConfigurationProperties" + parameters, # type: "_models.ClusterQuotaConfigurationProperties" **kwargs # type: Any ): - # type: (...) -> Optional["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,7 +66,7 @@ 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[Optional["models.ClusterQuotaConfigurationProperties"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterQuotaConfigurationProperties"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def patch( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -124,7 +124,7 @@ def get( cluster_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ClusterQuotaConfigurationProperties" + # type: (...) -> "_models.ClusterQuotaConfigurationProperties" """Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed on the cluster. @@ -137,7 +137,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ClusterQuotaConfigurationProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterQuotaConfigurationProperties"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterQuotaConfigurationProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,7 +168,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_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 06d2e27877dc6..befa5250b6f14 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ConsumerGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,10 +51,10 @@ def create_or_update( namespace_name, # type: str event_hub_name, # type: str consumer_group_name, # type: str - parameters, # type: "models.ConsumerGroup" + parameters, # type: "_models.ConsumerGroup" **kwargs # type: Any ): - # type: (...) -> "models.ConsumerGroup" + # type: (...) -> "_models.ConsumerGroup" """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -72,12 +72,12 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -110,7 +110,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -150,7 +150,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -178,7 +178,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -194,7 +194,7 @@ def get( consumer_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ConsumerGroup" + # type: (...) -> "_models.ConsumerGroup" """Gets a description for the specified consumer group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -210,12 +210,12 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ConsumerGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -243,7 +243,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConsumerGroup', pipeline_response) @@ -263,7 +263,7 @@ def list_by_event_hub( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConsumerGroupListResult"] + # 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. @@ -284,12 +284,12 @@ def list_by_event_hub( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.ConsumerGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -336,7 +336,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/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 3d05c2eff9315..d4d336a9ddf00 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DisasterRecoveryConfigsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_authorization_rules( alias, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -66,12 +66,12 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -114,7 +114,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -133,7 +133,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -149,12 +149,12 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -182,7 +182,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -201,7 +201,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -217,12 +217,12 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -250,7 +250,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -265,10 +265,10 @@ def check_name_availability( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.CheckNameAvailabilityParameter" + parameters, # type: "_models.CheckNameAvailabilityParameter" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Check the give Namespace name availability. :param resource_group_name: Name of the resource group within the azure subscription. @@ -282,12 +282,12 @@ def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -318,7 +318,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) @@ -335,7 +335,7 @@ def list( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ArmDisasterRecoveryListResult"] + # type: (...) -> Iterable["_models.ArmDisasterRecoveryListResult"] """Gets all Alias(Disaster Recovery configurations). :param resource_group_name: Name of the resource group within the azure subscription. @@ -347,12 +347,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.ArmDisasterRecoveryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecoveryListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecoveryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -394,7 +394,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -410,10 +410,10 @@ def create_or_update( resource_group_name, # type: str namespace_name, # type: str alias, # type: str - parameters, # type: "models.ArmDisasterRecovery" + parameters, # type: "_models.ArmDisasterRecovery" **kwargs # type: Any ): - # type: (...) -> Optional["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. @@ -429,12 +429,12 @@ 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[Optional["models.ArmDisasterRecovery"]] + 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" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -466,7 +466,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -505,7 +505,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -532,7 +532,7 @@ def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -547,7 +547,7 @@ def get( alias, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ArmDisasterRecovery" + # type: (...) -> "_models.ArmDisasterRecovery" """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -561,12 +561,12 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.ArmDisasterRecovery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ArmDisasterRecovery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecovery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -593,7 +593,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) @@ -631,7 +631,7 @@ def break_pairing( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -658,7 +658,7 @@ def break_pairing( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -692,7 +692,7 @@ def fail_over( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -719,7 +719,7 @@ def fail_over( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: 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 e5756ae78844d..c9d1a8414e66b 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class EventHubsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_authorization_rules( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] """Gets the authorization rules for an Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -66,12 +66,12 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -114,7 +114,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -131,10 +131,10 @@ def create_or_update_authorization_rule( namespace_name, # type: str event_hub_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.AuthorizationRule" + parameters, # type: "_models.AuthorizationRule" **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. @@ -153,12 +153,12 @@ def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -191,7 +191,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -210,7 +210,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Gets an AuthorizationRule for an Event Hub by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -226,12 +226,12 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -259,7 +259,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -299,7 +299,7 @@ def delete_authorization_rule( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -327,7 +327,7 @@ def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -343,7 +343,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Gets the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -359,12 +359,12 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -392,7 +392,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -409,10 +409,10 @@ def regenerate_keys( namespace_name, # type: str event_hub_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.RegenerateAccessKeyParameters" + parameters, # type: "_models.RegenerateAccessKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Regenerates the ACS and SAS connection strings for the Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -431,12 +431,12 @@ def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -469,7 +469,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -488,7 +488,7 @@ def list_by_namespace( top=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Iterable["models.EventHubListResult"] + # type: (...) -> Iterable["_models.EventHubListResult"] """Gets all the Event Hubs in a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -506,12 +506,12 @@ def list_by_namespace( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.EventHubListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EventHubListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -557,7 +557,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -573,10 +573,10 @@ def create_or_update( resource_group_name, # type: str namespace_name, # type: str event_hub_name, # type: str - parameters, # type: "models.Eventhub" + parameters, # type: "_models.Eventhub" **kwargs # type: Any ): - # type: (...) -> "models.Eventhub" + # type: (...) -> "_models.Eventhub" """Creates or updates a new Event Hub as a nested resource within a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -592,12 +592,12 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -629,7 +629,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_response) @@ -666,7 +666,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -693,7 +693,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -708,7 +708,7 @@ def get( event_hub_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Eventhub" + # type: (...) -> "_models.Eventhub" """Gets an Event Hubs description for the specified Event Hub. :param resource_group_name: Name of the resource group within the azure subscription. @@ -722,12 +722,12 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Eventhub :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Eventhub"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -754,7 +754,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Eventhub', pipeline_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 38dd9027edc23..b044f8c8d9382 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class NamespacesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list_ip_filter_rules( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.IpFilterRuleListResult"] + # type: (...) -> Iterable["_models.IpFilterRuleListResult"] """Gets a list of IP Filter rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -65,7 +65,7 @@ def list_ip_filter_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.IpFilterRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpFilterRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -128,10 +128,10 @@ def create_or_update_ip_filter_rule( resource_group_name, # type: str namespace_name, # type: str ip_filter_rule_name, # type: str - parameters, # type: "models.IpFilterRule" + parameters, # type: "_models.IpFilterRule" **kwargs # type: Any ): - # type: (...) -> "models.IpFilterRule" + # type: (...) -> "_models.IpFilterRule" """Creates or updates an IpFilterRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -147,7 +147,7 @@ def create_or_update_ip_filter_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.IpFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -184,7 +184,7 @@ def create_or_update_ip_filter_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpFilterRule', pipeline_response) @@ -248,7 +248,7 @@ def delete_ip_filter_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -263,7 +263,7 @@ def get_ip_filter_rule( ip_filter_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.IpFilterRule" + # type: (...) -> "_models.IpFilterRule" """Gets an IpFilterRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -277,7 +277,7 @@ def get_ip_filter_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.IpFilterRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.IpFilterRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.IpFilterRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def get_ip_filter_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('IpFilterRule', pipeline_response) @@ -324,7 +324,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.EHNamespaceListResult"] + # type: (...) -> Iterable["_models.EHNamespaceListResult"] """Lists all the available Namespaces within a subscription, irrespective of the resource groups. :keyword callable cls: A custom type or function that will be passed the direct response @@ -332,7 +332,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +377,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -393,7 +393,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.EHNamespaceListResult"] + # type: (...) -> Iterable["_models.EHNamespaceListResult"] """Lists the available Namespaces within a resource group. :param resource_group_name: Name of the resource group within the azure subscription. @@ -403,7 +403,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespaceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespaceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -449,7 +449,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -464,11 +464,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.EHNamespace" + parameters, # type: "_models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> Optional["models.EHNamespace"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.EHNamespace"]] + # type: (...) -> Optional["_models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -504,7 +504,7 @@ def _create_or_update_initial( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -524,10 +524,10 @@ def begin_create_or_update( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.EHNamespace" + parameters, # type: "_models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.EHNamespace"] + # type: (...) -> LROPoller["_models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -548,7 +548,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -573,7 +573,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -625,7 +631,7 @@ def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -679,7 +685,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -699,7 +711,7 @@ def get( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.EHNamespace" + # type: (...) -> "_models.EHNamespace" """Gets the description of the specified namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -711,7 +723,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.EHNamespace :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -742,7 +754,7 @@ def get( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -761,10 +773,10 @@ def update( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.EHNamespace" + parameters, # type: "_models.EHNamespace" **kwargs # type: Any ): - # type: (...) -> Optional["models.EHNamespace"] + # type: (...) -> Optional["_models.EHNamespace"] """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent. @@ -779,7 +791,7 @@ 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[Optional["models.EHNamespace"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +827,7 @@ def update( if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -837,7 +849,7 @@ def list_virtual_network_rules( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualNetworkRuleListResult"] + # type: (...) -> Iterable["_models.VirtualNetworkRuleListResult"] """Gets a list of VirtualNetwork rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -849,7 +861,7 @@ def list_virtual_network_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.VirtualNetworkRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -896,7 +908,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -912,10 +924,10 @@ def create_or_update_virtual_network_rule( resource_group_name, # type: str namespace_name, # type: str virtual_network_rule_name, # type: str - parameters, # type: "models.VirtualNetworkRule" + parameters, # type: "_models.VirtualNetworkRule" **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkRule" + # type: (...) -> "_models.VirtualNetworkRule" """Creates or updates an VirtualNetworkRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -931,7 +943,7 @@ def create_or_update_virtual_network_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.VirtualNetworkRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -968,7 +980,7 @@ def create_or_update_virtual_network_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualNetworkRule', pipeline_response) @@ -1032,7 +1044,7 @@ def delete_virtual_network_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1047,7 +1059,7 @@ def get_virtual_network_rule( virtual_network_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualNetworkRule" + # type: (...) -> "_models.VirtualNetworkRule" """Gets an VirtualNetworkRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1061,7 +1073,7 @@ def get_virtual_network_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.VirtualNetworkRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualNetworkRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1093,7 +1105,7 @@ def get_virtual_network_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('VirtualNetworkRule', pipeline_response) @@ -1108,10 +1120,10 @@ def create_or_update_network_rule_set( self, resource_group_name, # type: str namespace_name, # type: str - parameters, # type: "models.NetworkRuleSet" + parameters, # type: "_models.NetworkRuleSet" **kwargs # type: Any ): - # type: (...) -> "models.NetworkRuleSet" + # type: (...) -> "_models.NetworkRuleSet" """Create or update NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1125,7 +1137,7 @@ def create_or_update_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1161,7 +1173,7 @@ def create_or_update_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1178,7 +1190,7 @@ def get_network_rule_set( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.NetworkRuleSet" + # type: (...) -> "_models.NetworkRuleSet" """Gets NetworkRuleSet for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1190,7 +1202,7 @@ def get_network_rule_set( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.NetworkRuleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.NetworkRuleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1221,7 +1233,7 @@ def get_network_rule_set( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkRuleSet', pipeline_response) @@ -1238,7 +1250,7 @@ def list_authorization_rules( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AuthorizationRuleListResult"] + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] """Gets a list of authorization rules for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1250,12 +1262,12 @@ def list_authorization_rules( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRuleListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1297,7 +1309,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1313,10 +1325,10 @@ def create_or_update_authorization_rule( resource_group_name, # type: str namespace_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.AuthorizationRule" + parameters, # type: "_models.AuthorizationRule" **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Creates or updates an AuthorizationRule for a Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1332,12 +1344,12 @@ def create_or_update_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1369,7 +1381,7 @@ def create_or_update_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -1406,7 +1418,7 @@ def delete_authorization_rule( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -1433,7 +1445,7 @@ def delete_authorization_rule( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1448,7 +1460,7 @@ def get_authorization_rule( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AuthorizationRule" + # type: (...) -> "_models.AuthorizationRule" """Gets an AuthorizationRule for a Namespace by rule name. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1462,12 +1474,12 @@ def get_authorization_rule( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AuthorizationRule :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AuthorizationRule"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -1494,7 +1506,7 @@ def get_authorization_rule( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AuthorizationRule', pipeline_response) @@ -1512,7 +1524,7 @@ def list_keys( authorization_rule_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Gets the primary and secondary connection strings for the Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1526,12 +1538,12 @@ def list_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" # Construct URL @@ -1558,7 +1570,7 @@ def list_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -1574,10 +1586,10 @@ def regenerate_keys( resource_group_name, # type: str namespace_name, # type: str authorization_rule_name, # type: str - parameters, # type: "models.RegenerateAccessKeyParameters" + parameters, # type: "_models.RegenerateAccessKeyParameters" **kwargs # type: Any ): - # type: (...) -> "models.AccessKeys" + # type: (...) -> "_models.AccessKeys" """Regenerates the primary or secondary connection strings for the specified Namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -1593,12 +1605,12 @@ def regenerate_keys( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.AccessKeys :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessKeys"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1630,7 +1642,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccessKeys', pipeline_response) @@ -1643,10 +1655,10 @@ def regenerate_keys( def check_name_availability( self, - parameters, # type: "models.CheckNameAvailabilityParameter" + parameters, # type: "_models.CheckNameAvailabilityParameter" **kwargs # type: Any ): - # type: (...) -> "models.CheckNameAvailabilityResult" + # type: (...) -> "_models.CheckNameAvailabilityResult" """Check the give Namespace name availability. :param parameters: Parameters to check availability of the given Namespace name. @@ -1656,12 +1668,12 @@ def check_name_availability( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.CheckNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1690,7 +1702,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_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 9cb1b808c7697..eb0e2263150f1 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """Lists all of the available Event Hub REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,12 +57,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/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 index b1daf2a1aaf3c..fa276ea782c34 100644 --- 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class PrivateEndpointConnectionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def list( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.PrivateEndpointConnectionListResult"] + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] """Gets the available PrivateEndpointConnections within a namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -65,7 +65,7 @@ def list( :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"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -128,10 +128,10 @@ def create_or_update( resource_group_name, # type: str namespace_name, # type: str private_endpoint_connection_name, # type: str - parameters, # type: "models.PrivateEndpointConnection" + parameters, # type: "_models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # type: (...) -> "_models.PrivateEndpointConnection" """Creates or updates PrivateEndpointConnections of service namespace. :param resource_group_name: Name of the resource group within the azure subscription. @@ -148,7 +148,7 @@ def create_or_update( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -185,7 +185,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -240,7 +240,7 @@ def _delete_initial( 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) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -298,7 +298,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + '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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -319,7 +326,7 @@ def get( private_endpoint_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" + # 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. @@ -333,7 +340,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -365,7 +372,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) 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 index f650a7e0a1a1a..241d0eb40dcfb 100644 --- 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 @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class PrivateLinkResourcesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def get( namespace_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkResourcesListResult" + # type: (...) -> "_models.PrivateLinkResourcesListResult" """Gets lists of resources that supports Privatelinks. :param resource_group_name: Name of the resource group within the azure subscription. @@ -62,7 +62,7 @@ def get( :rtype: ~azure.mgmt.eventhub.v2018_01_01_preview.models.PrivateLinkResourcesListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourcesListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -93,7 +93,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) 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 e0e6252fe5cae..8b317dce57152 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class RegionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list_by_sku( sku, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.MessagingRegionsListResult"] + # type: (...) -> Iterable["_models.MessagingRegionsListResult"] """Gets the available Regions for a given sku. :param sku: The sku type. @@ -60,12 +60,12 @@ def list_by_sku( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2018_01_01_preview.models.MessagingRegionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MessagingRegionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MessagingRegionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-04-01" + api_version = "2018-01-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -106,7 +106,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)