55# Code generated by Microsoft (R) Python Code Generator.
66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
8- # pylint: disable=protected-access
98from collections .abc import MutableMapping
109from io import IOBase
1110import json
12- from typing import Any , Callable , Dict , IO , Optional , TypeVar , Union , overload
11+ from typing import Any , Callable , IO , Optional , TypeVar , Union , overload
1312
1413from azure .core import PipelineClient
1514from azure .core .exceptions import (
3534
3635JSON = MutableMapping [str , Any ]
3736T = TypeVar ("T" )
38- ClsType = Optional [Callable [[PipelineResponse [HttpRequest , HttpResponse ], T , Dict [str , Any ]], Any ]]
37+ ClsType = Optional [Callable [[PipelineResponse [HttpRequest , HttpResponse ], T , dict [str , Any ]], Any ]]
3938
4039_SERIALIZER = Serializer ()
4140_SERIALIZER .client_side_validation = False
@@ -156,9 +155,9 @@ def _execute(
156155 ) -> _models ._models .QueryResults :
157156 """Execute an Analytics query.
158157
159- Executes an Analytics query for data.
160- `Here <https://learn.microsoft.com/azure/azure-monitor/logs/api/request-format>`_
161- is an example for using POST with an Analytics query.
158+ Executes an Analytics query for data. `Here
159+ <https://learn.microsoft.com/azure/azure-monitor/logs/api/request-format>`_ is an example for
160+ using POST with an Analytics query.
162161
163162 :param workspace_id: Primary Workspace ID of the query. This is the Workspace ID from the
164163 Properties
@@ -211,6 +210,7 @@ def _execute(
211210 }
212211 _request .url = self ._client .format_url (_request .url , ** path_format_arguments )
213212
213+ _decompress = kwargs .pop ("decompress" , True )
214214 _stream = kwargs .pop ("stream" , False )
215215 pipeline_response : PipelineResponse = self ._client ._pipeline .run ( # pylint: disable=protected-access
216216 _request , stream = _stream , ** kwargs
@@ -225,11 +225,14 @@ def _execute(
225225 except (StreamConsumedError , StreamClosedError ):
226226 pass
227227 map_error (status_code = response .status_code , response = response , error_map = error_map )
228- error = _failsafe_deserialize (_models ._models .ErrorResponse , response .json ())
228+ error = _failsafe_deserialize (
229+ _models ._models .ErrorResponse , # pylint: disable=protected-access
230+ response ,
231+ )
229232 raise HttpResponseError (response = response , model = error )
230233
231234 if _stream :
232- deserialized = response .iter_bytes ()
235+ deserialized = response .iter_bytes () if _decompress else response . iter_raw ()
233236 else :
234237 deserialized = _deserialize (
235238 _models ._models .QueryResults , response .json () # pylint: disable=protected-access
@@ -282,9 +285,9 @@ def _execute_with_resource_id(
282285 ) -> _models ._models .QueryResults :
283286 """Execute an Analytics query using resource ID.
284287
285- Executes an Analytics query for data in the context of a resource.
286- `Here <https://learn.microsoft.com/azure/azure-monitor/logs/api/azure-resource-queries>`_
287- is an example for using POST with an Analytics query.
288+ Executes an Analytics query for data in the context of a resource. `Here
289+ <https://learn.microsoft.com/azure/azure-monitor/logs/api/azure-resource-queries>`_ is an
290+ example for using POST with an Analytics query.
288291
289292 :param resource_id: The identifier of the resource. Required.
290293 :type resource_id: str
@@ -335,6 +338,7 @@ def _execute_with_resource_id(
335338 }
336339 _request .url = self ._client .format_url (_request .url , ** path_format_arguments )
337340
341+ _decompress = kwargs .pop ("decompress" , True )
338342 _stream = kwargs .pop ("stream" , False )
339343 pipeline_response : PipelineResponse = self ._client ._pipeline .run ( # pylint: disable=protected-access
340344 _request , stream = _stream , ** kwargs
@@ -349,11 +353,14 @@ def _execute_with_resource_id(
349353 except (StreamConsumedError , StreamClosedError ):
350354 pass
351355 map_error (status_code = response .status_code , response = response , error_map = error_map )
352- error = _failsafe_deserialize (_models ._models .ErrorResponse , response .json ())
356+ error = _failsafe_deserialize (
357+ _models ._models .ErrorResponse , # pylint: disable=protected-access
358+ response ,
359+ )
353360 raise HttpResponseError (response = response , model = error )
354361
355362 if _stream :
356- deserialized = response .iter_bytes ()
363+ deserialized = response .iter_bytes () if _decompress else response . iter_raw ()
357364 else :
358365 deserialized = _deserialize (
359366 _models ._models .QueryResults , response .json () # pylint: disable=protected-access
@@ -383,9 +390,9 @@ def _batch(
383390 ) -> _models ._models .BatchResponse :
384391 """Execute a batch of Analytics queries.
385392
386- Executes a batch of Analytics queries for data.
387- `Here <https://learn.microsoft.com/azure/azure-monitor/logs/api/batch-queries>`_
388- is an example for using POST with an Analytics query.
393+ Executes a batch of Analytics queries for data. `Here
394+ <https://learn.microsoft.com/azure/azure-monitor/logs/api/batch-queries>`_ is an example for
395+ using POST with an Analytics query.
389396
390397 :param body: The batch request body. Is one of the following types: BatchRequest, JSON,
391398 IO[bytes] Required.
@@ -427,6 +434,7 @@ def _batch(
427434 }
428435 _request .url = self ._client .format_url (_request .url , ** path_format_arguments )
429436
437+ _decompress = kwargs .pop ("decompress" , True )
430438 _stream = kwargs .pop ("stream" , False )
431439 pipeline_response : PipelineResponse = self ._client ._pipeline .run ( # pylint: disable=protected-access
432440 _request , stream = _stream , ** kwargs
@@ -441,11 +449,14 @@ def _batch(
441449 except (StreamConsumedError , StreamClosedError ):
442450 pass
443451 map_error (status_code = response .status_code , response = response , error_map = error_map )
444- error = _failsafe_deserialize (_models ._models .ErrorResponse , response .json ())
452+ error = _failsafe_deserialize (
453+ _models ._models .ErrorResponse , # pylint: disable=protected-access
454+ response ,
455+ )
445456 raise HttpResponseError (response = response , model = error )
446457
447458 if _stream :
448- deserialized = response .iter_bytes ()
459+ deserialized = response .iter_bytes () if _decompress else response . iter_raw ()
449460 else :
450461 deserialized = _deserialize (
451462 _models ._models .BatchResponse , response .json () # pylint: disable=protected-access
0 commit comments