diracx-client 0.0.1a11__py3-none-any.whl → 0.0.1a12__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,24 +1,25 @@
1
- # pylint: disable=too-many-lines
1
+ # pylint: disable=too-many-lines,too-many-statements
2
2
  # coding=utf-8
3
3
  # --------------------------------------------------------------------------
4
- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.1, generator: @autorest/python@6.4.11)
4
+ # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.2)
5
5
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
6
6
  # --------------------------------------------------------------------------
7
7
  from io import IOBase
8
8
  import sys
9
9
  from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload
10
10
 
11
+ from azure.core import MatchConditions
11
12
  from azure.core.exceptions import (
12
13
  ClientAuthenticationError,
13
14
  HttpResponseError,
14
15
  ResourceExistsError,
16
+ ResourceModifiedError,
15
17
  ResourceNotFoundError,
16
18
  ResourceNotModifiedError,
17
19
  map_error,
18
20
  )
19
21
  from azure.core.pipeline import PipelineResponse
20
- from azure.core.pipeline.transport import AsyncHttpResponse
21
- from azure.core.rest import HttpRequest
22
+ from azure.core.rest import AsyncHttpResponse, HttpRequest
22
23
  from azure.core.tracing.decorator_async import distributed_trace_async
23
24
  from azure.core.utils import case_insensitive_dict
24
25
 
@@ -115,22 +116,24 @@ class WellKnownOperations:
115
116
 
116
117
  cls: ClsType[Any] = kwargs.pop("cls", None)
117
118
 
118
- request = build_well_known_openid_configuration_request(
119
+ _request = build_well_known_openid_configuration_request(
119
120
  headers=_headers,
120
121
  params=_params,
121
122
  )
122
- request.url = self._client.format_url(request.url)
123
+ _request.url = self._client.format_url(_request.url)
123
124
 
124
125
  _stream = False
125
126
  pipeline_response: PipelineResponse = (
126
127
  await self._client._pipeline.run( # pylint: disable=protected-access
127
- request, stream=_stream, **kwargs
128
+ _request, stream=_stream, **kwargs
128
129
  )
129
130
  )
130
131
 
131
132
  response = pipeline_response.http_response
132
133
 
133
134
  if response.status_code not in [200]:
135
+ if _stream:
136
+ await response.read() # Load the body in memory and close the socket
134
137
  map_error(
135
138
  status_code=response.status_code, response=response, error_map=error_map
136
139
  )
@@ -139,9 +142,9 @@ class WellKnownOperations:
139
142
  deserialized = self._deserialize("object", pipeline_response)
140
143
 
141
144
  if cls:
142
- return cls(pipeline_response, deserialized, {})
145
+ return cls(pipeline_response, deserialized, {}) # type: ignore
143
146
 
144
- return deserialized
147
+ return deserialized # type: ignore
145
148
 
146
149
  @distributed_trace_async
147
150
  async def installation_metadata(self, **kwargs: Any) -> _models.Metadata:
@@ -166,22 +169,24 @@ class WellKnownOperations:
166
169
 
167
170
  cls: ClsType[_models.Metadata] = kwargs.pop("cls", None)
168
171
 
169
- request = build_well_known_installation_metadata_request(
172
+ _request = build_well_known_installation_metadata_request(
170
173
  headers=_headers,
171
174
  params=_params,
172
175
  )
173
- request.url = self._client.format_url(request.url)
176
+ _request.url = self._client.format_url(_request.url)
174
177
 
175
178
  _stream = False
176
179
  pipeline_response: PipelineResponse = (
177
180
  await self._client._pipeline.run( # pylint: disable=protected-access
178
- request, stream=_stream, **kwargs
181
+ _request, stream=_stream, **kwargs
179
182
  )
180
183
  )
181
184
 
182
185
  response = pipeline_response.http_response
183
186
 
184
187
  if response.status_code not in [200]:
188
+ if _stream:
189
+ await response.read() # Load the body in memory and close the socket
185
190
  map_error(
186
191
  status_code=response.status_code, response=response, error_map=error_map
187
192
  )
@@ -190,12 +195,12 @@ class WellKnownOperations:
190
195
  deserialized = self._deserialize("Metadata", pipeline_response)
191
196
 
192
197
  if cls:
193
- return cls(pipeline_response, deserialized, {})
198
+ return cls(pipeline_response, deserialized, {}) # type: ignore
194
199
 
195
- return deserialized
200
+ return deserialized # type: ignore
196
201
 
197
202
 
198
- class AuthOperations:
203
+ class AuthOperations: # pylint: disable=abstract-class-instantiated
199
204
  """
200
205
  .. warning::
201
206
  **DO NOT** instantiate this class directly.
@@ -215,6 +220,7 @@ class AuthOperations:
215
220
  self._deserialize = (
216
221
  input_args.pop(0) if input_args else kwargs.pop("deserializer")
217
222
  )
223
+
218
224
  raise_if_not_implemented(
219
225
  self.__class__,
220
226
  [
@@ -254,23 +260,25 @@ class AuthOperations:
254
260
 
255
261
  cls: ClsType[Any] = kwargs.pop("cls", None)
256
262
 
257
- request = build_auth_do_device_flow_request(
263
+ _request = build_auth_do_device_flow_request(
258
264
  user_code=user_code,
259
265
  headers=_headers,
260
266
  params=_params,
261
267
  )
262
- request.url = self._client.format_url(request.url)
268
+ _request.url = self._client.format_url(_request.url)
263
269
 
264
270
  _stream = False
265
271
  pipeline_response: PipelineResponse = (
266
272
  await self._client._pipeline.run( # pylint: disable=protected-access
267
- request, stream=_stream, **kwargs
273
+ _request, stream=_stream, **kwargs
268
274
  )
269
275
  )
270
276
 
271
277
  response = pipeline_response.http_response
272
278
 
273
279
  if response.status_code not in [200]:
280
+ if _stream:
281
+ await response.read() # Load the body in memory and close the socket
274
282
  map_error(
275
283
  status_code=response.status_code, response=response, error_map=error_map
276
284
  )
@@ -279,13 +287,13 @@ class AuthOperations:
279
287
  deserialized = self._deserialize("object", pipeline_response)
280
288
 
281
289
  if cls:
282
- return cls(pipeline_response, deserialized, {})
290
+ return cls(pipeline_response, deserialized, {}) # type: ignore
283
291
 
284
- return deserialized
292
+ return deserialized # type: ignore
285
293
 
286
294
  @distributed_trace_async
287
295
  async def initiate_device_flow(
288
- self, *, client_id: str, scope: str, audience: str, **kwargs: Any
296
+ self, *, client_id: str, scope: str, **kwargs: Any
289
297
  ) -> _models.InitiateDeviceFlowResponse:
290
298
  """Initiate Device Flow.
291
299
 
@@ -301,8 +309,6 @@ class AuthOperations:
301
309
  :paramtype client_id: str
302
310
  :keyword scope: Required.
303
311
  :paramtype scope: str
304
- :keyword audience: Required.
305
- :paramtype audience: str
306
312
  :return: InitiateDeviceFlowResponse
307
313
  :rtype: ~client.models.InitiateDeviceFlowResponse
308
314
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -320,25 +326,26 @@ class AuthOperations:
320
326
 
321
327
  cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)
322
328
 
323
- request = build_auth_initiate_device_flow_request(
329
+ _request = build_auth_initiate_device_flow_request(
324
330
  client_id=client_id,
325
331
  scope=scope,
326
- audience=audience,
327
332
  headers=_headers,
328
333
  params=_params,
329
334
  )
330
- request.url = self._client.format_url(request.url)
335
+ _request.url = self._client.format_url(_request.url)
331
336
 
332
337
  _stream = False
333
338
  pipeline_response: PipelineResponse = (
334
339
  await self._client._pipeline.run( # pylint: disable=protected-access
335
- request, stream=_stream, **kwargs
340
+ _request, stream=_stream, **kwargs
336
341
  )
337
342
  )
338
343
 
339
344
  response = pipeline_response.http_response
340
345
 
341
346
  if response.status_code not in [200]:
347
+ if _stream:
348
+ await response.read() # Load the body in memory and close the socket
342
349
  map_error(
343
350
  status_code=response.status_code, response=response, error_map=error_map
344
351
  )
@@ -349,9 +356,9 @@ class AuthOperations:
349
356
  )
350
357
 
351
358
  if cls:
352
- return cls(pipeline_response, deserialized, {})
359
+ return cls(pipeline_response, deserialized, {}) # type: ignore
353
360
 
354
- return deserialized
361
+ return deserialized # type: ignore
355
362
 
356
363
  @distributed_trace_async
357
364
  async def finish_device_flow(self, *, code: str, state: str, **kwargs: Any) -> Any:
@@ -384,24 +391,26 @@ class AuthOperations:
384
391
 
385
392
  cls: ClsType[Any] = kwargs.pop("cls", None)
386
393
 
387
- request = build_auth_finish_device_flow_request(
394
+ _request = build_auth_finish_device_flow_request(
388
395
  code=code,
389
396
  state=state,
390
397
  headers=_headers,
391
398
  params=_params,
392
399
  )
393
- request.url = self._client.format_url(request.url)
400
+ _request.url = self._client.format_url(_request.url)
394
401
 
395
402
  _stream = False
396
403
  pipeline_response: PipelineResponse = (
397
404
  await self._client._pipeline.run( # pylint: disable=protected-access
398
- request, stream=_stream, **kwargs
405
+ _request, stream=_stream, **kwargs
399
406
  )
400
407
  )
401
408
 
402
409
  response = pipeline_response.http_response
403
410
 
404
411
  if response.status_code not in [200]:
412
+ if _stream:
413
+ await response.read() # Load the body in memory and close the socket
405
414
  map_error(
406
415
  status_code=response.status_code, response=response, error_map=error_map
407
416
  )
@@ -410,9 +419,9 @@ class AuthOperations:
410
419
  deserialized = self._deserialize("object", pipeline_response)
411
420
 
412
421
  if cls:
413
- return cls(pipeline_response, deserialized, {})
422
+ return cls(pipeline_response, deserialized, {}) # type: ignore
414
423
 
415
- return deserialized
424
+ return deserialized # type: ignore
416
425
 
417
426
  @distributed_trace_async
418
427
  async def finished(self, **kwargs: Any) -> Any:
@@ -437,22 +446,24 @@ class AuthOperations:
437
446
 
438
447
  cls: ClsType[Any] = kwargs.pop("cls", None)
439
448
 
440
- request = build_auth_finished_request(
449
+ _request = build_auth_finished_request(
441
450
  headers=_headers,
442
451
  params=_params,
443
452
  )
444
- request.url = self._client.format_url(request.url)
453
+ _request.url = self._client.format_url(_request.url)
445
454
 
446
455
  _stream = False
447
456
  pipeline_response: PipelineResponse = (
448
457
  await self._client._pipeline.run( # pylint: disable=protected-access
449
- request, stream=_stream, **kwargs
458
+ _request, stream=_stream, **kwargs
450
459
  )
451
460
  )
452
461
 
453
462
  response = pipeline_response.http_response
454
463
 
455
464
  if response.status_code not in [200]:
465
+ if _stream:
466
+ await response.read() # Load the body in memory and close the socket
456
467
  map_error(
457
468
  status_code=response.status_code, response=response, error_map=error_map
458
469
  )
@@ -461,15 +472,16 @@ class AuthOperations:
461
472
  deserialized = self._deserialize("object", pipeline_response)
462
473
 
463
474
  if cls:
464
- return cls(pipeline_response, deserialized, {})
475
+ return cls(pipeline_response, deserialized, {}) # type: ignore
465
476
 
466
- return deserialized
477
+ return deserialized # type: ignore
467
478
 
468
479
  @distributed_trace_async
469
480
  async def get_refresh_tokens(self, **kwargs: Any) -> List[Any]:
470
481
  """Get Refresh Tokens.
471
482
 
472
- Get Refresh Tokens.
483
+ Get all refresh tokens for the user. If the user has the ``proxy_management`` property, then
484
+ the subject is not used to filter the refresh tokens.
473
485
 
474
486
  :return: list of any
475
487
  :rtype: list[any]
@@ -488,22 +500,24 @@ class AuthOperations:
488
500
 
489
501
  cls: ClsType[List[Any]] = kwargs.pop("cls", None)
490
502
 
491
- request = build_auth_get_refresh_tokens_request(
503
+ _request = build_auth_get_refresh_tokens_request(
492
504
  headers=_headers,
493
505
  params=_params,
494
506
  )
495
- request.url = self._client.format_url(request.url)
507
+ _request.url = self._client.format_url(_request.url)
496
508
 
497
509
  _stream = False
498
510
  pipeline_response: PipelineResponse = (
499
511
  await self._client._pipeline.run( # pylint: disable=protected-access
500
- request, stream=_stream, **kwargs
512
+ _request, stream=_stream, **kwargs
501
513
  )
502
514
  )
503
515
 
504
516
  response = pipeline_response.http_response
505
517
 
506
518
  if response.status_code not in [200]:
519
+ if _stream:
520
+ await response.read() # Load the body in memory and close the socket
507
521
  map_error(
508
522
  status_code=response.status_code, response=response, error_map=error_map
509
523
  )
@@ -512,15 +526,16 @@ class AuthOperations:
512
526
  deserialized = self._deserialize("[object]", pipeline_response)
513
527
 
514
528
  if cls:
515
- return cls(pipeline_response, deserialized, {})
529
+ return cls(pipeline_response, deserialized, {}) # type: ignore
516
530
 
517
- return deserialized
531
+ return deserialized # type: ignore
518
532
 
519
533
  @distributed_trace_async
520
534
  async def revoke_refresh_token(self, jti: str, **kwargs: Any) -> str:
521
535
  """Revoke Refresh Token.
522
536
 
523
- Revoke Refresh Token.
537
+ Revoke a refresh token. If the user has the ``proxy_management`` property, then
538
+ the subject is not used to filter the refresh tokens.
524
539
 
525
540
  :param jti: Required.
526
541
  :type jti: str
@@ -541,23 +556,25 @@ class AuthOperations:
541
556
 
542
557
  cls: ClsType[str] = kwargs.pop("cls", None)
543
558
 
544
- request = build_auth_revoke_refresh_token_request(
559
+ _request = build_auth_revoke_refresh_token_request(
545
560
  jti=jti,
546
561
  headers=_headers,
547
562
  params=_params,
548
563
  )
549
- request.url = self._client.format_url(request.url)
564
+ _request.url = self._client.format_url(_request.url)
550
565
 
551
566
  _stream = False
552
567
  pipeline_response: PipelineResponse = (
553
568
  await self._client._pipeline.run( # pylint: disable=protected-access
554
- request, stream=_stream, **kwargs
569
+ _request, stream=_stream, **kwargs
555
570
  )
556
571
  )
557
572
 
558
573
  response = pipeline_response.http_response
559
574
 
560
575
  if response.status_code not in [200]:
576
+ if _stream:
577
+ await response.read() # Load the body in memory and close the socket
561
578
  map_error(
562
579
  status_code=response.status_code, response=response, error_map=error_map
563
580
  )
@@ -566,17 +583,70 @@ class AuthOperations:
566
583
  deserialized = self._deserialize("str", pipeline_response)
567
584
 
568
585
  if cls:
569
- return cls(pipeline_response, deserialized, {})
586
+ return cls(pipeline_response, deserialized, {}) # type: ignore
570
587
 
571
- return deserialized
588
+ return deserialized # type: ignore
589
+
590
+ @distributed_trace_async
591
+ async def userinfo(self, **kwargs: Any) -> _models.UserInfoResponse:
592
+ """Userinfo.
593
+
594
+ Get information about the user's identity.
595
+
596
+ :return: UserInfoResponse
597
+ :rtype: ~client.models.UserInfoResponse
598
+ :raises ~azure.core.exceptions.HttpResponseError:
599
+ """
600
+ error_map = {
601
+ 401: ClientAuthenticationError,
602
+ 404: ResourceNotFoundError,
603
+ 409: ResourceExistsError,
604
+ 304: ResourceNotModifiedError,
605
+ }
606
+ error_map.update(kwargs.pop("error_map", {}) or {})
607
+
608
+ _headers = kwargs.pop("headers", {}) or {}
609
+ _params = kwargs.pop("params", {}) or {}
610
+
611
+ cls: ClsType[_models.UserInfoResponse] = kwargs.pop("cls", None)
612
+
613
+ _request = build_auth_userinfo_request(
614
+ headers=_headers,
615
+ params=_params,
616
+ )
617
+ _request.url = self._client.format_url(_request.url)
618
+
619
+ _stream = False
620
+ pipeline_response: PipelineResponse = (
621
+ await self._client._pipeline.run( # pylint: disable=protected-access
622
+ _request, stream=_stream, **kwargs
623
+ )
624
+ )
625
+
626
+ response = pipeline_response.http_response
627
+
628
+ if response.status_code not in [200]:
629
+ if _stream:
630
+ await response.read() # Load the body in memory and close the socket
631
+ map_error(
632
+ status_code=response.status_code, response=response, error_map=error_map
633
+ )
634
+ raise HttpResponseError(response=response)
635
+
636
+ deserialized = self._deserialize("UserInfoResponse", pipeline_response)
637
+
638
+ if cls:
639
+ return cls(pipeline_response, deserialized, {}) # type: ignore
640
+
641
+ return deserialized # type: ignore
572
642
 
573
643
  @distributed_trace_async
574
644
  async def authorization_flow(
575
645
  self,
576
646
  *,
577
- response_type: Union[str, _models.Enum3],
647
+ response_type: Union[str, _models.Enum0],
578
648
  code_challenge: str,
579
- code_challenge_method: Union[str, _models.Enum4],
649
+ code_challenge_method: Union[str, _models.Enum1],
580
650
  client_id: str,
581
651
  redirect_uri: str,
582
652
  scope: str,
@@ -588,11 +658,11 @@ class AuthOperations:
588
658
  Authorization Flow.
589
659
 
590
660
  :keyword response_type: "code" Required.
591
- :paramtype response_type: str or ~client.models.Enum3
661
+ :paramtype response_type: str or ~client.models.Enum0
592
662
  :keyword code_challenge: Required.
593
663
  :paramtype code_challenge: str
594
664
  :keyword code_challenge_method: "S256" Required.
595
- :paramtype code_challenge_method: str or ~client.models.Enum4
665
+ :paramtype code_challenge_method: str or ~client.models.Enum1
596
666
  :keyword client_id: Required.
597
667
  :paramtype client_id: str
598
668
  :keyword redirect_uri: Required.
@@ -618,7 +688,7 @@ class AuthOperations:
618
688
 
619
689
  cls: ClsType[Any] = kwargs.pop("cls", None)
620
690
 
621
- request = build_auth_authorization_flow_request(
691
+ _request = build_auth_authorization_flow_request(
622
692
  response_type=response_type,
623
693
  code_challenge=code_challenge,
624
694
  code_challenge_method=code_challenge_method,
@@ -629,18 +699,20 @@ class AuthOperations:
629
699
  headers=_headers,
630
700
  params=_params,
631
701
  )
632
- request.url = self._client.format_url(request.url)
702
+ _request.url = self._client.format_url(_request.url)
633
703
 
634
704
  _stream = False
635
705
  pipeline_response: PipelineResponse = (
636
706
  await self._client._pipeline.run( # pylint: disable=protected-access
637
- request, stream=_stream, **kwargs
707
+ _request, stream=_stream, **kwargs
638
708
  )
639
709
  )
640
710
 
641
711
  response = pipeline_response.http_response
642
712
 
643
713
  if response.status_code not in [200]:
714
+ if _stream:
715
+ await response.read() # Load the body in memory and close the socket
644
716
  map_error(
645
717
  status_code=response.status_code, response=response, error_map=error_map
646
718
  )
@@ -649,9 +721,9 @@ class AuthOperations:
649
721
  deserialized = self._deserialize("object", pipeline_response)
650
722
 
651
723
  if cls:
652
- return cls(pipeline_response, deserialized, {})
724
+ return cls(pipeline_response, deserialized, {}) # type: ignore
653
725
 
654
- return deserialized
726
+ return deserialized # type: ignore
655
727
 
656
728
  @distributed_trace_async
657
729
  async def authorization_flow_complete(
@@ -682,24 +754,26 @@ class AuthOperations:
682
754
 
683
755
  cls: ClsType[Any] = kwargs.pop("cls", None)
684
756
 
685
- request = build_auth_authorization_flow_complete_request(
757
+ _request = build_auth_authorization_flow_complete_request(
686
758
  code=code,
687
759
  state=state,
688
760
  headers=_headers,
689
761
  params=_params,
690
762
  )
691
- request.url = self._client.format_url(request.url)
763
+ _request.url = self._client.format_url(_request.url)
692
764
 
693
765
  _stream = False
694
766
  pipeline_response: PipelineResponse = (
695
767
  await self._client._pipeline.run( # pylint: disable=protected-access
696
- request, stream=_stream, **kwargs
768
+ _request, stream=_stream, **kwargs
697
769
  )
698
770
  )
699
771
 
700
772
  response = pipeline_response.http_response
701
773
 
702
774
  if response.status_code not in [200]:
775
+ if _stream:
776
+ await response.read() # Load the body in memory and close the socket
703
777
  map_error(
704
778
  status_code=response.status_code, response=response, error_map=error_map
705
779
  )
@@ -708,60 +782,9 @@ class AuthOperations:
708
782
  deserialized = self._deserialize("object", pipeline_response)
709
783
 
710
784
  if cls:
711
- return cls(pipeline_response, deserialized, {})
785
+ return cls(pipeline_response, deserialized, {}) # type: ignore
712
786
 
713
- return deserialized
714
-
715
- @distributed_trace_async
716
- async def userinfo(self, **kwargs: Any) -> _models.UserInfoResponse:
717
- """Userinfo.
718
-
719
- Userinfo.
720
-
721
- :return: UserInfoResponse
722
- :rtype: ~client.models.UserInfoResponse
723
- :raises ~azure.core.exceptions.HttpResponseError:
724
- """
725
- error_map = {
726
- 401: ClientAuthenticationError,
727
- 404: ResourceNotFoundError,
728
- 409: ResourceExistsError,
729
- 304: ResourceNotModifiedError,
730
- }
731
- error_map.update(kwargs.pop("error_map", {}) or {})
732
-
733
- _headers = kwargs.pop("headers", {}) or {}
734
- _params = kwargs.pop("params", {}) or {}
735
-
736
- cls: ClsType[_models.UserInfoResponse] = kwargs.pop("cls", None)
737
-
738
- request = build_auth_userinfo_request(
739
- headers=_headers,
740
- params=_params,
741
- )
742
- request.url = self._client.format_url(request.url)
743
-
744
- _stream = False
745
- pipeline_response: PipelineResponse = (
746
- await self._client._pipeline.run( # pylint: disable=protected-access
747
- request, stream=_stream, **kwargs
748
- )
749
- )
750
-
751
- response = pipeline_response.http_response
752
-
753
- if response.status_code not in [200]:
754
- map_error(
755
- status_code=response.status_code, response=response, error_map=error_map
756
- )
757
- raise HttpResponseError(response=response)
758
-
759
- deserialized = self._deserialize("UserInfoResponse", pipeline_response)
760
-
761
- if cls:
762
- return cls(pipeline_response, deserialized, {})
763
-
764
- return deserialized
787
+ return deserialized # type: ignore
765
788
 
766
789
 
767
790
  class ConfigOperations:
@@ -789,8 +812,9 @@ class ConfigOperations:
789
812
  async def serve_config(
790
813
  self,
791
814
  *,
792
- if_none_match: Optional[str] = None,
793
815
  if_modified_since: Optional[str] = None,
816
+ etag: Optional[str] = None,
817
+ match_condition: Optional[MatchConditions] = None,
794
818
  **kwargs: Any,
795
819
  ) -> Any:
796
820
  """Serve Config.
@@ -802,10 +826,13 @@ class ConfigOperations:
802
826
  If If-Modified-Since is given and is newer than latest,
803
827
  return 304: this is to avoid flip/flopping.
804
828
 
805
- :keyword if_none_match: Default value is None.
806
- :paramtype if_none_match: str
807
829
  :keyword if_modified_since: Default value is None.
808
830
  :paramtype if_modified_since: str
831
+ :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is
832
+ None.
833
+ :paramtype etag: str
834
+ :keyword match_condition: The match condition to use upon the etag. Default value is None.
835
+ :paramtype match_condition: ~azure.core.MatchConditions
809
836
  :return: any
810
837
  :rtype: any
811
838
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -816,6 +843,12 @@ class ConfigOperations:
816
843
  409: ResourceExistsError,
817
844
  304: ResourceNotModifiedError,
818
845
  }
846
+ if match_condition == MatchConditions.IfNotModified:
847
+ error_map[412] = ResourceModifiedError
848
+ elif match_condition == MatchConditions.IfPresent:
849
+ error_map[412] = ResourceNotFoundError
850
+ elif match_condition == MatchConditions.IfMissing:
851
+ error_map[412] = ResourceExistsError
819
852
  error_map.update(kwargs.pop("error_map", {}) or {})
820
853
 
821
854
  _headers = kwargs.pop("headers", {}) or {}
@@ -823,24 +856,27 @@ class ConfigOperations:
823
856
 
824
857
  cls: ClsType[Any] = kwargs.pop("cls", None)
825
858
 
826
- request = build_config_serve_config_request(
827
- if_none_match=if_none_match,
859
+ _request = build_config_serve_config_request(
828
860
  if_modified_since=if_modified_since,
861
+ etag=etag,
862
+ match_condition=match_condition,
829
863
  headers=_headers,
830
864
  params=_params,
831
865
  )
832
- request.url = self._client.format_url(request.url)
866
+ _request.url = self._client.format_url(_request.url)
833
867
 
834
868
  _stream = False
835
869
  pipeline_response: PipelineResponse = (
836
870
  await self._client._pipeline.run( # pylint: disable=protected-access
837
- request, stream=_stream, **kwargs
871
+ _request, stream=_stream, **kwargs
838
872
  )
839
873
  )
840
874
 
841
875
  response = pipeline_response.http_response
842
876
 
843
877
  if response.status_code not in [200]:
878
+ if _stream:
879
+ await response.read() # Load the body in memory and close the socket
844
880
  map_error(
845
881
  status_code=response.status_code, response=response, error_map=error_map
846
882
  )
@@ -849,9 +885,9 @@ class ConfigOperations:
849
885
  deserialized = self._deserialize("object", pipeline_response)
850
886
 
851
887
  if cls:
852
- return cls(pipeline_response, deserialized, {})
888
+ return cls(pipeline_response, deserialized, {}) # type: ignore
853
889
 
854
- return deserialized
890
+ return deserialized # type: ignore
855
891
 
856
892
 
857
893
  class JobsOperations: # pylint: disable=too-many-public-methods
@@ -908,23 +944,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
908
944
 
909
945
  cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)
910
946
 
911
- request = build_jobs_get_sandbox_file_request(
947
+ _request = build_jobs_get_sandbox_file_request(
912
948
  pfn=pfn,
913
949
  headers=_headers,
914
950
  params=_params,
915
951
  )
916
- request.url = self._client.format_url(request.url)
952
+ _request.url = self._client.format_url(_request.url)
917
953
 
918
954
  _stream = False
919
955
  pipeline_response: PipelineResponse = (
920
956
  await self._client._pipeline.run( # pylint: disable=protected-access
921
- request, stream=_stream, **kwargs
957
+ _request, stream=_stream, **kwargs
922
958
  )
923
959
  )
924
960
 
925
961
  response = pipeline_response.http_response
926
962
 
927
963
  if response.status_code not in [200]:
964
+ if _stream:
965
+ await response.read() # Load the body in memory and close the socket
928
966
  map_error(
929
967
  status_code=response.status_code, response=response, error_map=error_map
930
968
  )
@@ -933,9 +971,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
933
971
  deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)
934
972
 
935
973
  if cls:
936
- return cls(pipeline_response, deserialized, {})
974
+ return cls(pipeline_response, deserialized, {}) # type: ignore
937
975
 
938
- return deserialized
976
+ return deserialized # type: ignore
939
977
 
940
978
  @overload
941
979
  async def initiate_sandbox_upload(
@@ -967,7 +1005,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
967
1005
 
968
1006
  @overload
969
1007
  async def initiate_sandbox_upload(
970
- self, body: IO, *, content_type: str = "application/json", **kwargs: Any
1008
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
971
1009
  ) -> _models.SandboxUploadResponse:
972
1010
  """Initiate Sandbox Upload.
973
1011
 
@@ -980,7 +1018,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
980
1018
  should be used to upload the sandbox to the storage backend.
981
1019
 
982
1020
  :param body: Required.
983
- :type body: IO
1021
+ :type body: IO[bytes]
984
1022
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
985
1023
  Default value is "application/json".
986
1024
  :paramtype content_type: str
@@ -991,7 +1029,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
991
1029
 
992
1030
  @distributed_trace_async
993
1031
  async def initiate_sandbox_upload(
994
- self, body: Union[_models.SandboxInfo, IO], **kwargs: Any
1032
+ self, body: Union[_models.SandboxInfo, IO[bytes]], **kwargs: Any
995
1033
  ) -> _models.SandboxUploadResponse:
996
1034
  """Initiate Sandbox Upload.
997
1035
 
@@ -1003,11 +1041,8 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1003
1041
  If the sandbox does not exist in the database then the "url" and "fields"
1004
1042
  should be used to upload the sandbox to the storage backend.
1005
1043
 
1006
- :param body: Is either a SandboxInfo type or a IO type. Required.
1007
- :type body: ~client.models.SandboxInfo or IO
1008
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
1009
- Default value is None.
1010
- :paramtype content_type: str
1044
+ :param body: Is either a SandboxInfo type or a IO[bytes] type. Required.
1045
+ :type body: ~client.models.SandboxInfo or IO[bytes]
1011
1046
  :return: SandboxUploadResponse
1012
1047
  :rtype: ~client.models.SandboxUploadResponse
1013
1048
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1036,25 +1071,27 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1036
1071
  else:
1037
1072
  _json = self._serialize.body(body, "SandboxInfo")
1038
1073
 
1039
- request = build_jobs_initiate_sandbox_upload_request(
1074
+ _request = build_jobs_initiate_sandbox_upload_request(
1040
1075
  content_type=content_type,
1041
1076
  json=_json,
1042
1077
  content=_content,
1043
1078
  headers=_headers,
1044
1079
  params=_params,
1045
1080
  )
1046
- request.url = self._client.format_url(request.url)
1081
+ _request.url = self._client.format_url(_request.url)
1047
1082
 
1048
1083
  _stream = False
1049
1084
  pipeline_response: PipelineResponse = (
1050
1085
  await self._client._pipeline.run( # pylint: disable=protected-access
1051
- request, stream=_stream, **kwargs
1086
+ _request, stream=_stream, **kwargs
1052
1087
  )
1053
1088
  )
1054
1089
 
1055
1090
  response = pipeline_response.http_response
1056
1091
 
1057
1092
  if response.status_code not in [200]:
1093
+ if _stream:
1094
+ await response.read() # Load the body in memory and close the socket
1058
1095
  map_error(
1059
1096
  status_code=response.status_code, response=response, error_map=error_map
1060
1097
  )
@@ -1063,9 +1100,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1063
1100
  deserialized = self._deserialize("SandboxUploadResponse", pipeline_response)
1064
1101
 
1065
1102
  if cls:
1066
- return cls(pipeline_response, deserialized, {})
1103
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1067
1104
 
1068
- return deserialized
1105
+ return deserialized # type: ignore
1069
1106
 
1070
1107
  @overload
1071
1108
  async def submit_bulk_jobs(
@@ -1087,14 +1124,14 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1087
1124
 
1088
1125
  @overload
1089
1126
  async def submit_bulk_jobs(
1090
- self, body: IO, *, content_type: str = "application/json", **kwargs: Any
1127
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
1091
1128
  ) -> List[_models.InsertedJob]:
1092
1129
  """Submit Bulk Jobs.
1093
1130
 
1094
1131
  Submit Bulk Jobs.
1095
1132
 
1096
1133
  :param body: Required.
1097
- :type body: IO
1134
+ :type body: IO[bytes]
1098
1135
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1099
1136
  Default value is "application/json".
1100
1137
  :paramtype content_type: str
@@ -1105,17 +1142,14 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1105
1142
 
1106
1143
  @distributed_trace_async
1107
1144
  async def submit_bulk_jobs(
1108
- self, body: Union[List[str], IO], **kwargs: Any
1145
+ self, body: Union[List[str], IO[bytes]], **kwargs: Any
1109
1146
  ) -> List[_models.InsertedJob]:
1110
1147
  """Submit Bulk Jobs.
1111
1148
 
1112
1149
  Submit Bulk Jobs.
1113
1150
 
1114
- :param body: Is either a [str] type or a IO type. Required.
1115
- :type body: list[str] or IO
1116
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
1117
- Default value is None.
1118
- :paramtype content_type: str
1151
+ :param body: Is either a [str] type or a IO[bytes] type. Required.
1152
+ :type body: list[str] or IO[bytes]
1119
1153
  :return: list of InsertedJob
1120
1154
  :rtype: list[~client.models.InsertedJob]
1121
1155
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1144,25 +1178,27 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1144
1178
  else:
1145
1179
  _json = self._serialize.body(body, "[str]")
1146
1180
 
1147
- request = build_jobs_submit_bulk_jobs_request(
1181
+ _request = build_jobs_submit_bulk_jobs_request(
1148
1182
  content_type=content_type,
1149
1183
  json=_json,
1150
1184
  content=_content,
1151
1185
  headers=_headers,
1152
1186
  params=_params,
1153
1187
  )
1154
- request.url = self._client.format_url(request.url)
1188
+ _request.url = self._client.format_url(_request.url)
1155
1189
 
1156
1190
  _stream = False
1157
1191
  pipeline_response: PipelineResponse = (
1158
1192
  await self._client._pipeline.run( # pylint: disable=protected-access
1159
- request, stream=_stream, **kwargs
1193
+ _request, stream=_stream, **kwargs
1160
1194
  )
1161
1195
  )
1162
1196
 
1163
1197
  response = pipeline_response.http_response
1164
1198
 
1165
1199
  if response.status_code not in [200]:
1200
+ if _stream:
1201
+ await response.read() # Load the body in memory and close the socket
1166
1202
  map_error(
1167
1203
  status_code=response.status_code, response=response, error_map=error_map
1168
1204
  )
@@ -1171,9 +1207,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1171
1207
  deserialized = self._deserialize("[InsertedJob]", pipeline_response)
1172
1208
 
1173
1209
  if cls:
1174
- return cls(pipeline_response, deserialized, {})
1210
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1175
1211
 
1176
- return deserialized
1212
+ return deserialized # type: ignore
1177
1213
 
1178
1214
  @distributed_trace_async
1179
1215
  async def delete_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
@@ -1200,23 +1236,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1200
1236
 
1201
1237
  cls: ClsType[Any] = kwargs.pop("cls", None)
1202
1238
 
1203
- request = build_jobs_delete_bulk_jobs_request(
1239
+ _request = build_jobs_delete_bulk_jobs_request(
1204
1240
  job_ids=job_ids,
1205
1241
  headers=_headers,
1206
1242
  params=_params,
1207
1243
  )
1208
- request.url = self._client.format_url(request.url)
1244
+ _request.url = self._client.format_url(_request.url)
1209
1245
 
1210
1246
  _stream = False
1211
1247
  pipeline_response: PipelineResponse = (
1212
1248
  await self._client._pipeline.run( # pylint: disable=protected-access
1213
- request, stream=_stream, **kwargs
1249
+ _request, stream=_stream, **kwargs
1214
1250
  )
1215
1251
  )
1216
1252
 
1217
1253
  response = pipeline_response.http_response
1218
1254
 
1219
1255
  if response.status_code not in [200]:
1256
+ if _stream:
1257
+ await response.read() # Load the body in memory and close the socket
1220
1258
  map_error(
1221
1259
  status_code=response.status_code, response=response, error_map=error_map
1222
1260
  )
@@ -1225,9 +1263,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1225
1263
  deserialized = self._deserialize("object", pipeline_response)
1226
1264
 
1227
1265
  if cls:
1228
- return cls(pipeline_response, deserialized, {})
1266
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1229
1267
 
1230
- return deserialized
1268
+ return deserialized # type: ignore
1231
1269
 
1232
1270
  @distributed_trace_async
1233
1271
  async def kill_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
@@ -1254,23 +1292,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1254
1292
 
1255
1293
  cls: ClsType[Any] = kwargs.pop("cls", None)
1256
1294
 
1257
- request = build_jobs_kill_bulk_jobs_request(
1295
+ _request = build_jobs_kill_bulk_jobs_request(
1258
1296
  job_ids=job_ids,
1259
1297
  headers=_headers,
1260
1298
  params=_params,
1261
1299
  )
1262
- request.url = self._client.format_url(request.url)
1300
+ _request.url = self._client.format_url(_request.url)
1263
1301
 
1264
1302
  _stream = False
1265
1303
  pipeline_response: PipelineResponse = (
1266
1304
  await self._client._pipeline.run( # pylint: disable=protected-access
1267
- request, stream=_stream, **kwargs
1305
+ _request, stream=_stream, **kwargs
1268
1306
  )
1269
1307
  )
1270
1308
 
1271
1309
  response = pipeline_response.http_response
1272
1310
 
1273
1311
  if response.status_code not in [200]:
1312
+ if _stream:
1313
+ await response.read() # Load the body in memory and close the socket
1274
1314
  map_error(
1275
1315
  status_code=response.status_code, response=response, error_map=error_map
1276
1316
  )
@@ -1279,9 +1319,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1279
1319
  deserialized = self._deserialize("object", pipeline_response)
1280
1320
 
1281
1321
  if cls:
1282
- return cls(pipeline_response, deserialized, {})
1322
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1283
1323
 
1284
- return deserialized
1324
+ return deserialized # type: ignore
1285
1325
 
1286
1326
  @distributed_trace_async
1287
1327
  async def remove_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
@@ -1312,23 +1352,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1312
1352
 
1313
1353
  cls: ClsType[Any] = kwargs.pop("cls", None)
1314
1354
 
1315
- request = build_jobs_remove_bulk_jobs_request(
1355
+ _request = build_jobs_remove_bulk_jobs_request(
1316
1356
  job_ids=job_ids,
1317
1357
  headers=_headers,
1318
1358
  params=_params,
1319
1359
  )
1320
- request.url = self._client.format_url(request.url)
1360
+ _request.url = self._client.format_url(_request.url)
1321
1361
 
1322
1362
  _stream = False
1323
1363
  pipeline_response: PipelineResponse = (
1324
1364
  await self._client._pipeline.run( # pylint: disable=protected-access
1325
- request, stream=_stream, **kwargs
1365
+ _request, stream=_stream, **kwargs
1326
1366
  )
1327
1367
  )
1328
1368
 
1329
1369
  response = pipeline_response.http_response
1330
1370
 
1331
1371
  if response.status_code not in [200]:
1372
+ if _stream:
1373
+ await response.read() # Load the body in memory and close the socket
1332
1374
  map_error(
1333
1375
  status_code=response.status_code, response=response, error_map=error_map
1334
1376
  )
@@ -1337,9 +1379,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1337
1379
  deserialized = self._deserialize("object", pipeline_response)
1338
1380
 
1339
1381
  if cls:
1340
- return cls(pipeline_response, deserialized, {})
1382
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1341
1383
 
1342
- return deserialized
1384
+ return deserialized # type: ignore
1343
1385
 
1344
1386
  @distributed_trace_async
1345
1387
  async def get_job_status_bulk(
@@ -1370,23 +1412,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1370
1412
  "cls", None
1371
1413
  )
1372
1414
 
1373
- request = build_jobs_get_job_status_bulk_request(
1415
+ _request = build_jobs_get_job_status_bulk_request(
1374
1416
  job_ids=job_ids,
1375
1417
  headers=_headers,
1376
1418
  params=_params,
1377
1419
  )
1378
- request.url = self._client.format_url(request.url)
1420
+ _request.url = self._client.format_url(_request.url)
1379
1421
 
1380
1422
  _stream = False
1381
1423
  pipeline_response: PipelineResponse = (
1382
1424
  await self._client._pipeline.run( # pylint: disable=protected-access
1383
- request, stream=_stream, **kwargs
1425
+ _request, stream=_stream, **kwargs
1384
1426
  )
1385
1427
  )
1386
1428
 
1387
1429
  response = pipeline_response.http_response
1388
1430
 
1389
1431
  if response.status_code not in [200]:
1432
+ if _stream:
1433
+ await response.read() # Load the body in memory and close the socket
1390
1434
  map_error(
1391
1435
  status_code=response.status_code, response=response, error_map=error_map
1392
1436
  )
@@ -1395,9 +1439,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1395
1439
  deserialized = self._deserialize("{LimitedJobStatusReturn}", pipeline_response)
1396
1440
 
1397
1441
  if cls:
1398
- return cls(pipeline_response, deserialized, {})
1442
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1399
1443
 
1400
- return deserialized
1444
+ return deserialized # type: ignore
1401
1445
 
1402
1446
  @overload
1403
1447
  async def set_job_status_bulk(
@@ -1427,7 +1471,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1427
1471
  @overload
1428
1472
  async def set_job_status_bulk(
1429
1473
  self,
1430
- body: IO,
1474
+ body: IO[bytes],
1431
1475
  *,
1432
1476
  force: bool = False,
1433
1477
  content_type: str = "application/json",
@@ -1438,7 +1482,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1438
1482
  Set Job Status Bulk.
1439
1483
 
1440
1484
  :param body: Required.
1441
- :type body: IO
1485
+ :type body: IO[bytes]
1442
1486
  :keyword force: Default value is False.
1443
1487
  :paramtype force: bool
1444
1488
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
@@ -1452,7 +1496,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1452
1496
  @distributed_trace_async
1453
1497
  async def set_job_status_bulk(
1454
1498
  self,
1455
- body: Union[Dict[str, Dict[str, _models.JobStatusUpdate]], IO],
1499
+ body: Union[Dict[str, Dict[str, _models.JobStatusUpdate]], IO[bytes]],
1456
1500
  *,
1457
1501
  force: bool = False,
1458
1502
  **kwargs: Any,
@@ -1461,13 +1505,10 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1461
1505
 
1462
1506
  Set Job Status Bulk.
1463
1507
 
1464
- :param body: Is either a {str: {str: JobStatusUpdate}} type or a IO type. Required.
1465
- :type body: dict[str, dict[str, ~client.models.JobStatusUpdate]] or IO
1508
+ :param body: Is either a {str: {str: JobStatusUpdate}} type or a IO[bytes] type. Required.
1509
+ :type body: dict[str, dict[str, ~client.models.JobStatusUpdate]] or IO[bytes]
1466
1510
  :keyword force: Default value is False.
1467
1511
  :paramtype force: bool
1468
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
1469
- Default value is None.
1470
- :paramtype content_type: str
1471
1512
  :return: dict mapping str to SetJobStatusReturn
1472
1513
  :rtype: dict[str, ~client.models.SetJobStatusReturn]
1473
1514
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1496,7 +1537,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1496
1537
  else:
1497
1538
  _json = self._serialize.body(body, "{{JobStatusUpdate}}")
1498
1539
 
1499
- request = build_jobs_set_job_status_bulk_request(
1540
+ _request = build_jobs_set_job_status_bulk_request(
1500
1541
  force=force,
1501
1542
  content_type=content_type,
1502
1543
  json=_json,
@@ -1504,18 +1545,20 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1504
1545
  headers=_headers,
1505
1546
  params=_params,
1506
1547
  )
1507
- request.url = self._client.format_url(request.url)
1548
+ _request.url = self._client.format_url(_request.url)
1508
1549
 
1509
1550
  _stream = False
1510
1551
  pipeline_response: PipelineResponse = (
1511
1552
  await self._client._pipeline.run( # pylint: disable=protected-access
1512
- request, stream=_stream, **kwargs
1553
+ _request, stream=_stream, **kwargs
1513
1554
  )
1514
1555
  )
1515
1556
 
1516
1557
  response = pipeline_response.http_response
1517
1558
 
1518
1559
  if response.status_code not in [200]:
1560
+ if _stream:
1561
+ await response.read() # Load the body in memory and close the socket
1519
1562
  map_error(
1520
1563
  status_code=response.status_code, response=response, error_map=error_map
1521
1564
  )
@@ -1524,9 +1567,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1524
1567
  deserialized = self._deserialize("{SetJobStatusReturn}", pipeline_response)
1525
1568
 
1526
1569
  if cls:
1527
- return cls(pipeline_response, deserialized, {})
1570
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1528
1571
 
1529
- return deserialized
1572
+ return deserialized # type: ignore
1530
1573
 
1531
1574
  @distributed_trace_async
1532
1575
  async def get_job_status_history_bulk(
@@ -1555,23 +1598,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1555
1598
 
1556
1599
  cls: ClsType[Dict[str, List[_models.JobStatusReturn]]] = kwargs.pop("cls", None)
1557
1600
 
1558
- request = build_jobs_get_job_status_history_bulk_request(
1601
+ _request = build_jobs_get_job_status_history_bulk_request(
1559
1602
  job_ids=job_ids,
1560
1603
  headers=_headers,
1561
1604
  params=_params,
1562
1605
  )
1563
- request.url = self._client.format_url(request.url)
1606
+ _request.url = self._client.format_url(_request.url)
1564
1607
 
1565
1608
  _stream = False
1566
1609
  pipeline_response: PipelineResponse = (
1567
1610
  await self._client._pipeline.run( # pylint: disable=protected-access
1568
- request, stream=_stream, **kwargs
1611
+ _request, stream=_stream, **kwargs
1569
1612
  )
1570
1613
  )
1571
1614
 
1572
1615
  response = pipeline_response.http_response
1573
1616
 
1574
1617
  if response.status_code not in [200]:
1618
+ if _stream:
1619
+ await response.read() # Load the body in memory and close the socket
1575
1620
  map_error(
1576
1621
  status_code=response.status_code, response=response, error_map=error_map
1577
1622
  )
@@ -1580,9 +1625,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1580
1625
  deserialized = self._deserialize("{[JobStatusReturn]}", pipeline_response)
1581
1626
 
1582
1627
  if cls:
1583
- return cls(pipeline_response, deserialized, {})
1628
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1584
1629
 
1585
- return deserialized
1630
+ return deserialized # type: ignore
1586
1631
 
1587
1632
  @distributed_trace_async
1588
1633
  async def reschedule_bulk_jobs(self, *, job_ids: List[int], **kwargs: Any) -> Any:
@@ -1609,23 +1654,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1609
1654
 
1610
1655
  cls: ClsType[Any] = kwargs.pop("cls", None)
1611
1656
 
1612
- request = build_jobs_reschedule_bulk_jobs_request(
1657
+ _request = build_jobs_reschedule_bulk_jobs_request(
1613
1658
  job_ids=job_ids,
1614
1659
  headers=_headers,
1615
1660
  params=_params,
1616
1661
  )
1617
- request.url = self._client.format_url(request.url)
1662
+ _request.url = self._client.format_url(_request.url)
1618
1663
 
1619
1664
  _stream = False
1620
1665
  pipeline_response: PipelineResponse = (
1621
1666
  await self._client._pipeline.run( # pylint: disable=protected-access
1622
- request, stream=_stream, **kwargs
1667
+ _request, stream=_stream, **kwargs
1623
1668
  )
1624
1669
  )
1625
1670
 
1626
1671
  response = pipeline_response.http_response
1627
1672
 
1628
1673
  if response.status_code not in [200]:
1674
+ if _stream:
1675
+ await response.read() # Load the body in memory and close the socket
1629
1676
  map_error(
1630
1677
  status_code=response.status_code, response=response, error_map=error_map
1631
1678
  )
@@ -1634,9 +1681,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1634
1681
  deserialized = self._deserialize("object", pipeline_response)
1635
1682
 
1636
1683
  if cls:
1637
- return cls(pipeline_response, deserialized, {})
1684
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1638
1685
 
1639
- return deserialized
1686
+ return deserialized # type: ignore
1640
1687
 
1641
1688
  @distributed_trace_async
1642
1689
  async def reschedule_single_job(self, job_id: int, **kwargs: Any) -> Any:
@@ -1663,23 +1710,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1663
1710
 
1664
1711
  cls: ClsType[Any] = kwargs.pop("cls", None)
1665
1712
 
1666
- request = build_jobs_reschedule_single_job_request(
1713
+ _request = build_jobs_reschedule_single_job_request(
1667
1714
  job_id=job_id,
1668
1715
  headers=_headers,
1669
1716
  params=_params,
1670
1717
  )
1671
- request.url = self._client.format_url(request.url)
1718
+ _request.url = self._client.format_url(_request.url)
1672
1719
 
1673
1720
  _stream = False
1674
1721
  pipeline_response: PipelineResponse = (
1675
1722
  await self._client._pipeline.run( # pylint: disable=protected-access
1676
- request, stream=_stream, **kwargs
1723
+ _request, stream=_stream, **kwargs
1677
1724
  )
1678
1725
  )
1679
1726
 
1680
1727
  response = pipeline_response.http_response
1681
1728
 
1682
1729
  if response.status_code not in [200]:
1730
+ if _stream:
1731
+ await response.read() # Load the body in memory and close the socket
1683
1732
  map_error(
1684
1733
  status_code=response.status_code, response=response, error_map=error_map
1685
1734
  )
@@ -1688,9 +1737,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1688
1737
  deserialized = self._deserialize("object", pipeline_response)
1689
1738
 
1690
1739
  if cls:
1691
- return cls(pipeline_response, deserialized, {})
1740
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1692
1741
 
1693
- return deserialized
1742
+ return deserialized # type: ignore
1694
1743
 
1695
1744
  @overload
1696
1745
  async def search(
@@ -1725,7 +1774,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1725
1774
  @overload
1726
1775
  async def search(
1727
1776
  self,
1728
- body: Optional[IO] = None,
1777
+ body: Optional[IO[bytes]] = None,
1729
1778
  *,
1730
1779
  page: int = 0,
1731
1780
  per_page: int = 100,
@@ -1739,7 +1788,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1739
1788
  **TODO: Add more docs**.
1740
1789
 
1741
1790
  :param body: Default value is None.
1742
- :type body: IO
1791
+ :type body: IO[bytes]
1743
1792
  :keyword page: Default value is 0.
1744
1793
  :paramtype page: int
1745
1794
  :keyword per_page: Default value is 100.
@@ -1755,7 +1804,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1755
1804
  @distributed_trace_async
1756
1805
  async def search(
1757
1806
  self,
1758
- body: Optional[Union[_models.JobSearchParams, IO]] = None,
1807
+ body: Optional[Union[_models.JobSearchParams, IO[bytes]]] = None,
1759
1808
  *,
1760
1809
  page: int = 0,
1761
1810
  per_page: int = 100,
@@ -1767,15 +1816,12 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1767
1816
 
1768
1817
  **TODO: Add more docs**.
1769
1818
 
1770
- :param body: Is either a JobSearchParams type or a IO type. Default value is None.
1771
- :type body: ~client.models.JobSearchParams or IO
1819
+ :param body: Is either a JobSearchParams type or a IO[bytes] type. Default value is None.
1820
+ :type body: ~client.models.JobSearchParams or IO[bytes]
1772
1821
  :keyword page: Default value is 0.
1773
1822
  :paramtype page: int
1774
1823
  :keyword per_page: Default value is 100.
1775
1824
  :paramtype per_page: int
1776
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
1777
- Default value is None.
1778
- :paramtype content_type: str
1779
1825
  :return: list of JSON
1780
1826
  :rtype: list[JSON]
1781
1827
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1807,7 +1853,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1807
1853
  else:
1808
1854
  _json = None
1809
1855
 
1810
- request = build_jobs_search_request(
1856
+ _request = build_jobs_search_request(
1811
1857
  page=page,
1812
1858
  per_page=per_page,
1813
1859
  content_type=content_type,
@@ -1816,18 +1862,20 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1816
1862
  headers=_headers,
1817
1863
  params=_params,
1818
1864
  )
1819
- request.url = self._client.format_url(request.url)
1865
+ _request.url = self._client.format_url(_request.url)
1820
1866
 
1821
1867
  _stream = False
1822
1868
  pipeline_response: PipelineResponse = (
1823
1869
  await self._client._pipeline.run( # pylint: disable=protected-access
1824
- request, stream=_stream, **kwargs
1870
+ _request, stream=_stream, **kwargs
1825
1871
  )
1826
1872
  )
1827
1873
 
1828
1874
  response = pipeline_response.http_response
1829
1875
 
1830
1876
  if response.status_code not in [200]:
1877
+ if _stream:
1878
+ await response.read() # Load the body in memory and close the socket
1831
1879
  map_error(
1832
1880
  status_code=response.status_code, response=response, error_map=error_map
1833
1881
  )
@@ -1836,9 +1884,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1836
1884
  deserialized = self._deserialize("[object]", pipeline_response)
1837
1885
 
1838
1886
  if cls:
1839
- return cls(pipeline_response, deserialized, {})
1887
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1840
1888
 
1841
- return deserialized
1889
+ return deserialized # type: ignore
1842
1890
 
1843
1891
  @overload
1844
1892
  async def summary(
@@ -1864,14 +1912,14 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1864
1912
 
1865
1913
  @overload
1866
1914
  async def summary(
1867
- self, body: IO, *, content_type: str = "application/json", **kwargs: Any
1915
+ self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
1868
1916
  ) -> Any:
1869
1917
  """Summary.
1870
1918
 
1871
1919
  Show information suitable for plotting.
1872
1920
 
1873
1921
  :param body: Required.
1874
- :type body: IO
1922
+ :type body: IO[bytes]
1875
1923
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1876
1924
  Default value is "application/json".
1877
1925
  :paramtype content_type: str
@@ -1882,17 +1930,14 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1882
1930
 
1883
1931
  @distributed_trace_async
1884
1932
  async def summary(
1885
- self, body: Union[_models.JobSummaryParams, IO], **kwargs: Any
1933
+ self, body: Union[_models.JobSummaryParams, IO[bytes]], **kwargs: Any
1886
1934
  ) -> Any:
1887
1935
  """Summary.
1888
1936
 
1889
1937
  Show information suitable for plotting.
1890
1938
 
1891
- :param body: Is either a JobSummaryParams type or a IO type. Required.
1892
- :type body: ~client.models.JobSummaryParams or IO
1893
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
1894
- Default value is None.
1895
- :paramtype content_type: str
1939
+ :param body: Is either a JobSummaryParams type or a IO[bytes] type. Required.
1940
+ :type body: ~client.models.JobSummaryParams or IO[bytes]
1896
1941
  :return: any
1897
1942
  :rtype: any
1898
1943
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -1921,25 +1966,27 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1921
1966
  else:
1922
1967
  _json = self._serialize.body(body, "JobSummaryParams")
1923
1968
 
1924
- request = build_jobs_summary_request(
1969
+ _request = build_jobs_summary_request(
1925
1970
  content_type=content_type,
1926
1971
  json=_json,
1927
1972
  content=_content,
1928
1973
  headers=_headers,
1929
1974
  params=_params,
1930
1975
  )
1931
- request.url = self._client.format_url(request.url)
1976
+ _request.url = self._client.format_url(_request.url)
1932
1977
 
1933
1978
  _stream = False
1934
1979
  pipeline_response: PipelineResponse = (
1935
1980
  await self._client._pipeline.run( # pylint: disable=protected-access
1936
- request, stream=_stream, **kwargs
1981
+ _request, stream=_stream, **kwargs
1937
1982
  )
1938
1983
  )
1939
1984
 
1940
1985
  response = pipeline_response.http_response
1941
1986
 
1942
1987
  if response.status_code not in [200]:
1988
+ if _stream:
1989
+ await response.read() # Load the body in memory and close the socket
1943
1990
  map_error(
1944
1991
  status_code=response.status_code, response=response, error_map=error_map
1945
1992
  )
@@ -1948,9 +1995,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1948
1995
  deserialized = self._deserialize("object", pipeline_response)
1949
1996
 
1950
1997
  if cls:
1951
- return cls(pipeline_response, deserialized, {})
1998
+ return cls(pipeline_response, deserialized, {}) # type: ignore
1952
1999
 
1953
- return deserialized
2000
+ return deserialized # type: ignore
1954
2001
 
1955
2002
  @distributed_trace_async
1956
2003
  async def get_single_job(self, job_id: int, **kwargs: Any) -> Any:
@@ -1977,23 +2024,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
1977
2024
 
1978
2025
  cls: ClsType[Any] = kwargs.pop("cls", None)
1979
2026
 
1980
- request = build_jobs_get_single_job_request(
2027
+ _request = build_jobs_get_single_job_request(
1981
2028
  job_id=job_id,
1982
2029
  headers=_headers,
1983
2030
  params=_params,
1984
2031
  )
1985
- request.url = self._client.format_url(request.url)
2032
+ _request.url = self._client.format_url(_request.url)
1986
2033
 
1987
2034
  _stream = False
1988
2035
  pipeline_response: PipelineResponse = (
1989
2036
  await self._client._pipeline.run( # pylint: disable=protected-access
1990
- request, stream=_stream, **kwargs
2037
+ _request, stream=_stream, **kwargs
1991
2038
  )
1992
2039
  )
1993
2040
 
1994
2041
  response = pipeline_response.http_response
1995
2042
 
1996
2043
  if response.status_code not in [200]:
2044
+ if _stream:
2045
+ await response.read() # Load the body in memory and close the socket
1997
2046
  map_error(
1998
2047
  status_code=response.status_code, response=response, error_map=error_map
1999
2048
  )
@@ -2002,9 +2051,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2002
2051
  deserialized = self._deserialize("object", pipeline_response)
2003
2052
 
2004
2053
  if cls:
2005
- return cls(pipeline_response, deserialized, {})
2054
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2006
2055
 
2007
- return deserialized
2056
+ return deserialized # type: ignore
2008
2057
 
2009
2058
  @distributed_trace_async
2010
2059
  async def delete_single_job(self, job_id: int, **kwargs: Any) -> Any:
@@ -2031,23 +2080,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2031
2080
 
2032
2081
  cls: ClsType[Any] = kwargs.pop("cls", None)
2033
2082
 
2034
- request = build_jobs_delete_single_job_request(
2083
+ _request = build_jobs_delete_single_job_request(
2035
2084
  job_id=job_id,
2036
2085
  headers=_headers,
2037
2086
  params=_params,
2038
2087
  )
2039
- request.url = self._client.format_url(request.url)
2088
+ _request.url = self._client.format_url(_request.url)
2040
2089
 
2041
2090
  _stream = False
2042
2091
  pipeline_response: PipelineResponse = (
2043
2092
  await self._client._pipeline.run( # pylint: disable=protected-access
2044
- request, stream=_stream, **kwargs
2093
+ _request, stream=_stream, **kwargs
2045
2094
  )
2046
2095
  )
2047
2096
 
2048
2097
  response = pipeline_response.http_response
2049
2098
 
2050
2099
  if response.status_code not in [200]:
2100
+ if _stream:
2101
+ await response.read() # Load the body in memory and close the socket
2051
2102
  map_error(
2052
2103
  status_code=response.status_code, response=response, error_map=error_map
2053
2104
  )
@@ -2056,9 +2107,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2056
2107
  deserialized = self._deserialize("object", pipeline_response)
2057
2108
 
2058
2109
  if cls:
2059
- return cls(pipeline_response, deserialized, {})
2110
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2060
2111
 
2061
- return deserialized
2112
+ return deserialized # type: ignore
2062
2113
 
2063
2114
  @distributed_trace_async
2064
2115
  async def set_single_job_properties(
@@ -2096,7 +2147,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2096
2147
 
2097
2148
  _json = self._serialize.body(body, "object")
2098
2149
 
2099
- request = build_jobs_set_single_job_properties_request(
2150
+ _request = build_jobs_set_single_job_properties_request(
2100
2151
  job_id=job_id,
2101
2152
  update_timestamp=update_timestamp,
2102
2153
  content_type=content_type,
@@ -2104,18 +2155,20 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2104
2155
  headers=_headers,
2105
2156
  params=_params,
2106
2157
  )
2107
- request.url = self._client.format_url(request.url)
2158
+ _request.url = self._client.format_url(_request.url)
2108
2159
 
2109
2160
  _stream = False
2110
2161
  pipeline_response: PipelineResponse = (
2111
2162
  await self._client._pipeline.run( # pylint: disable=protected-access
2112
- request, stream=_stream, **kwargs
2163
+ _request, stream=_stream, **kwargs
2113
2164
  )
2114
2165
  )
2115
2166
 
2116
2167
  response = pipeline_response.http_response
2117
2168
 
2118
2169
  if response.status_code not in [200]:
2170
+ if _stream:
2171
+ await response.read() # Load the body in memory and close the socket
2119
2172
  map_error(
2120
2173
  status_code=response.status_code, response=response, error_map=error_map
2121
2174
  )
@@ -2124,9 +2177,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2124
2177
  deserialized = self._deserialize("object", pipeline_response)
2125
2178
 
2126
2179
  if cls:
2127
- return cls(pipeline_response, deserialized, {})
2180
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2128
2181
 
2129
- return deserialized
2182
+ return deserialized # type: ignore
2130
2183
 
2131
2184
  @distributed_trace_async
2132
2185
  async def kill_single_job(self, job_id: int, **kwargs: Any) -> Any:
@@ -2153,23 +2206,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2153
2206
 
2154
2207
  cls: ClsType[Any] = kwargs.pop("cls", None)
2155
2208
 
2156
- request = build_jobs_kill_single_job_request(
2209
+ _request = build_jobs_kill_single_job_request(
2157
2210
  job_id=job_id,
2158
2211
  headers=_headers,
2159
2212
  params=_params,
2160
2213
  )
2161
- request.url = self._client.format_url(request.url)
2214
+ _request.url = self._client.format_url(_request.url)
2162
2215
 
2163
2216
  _stream = False
2164
2217
  pipeline_response: PipelineResponse = (
2165
2218
  await self._client._pipeline.run( # pylint: disable=protected-access
2166
- request, stream=_stream, **kwargs
2219
+ _request, stream=_stream, **kwargs
2167
2220
  )
2168
2221
  )
2169
2222
 
2170
2223
  response = pipeline_response.http_response
2171
2224
 
2172
2225
  if response.status_code not in [200]:
2226
+ if _stream:
2227
+ await response.read() # Load the body in memory and close the socket
2173
2228
  map_error(
2174
2229
  status_code=response.status_code, response=response, error_map=error_map
2175
2230
  )
@@ -2178,9 +2233,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2178
2233
  deserialized = self._deserialize("object", pipeline_response)
2179
2234
 
2180
2235
  if cls:
2181
- return cls(pipeline_response, deserialized, {})
2236
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2182
2237
 
2183
- return deserialized
2238
+ return deserialized # type: ignore
2184
2239
 
2185
2240
  @distributed_trace_async
2186
2241
  async def remove_single_job(self, job_id: int, **kwargs: Any) -> Any:
@@ -2211,23 +2266,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2211
2266
 
2212
2267
  cls: ClsType[Any] = kwargs.pop("cls", None)
2213
2268
 
2214
- request = build_jobs_remove_single_job_request(
2269
+ _request = build_jobs_remove_single_job_request(
2215
2270
  job_id=job_id,
2216
2271
  headers=_headers,
2217
2272
  params=_params,
2218
2273
  )
2219
- request.url = self._client.format_url(request.url)
2274
+ _request.url = self._client.format_url(_request.url)
2220
2275
 
2221
2276
  _stream = False
2222
2277
  pipeline_response: PipelineResponse = (
2223
2278
  await self._client._pipeline.run( # pylint: disable=protected-access
2224
- request, stream=_stream, **kwargs
2279
+ _request, stream=_stream, **kwargs
2225
2280
  )
2226
2281
  )
2227
2282
 
2228
2283
  response = pipeline_response.http_response
2229
2284
 
2230
2285
  if response.status_code not in [200]:
2286
+ if _stream:
2287
+ await response.read() # Load the body in memory and close the socket
2231
2288
  map_error(
2232
2289
  status_code=response.status_code, response=response, error_map=error_map
2233
2290
  )
@@ -2236,9 +2293,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2236
2293
  deserialized = self._deserialize("object", pipeline_response)
2237
2294
 
2238
2295
  if cls:
2239
- return cls(pipeline_response, deserialized, {})
2296
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2240
2297
 
2241
- return deserialized
2298
+ return deserialized # type: ignore
2242
2299
 
2243
2300
  @distributed_trace_async
2244
2301
  async def get_single_job_status(
@@ -2269,23 +2326,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2269
2326
  "cls", None
2270
2327
  )
2271
2328
 
2272
- request = build_jobs_get_single_job_status_request(
2329
+ _request = build_jobs_get_single_job_status_request(
2273
2330
  job_id=job_id,
2274
2331
  headers=_headers,
2275
2332
  params=_params,
2276
2333
  )
2277
- request.url = self._client.format_url(request.url)
2334
+ _request.url = self._client.format_url(_request.url)
2278
2335
 
2279
2336
  _stream = False
2280
2337
  pipeline_response: PipelineResponse = (
2281
2338
  await self._client._pipeline.run( # pylint: disable=protected-access
2282
- request, stream=_stream, **kwargs
2339
+ _request, stream=_stream, **kwargs
2283
2340
  )
2284
2341
  )
2285
2342
 
2286
2343
  response = pipeline_response.http_response
2287
2344
 
2288
2345
  if response.status_code not in [200]:
2346
+ if _stream:
2347
+ await response.read() # Load the body in memory and close the socket
2289
2348
  map_error(
2290
2349
  status_code=response.status_code, response=response, error_map=error_map
2291
2350
  )
@@ -2294,9 +2353,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2294
2353
  deserialized = self._deserialize("{LimitedJobStatusReturn}", pipeline_response)
2295
2354
 
2296
2355
  if cls:
2297
- return cls(pipeline_response, deserialized, {})
2356
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2298
2357
 
2299
- return deserialized
2358
+ return deserialized # type: ignore
2300
2359
 
2301
2360
  @overload
2302
2361
  async def set_single_job_status(
@@ -2330,7 +2389,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2330
2389
  async def set_single_job_status(
2331
2390
  self,
2332
2391
  job_id: int,
2333
- body: IO,
2392
+ body: IO[bytes],
2334
2393
  *,
2335
2394
  force: bool = False,
2336
2395
  content_type: str = "application/json",
@@ -2343,7 +2402,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2343
2402
  :param job_id: Required.
2344
2403
  :type job_id: int
2345
2404
  :param body: Required.
2346
- :type body: IO
2405
+ :type body: IO[bytes]
2347
2406
  :keyword force: Default value is False.
2348
2407
  :paramtype force: bool
2349
2408
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
@@ -2358,7 +2417,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2358
2417
  async def set_single_job_status(
2359
2418
  self,
2360
2419
  job_id: int,
2361
- body: Union[Dict[str, _models.JobStatusUpdate], IO],
2420
+ body: Union[Dict[str, _models.JobStatusUpdate], IO[bytes]],
2362
2421
  *,
2363
2422
  force: bool = False,
2364
2423
  **kwargs: Any,
@@ -2369,13 +2428,10 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2369
2428
 
2370
2429
  :param job_id: Required.
2371
2430
  :type job_id: int
2372
- :param body: Is either a {str: JobStatusUpdate} type or a IO type. Required.
2373
- :type body: dict[str, ~client.models.JobStatusUpdate] or IO
2431
+ :param body: Is either a {str: JobStatusUpdate} type or a IO[bytes] type. Required.
2432
+ :type body: dict[str, ~client.models.JobStatusUpdate] or IO[bytes]
2374
2433
  :keyword force: Default value is False.
2375
2434
  :paramtype force: bool
2376
- :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
2377
- Default value is None.
2378
- :paramtype content_type: str
2379
2435
  :return: dict mapping str to SetJobStatusReturn
2380
2436
  :rtype: dict[str, ~client.models.SetJobStatusReturn]
2381
2437
  :raises ~azure.core.exceptions.HttpResponseError:
@@ -2404,7 +2460,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2404
2460
  else:
2405
2461
  _json = self._serialize.body(body, "{JobStatusUpdate}")
2406
2462
 
2407
- request = build_jobs_set_single_job_status_request(
2463
+ _request = build_jobs_set_single_job_status_request(
2408
2464
  job_id=job_id,
2409
2465
  force=force,
2410
2466
  content_type=content_type,
@@ -2413,18 +2469,20 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2413
2469
  headers=_headers,
2414
2470
  params=_params,
2415
2471
  )
2416
- request.url = self._client.format_url(request.url)
2472
+ _request.url = self._client.format_url(_request.url)
2417
2473
 
2418
2474
  _stream = False
2419
2475
  pipeline_response: PipelineResponse = (
2420
2476
  await self._client._pipeline.run( # pylint: disable=protected-access
2421
- request, stream=_stream, **kwargs
2477
+ _request, stream=_stream, **kwargs
2422
2478
  )
2423
2479
  )
2424
2480
 
2425
2481
  response = pipeline_response.http_response
2426
2482
 
2427
2483
  if response.status_code not in [200]:
2484
+ if _stream:
2485
+ await response.read() # Load the body in memory and close the socket
2428
2486
  map_error(
2429
2487
  status_code=response.status_code, response=response, error_map=error_map
2430
2488
  )
@@ -2433,9 +2491,9 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2433
2491
  deserialized = self._deserialize("{SetJobStatusReturn}", pipeline_response)
2434
2492
 
2435
2493
  if cls:
2436
- return cls(pipeline_response, deserialized, {})
2494
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2437
2495
 
2438
- return deserialized
2496
+ return deserialized # type: ignore
2439
2497
 
2440
2498
  @distributed_trace_async
2441
2499
  async def get_single_job_status_history(
@@ -2464,23 +2522,25 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2464
2522
 
2465
2523
  cls: ClsType[Dict[str, List[_models.JobStatusReturn]]] = kwargs.pop("cls", None)
2466
2524
 
2467
- request = build_jobs_get_single_job_status_history_request(
2525
+ _request = build_jobs_get_single_job_status_history_request(
2468
2526
  job_id=job_id,
2469
2527
  headers=_headers,
2470
2528
  params=_params,
2471
2529
  )
2472
- request.url = self._client.format_url(request.url)
2530
+ _request.url = self._client.format_url(_request.url)
2473
2531
 
2474
2532
  _stream = False
2475
2533
  pipeline_response: PipelineResponse = (
2476
2534
  await self._client._pipeline.run( # pylint: disable=protected-access
2477
- request, stream=_stream, **kwargs
2535
+ _request, stream=_stream, **kwargs
2478
2536
  )
2479
2537
  )
2480
2538
 
2481
2539
  response = pipeline_response.http_response
2482
2540
 
2483
2541
  if response.status_code not in [200]:
2542
+ if _stream:
2543
+ await response.read() # Load the body in memory and close the socket
2484
2544
  map_error(
2485
2545
  status_code=response.status_code, response=response, error_map=error_map
2486
2546
  )
@@ -2489,6 +2549,6 @@ class JobsOperations: # pylint: disable=too-many-public-methods
2489
2549
  deserialized = self._deserialize("{[JobStatusReturn]}", pipeline_response)
2490
2550
 
2491
2551
  if cls:
2492
- return cls(pipeline_response, deserialized, {})
2552
+ return cls(pipeline_response, deserialized, {}) # type: ignore
2493
2553
 
2494
- return deserialized
2554
+ return deserialized # type: ignore