diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/access_keys.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/access_keys.py index 3cd0e415dde1..0fdd0e5a26d8 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/access_keys.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/access_keys.py @@ -61,6 +61,7 @@ class AccessKeys(Model): } def __init__(self): + super(AccessKeys, self).__init__() self.primary_connection_string = None self.secondary_connection_string = None self.alias_primary_connection_string = None diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/capture_description.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/capture_description.py index 6d629cdde793..da1785789d13 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/capture_description.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/capture_description.py @@ -19,7 +19,8 @@ class CaptureDescription(Model): enabled. :type enabled: bool :param encoding: Enumerates the possible values for the encoding format of - capture description. Possible values include: 'Avro', 'AvroDeflate' + capture description. Note: 'AvroDeflate' will be deprecated in New API + Version. Possible values include: 'Avro', 'AvroDeflate' :type encoding: str or ~azure.mgmt.eventhub.models.EncodingCaptureDescription :param interval_in_seconds: The time window allows you to set the @@ -49,6 +50,7 @@ class CaptureDescription(Model): } def __init__(self, enabled=None, encoding=None, interval_in_seconds=None, size_limit_in_bytes=None, destination=None): + super(CaptureDescription, self).__init__() self.enabled = enabled self.encoding = encoding self.interval_in_seconds = interval_in_seconds diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_parameter.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_parameter.py index e633b1016418..6124cebbe87a 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_parameter.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_parameter.py @@ -28,4 +28,5 @@ class CheckNameAvailabilityParameter(Model): } def __init__(self, name): + super(CheckNameAvailabilityParameter, self).__init__() self.name = name diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_result.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_result.py index 9dd4bb1f1092..260054c6c0de 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_result.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/check_name_availability_result.py @@ -41,6 +41,7 @@ class CheckNameAvailabilityResult(Model): } def __init__(self, name_available=None, reason=None): + super(CheckNameAvailabilityResult, self).__init__() self.message = None self.name_available = name_available self.reason = reason diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/destination.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/destination.py index 7bdacd2cb1af..c8a56130103d 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/destination.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/destination.py @@ -37,6 +37,7 @@ class Destination(Model): } def __init__(self, name=None, storage_account_resource_id=None, blob_container=None, archive_name_format=None): + super(Destination, self).__init__() self.name = name self.storage_account_resource_id = storage_account_resource_id self.blob_container = blob_container diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/error_response.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/error_response.py index 5d51f3998615..9ef9abe0298e 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/error_response.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/error_response.py @@ -29,6 +29,7 @@ class ErrorResponse(Model): } def __init__(self, code=None, message=None): + super(ErrorResponse, self).__init__() self.code = code self.message = message diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation.py index c625335b1143..510a144fb91f 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation.py @@ -34,5 +34,6 @@ class Operation(Model): } def __init__(self, display=None): + super(Operation, self).__init__() self.name = None self.display = display diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation_display.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation_display.py index 6d2846dc981b..a4883d9d7e29 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation_display.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/operation_display.py @@ -40,6 +40,7 @@ class OperationDisplay(Model): } def __init__(self): + super(OperationDisplay, self).__init__() self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/regenerate_access_key_parameters.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/regenerate_access_key_parameters.py index 3e526ab736fd..1107c999c8ff 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/regenerate_access_key_parameters.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/regenerate_access_key_parameters.py @@ -34,5 +34,6 @@ class RegenerateAccessKeyParameters(Model): } def __init__(self, key_type, key=None): + super(RegenerateAccessKeyParameters, self).__init__() self.key_type = key_type self.key = key diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/resource.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/resource.py index 74f2f6956a56..97e166307743 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/resource.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/resource.py @@ -39,6 +39,7 @@ class Resource(Model): } def __init__(self): + super(Resource, self).__init__() self.id = None self.name = None self.type = None diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py index 250a2b2ed066..834a51597044 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py @@ -38,6 +38,7 @@ class Sku(Model): } def __init__(self, name, tier=None, capacity=None): + super(Sku, self).__init__() self.name = name self.tier = tier self.capacity = capacity diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/consumer_groups_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/consumer_groups_operations.py index 396c9144be09..30967466801e 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/consumer_groups_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/consumer_groups_operations.py @@ -99,7 +99,7 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -166,7 +166,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -226,7 +226,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -299,7 +299,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/disaster_recovery_configs_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/disaster_recovery_configs_operations.py index 0c84a6938c86..0eb19fb58cdb 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/disaster_recovery_configs_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/disaster_recovery_configs_operations.py @@ -89,7 +89,7 @@ def check_name_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -158,7 +158,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -235,7 +235,7 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -298,7 +298,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -356,7 +356,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -420,7 +420,7 @@ def break_pairing( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -477,7 +477,7 @@ def fail_over( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -542,7 +542,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -610,7 +610,7 @@ def get_authorization_rule( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -677,7 +677,7 @@ def list_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/event_hubs_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/event_hubs_operations.py index af6bdfa3cdda..927049b208ef 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/event_hubs_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/event_hubs_operations.py @@ -89,7 +89,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -162,7 +162,7 @@ def create_or_update( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -225,7 +225,7 @@ def delete( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -282,7 +282,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -354,7 +354,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -430,7 +430,7 @@ def create_or_update_authorization_rule( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -497,7 +497,7 @@ def get_authorization_rule( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -563,7 +563,7 @@ def delete_authorization_rule( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -623,7 +623,7 @@ def list_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -702,7 +702,7 @@ def regenerate_keys( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/namespaces_operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/namespaces_operations.py index d5e64af2acbb..df63d6d2901c 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/namespaces_operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/namespaces_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -83,7 +84,7 @@ def check_name_availability( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -146,7 +147,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -213,7 +214,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -230,29 +231,9 @@ def internal_paging(next_link=None, raw=False): return deserialized - def create_or_update( - self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a namespace. Once created, this namespace's resource - manifest is immutable. This operation is idempotent. - :param resource_group_name: Name of the resource group within the - azure subscription. - :type resource_group_name: str - :param namespace_name: The Namespace name - :type namespace_name: str - :param parameters: Parameters for creating a namespace resource. - :type parameters: ~azure.mgmt.eventhub.models.EHNamespace - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns EHNamespace - or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventhub.models.EHNamespace] - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ + def _create_or_update_initial( + self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}' path_format_arguments = { @@ -280,31 +261,80 @@ def create_or_update( body_content = self._serialize.body(parameters, 'EHNamespace') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EHNamespace', response) + if response.status_code == 201: + deserialized = self._deserialize('EHNamespace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a namespace. Once created, this namespace's resource + manifest is immutable. This operation is idempotent. + + :param resource_group_name: Name of the resource group within the + azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name + :type namespace_name: str + :param parameters: Parameters for creating a namespace resource. + :type parameters: ~azure.mgmt.eventhub.models.EHNamespace + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns EHNamespace + or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventhub.models.EHNamespace] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): if response.status_code not in [200, 201, 202]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('EHNamespace', response) - if response.status_code == 201: - deserialized = self._deserialize('EHNamespace', response) + deserialized = self._deserialize('EHNamespace', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -312,10 +342,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -323,26 +349,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): - """Deletes an existing namespace. This operation also removes all - associated resources under the namespace. - :param resource_group_name: Name of the resource group within the - azure subscription. - :type resource_group_name: str - :param namespace_name: The Namespace name - :type namespace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ + def _delete_initial( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}' path_format_arguments = { @@ -367,18 +376,59 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing namespace. This operation also removes all + associated resources under the namespace. + + :param resource_group_name: Name of the resource group within the + azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name + :type namespace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -389,10 +439,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -445,7 +491,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorResponseException(self._deserialize, response) @@ -515,7 +561,7 @@ def update( # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: raise models.ErrorResponseException(self._deserialize, response) @@ -586,7 +632,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -659,7 +705,7 @@ def create_or_update_authorization_rule( # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -722,7 +768,7 @@ def delete_authorization_rule( # Construct and send request request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorResponseException(self._deserialize, response) @@ -779,7 +825,7 @@ def get_authorization_rule( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -843,7 +889,7 @@ def list_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -920,7 +966,7 @@ def regenerate_keys( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) diff --git a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/operations.py b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/operations.py index 67c1bec87af9..22bbf5d0d8be 100644 --- a/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/operations.py +++ b/azure-mgmt-eventhub/azure/mgmt/eventhub/operations/operations.py @@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response)