diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py index d33ca52531ed..e709b3f3bad6 100644 --- a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py @@ -40,7 +40,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def get_content( - self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, callback=None, **operation_config): """Retrieve the content of runbook draft identified by runbook name. :param resource_group_name: Name of an Azure Resource group. @@ -52,10 +52,15 @@ def get_content( :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] :param operation_config: :ref:`Operation configuration overrides`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -84,7 +89,7 @@ def get_content( # Construct and send request request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + response = self._client.send(request, stream=True, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -94,7 +99,7 @@ def get_content( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('str', response) + deserialized = self._client.stream_download(response, callback) if raw: client_raw_response = ClientRawResponse(deserialized, response)