Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR automation/resource-manager] Quick fix to response type of runbookdraftcontent get #3397

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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