Skip to content

Commit

Permalink
Generated from 99fbc6361db4e9a677d97c8506edff426bc16e01 (#3397)
Browse files Browse the repository at this point in the history
Quick fix to response type of runbookdraftcontent get
  • Loading branch information
AutorestCI authored Sep 20, 2018
1 parent 12d5853 commit 945e26d
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<msrest:optionsforoperations>`.
: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<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 945e26d

Please sign in to comment.