azure-storage-blob 12.19.0b1__py3-none-any.whl → 12.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- azure/storage/blob/__init__.py +17 -5
- azure/storage/blob/_blob_client.py +26 -6
- azure/storage/blob/_blob_service_client.py +11 -4
- azure/storage/blob/_container_client.py +45 -17
- azure/storage/blob/_download.py +5 -4
- azure/storage/blob/_encryption.py +254 -165
- azure/storage/blob/_generated/_azure_blob_storage.py +21 -3
- azure/storage/blob/_generated/_configuration.py +4 -11
- azure/storage/blob/_generated/_serialization.py +41 -49
- azure/storage/blob/_generated/aio/_azure_blob_storage.py +23 -3
- azure/storage/blob/_generated/aio/_configuration.py +4 -11
- azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +24 -58
- azure/storage/blob/_generated/aio/operations/_blob_operations.py +123 -306
- azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +37 -86
- azure/storage/blob/_generated/aio/operations/_container_operations.py +98 -289
- azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +51 -150
- azure/storage/blob/_generated/aio/operations/_service_operations.py +49 -125
- azure/storage/blob/_generated/models/_models_py3.py +31 -31
- azure/storage/blob/_generated/operations/_append_blob_operations.py +25 -59
- azure/storage/blob/_generated/operations/_blob_operations.py +123 -306
- azure/storage/blob/_generated/operations/_block_blob_operations.py +39 -88
- azure/storage/blob/_generated/operations/_container_operations.py +100 -291
- azure/storage/blob/_generated/operations/_page_blob_operations.py +52 -151
- azure/storage/blob/_generated/operations/_service_operations.py +50 -126
- azure/storage/blob/_lease.py +1 -0
- azure/storage/blob/_models.py +3 -4
- azure/storage/blob/_serialize.py +1 -0
- azure/storage/blob/_shared/authentication.py +1 -1
- azure/storage/blob/_shared/avro/avro_io.py +0 -6
- azure/storage/blob/_shared/avro/avro_io_async.py +0 -6
- azure/storage/blob/_shared/avro/datafile.py +0 -4
- azure/storage/blob/_shared/avro/datafile_async.py +0 -4
- azure/storage/blob/_shared/avro/schema.py +4 -4
- azure/storage/blob/_shared/base_client.py +72 -87
- azure/storage/blob/_shared/base_client_async.py +115 -27
- azure/storage/blob/_shared/models.py +120 -27
- azure/storage/blob/_shared/parser.py +7 -6
- azure/storage/blob/_shared/policies.py +96 -66
- azure/storage/blob/_shared/policies_async.py +48 -21
- azure/storage/blob/_shared/response_handlers.py +14 -16
- azure/storage/blob/_shared/shared_access_signature.py +3 -3
- azure/storage/blob/_shared_access_signature.py +48 -33
- azure/storage/blob/_upload_helpers.py +4 -7
- azure/storage/blob/_version.py +1 -1
- azure/storage/blob/aio/__init__.py +13 -4
- azure/storage/blob/aio/_blob_client_async.py +17 -6
- azure/storage/blob/aio/_blob_service_client_async.py +6 -3
- azure/storage/blob/aio/_container_client_async.py +34 -13
- azure/storage/blob/aio/_download_async.py +11 -10
- azure/storage/blob/aio/_encryption_async.py +72 -0
- azure/storage/blob/aio/_lease_async.py +1 -1
- azure/storage/blob/aio/_upload_helpers.py +8 -10
- {azure_storage_blob-12.19.0b1.dist-info → azure_storage_blob-12.20.0.dist-info}/METADATA +11 -11
- azure_storage_blob-12.20.0.dist-info/RECORD +81 -0
- {azure_storage_blob-12.19.0b1.dist-info → azure_storage_blob-12.20.0.dist-info}/WHEEL +1 -1
- azure_storage_blob-12.19.0b1.dist-info/RECORD +0 -80
- {azure_storage_blob-12.19.0b1.dist-info → azure_storage_blob-12.20.0.dist-info}/LICENSE +0 -0
- {azure_storage_blob-12.19.0b1.dist-info → azure_storage_blob-12.20.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
# pylint: disable=too-many-lines
|
1
|
+
# pylint: disable=too-many-lines,too-many-statements
|
2
2
|
# coding=utf-8
|
3
3
|
# --------------------------------------------------------------------------
|
4
4
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
@@ -7,8 +7,7 @@
|
|
7
7
|
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
8
8
|
# --------------------------------------------------------------------------
|
9
9
|
import datetime
|
10
|
-
import
|
11
|
-
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union
|
10
|
+
from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union
|
12
11
|
|
13
12
|
from azure.core.exceptions import (
|
14
13
|
ClientAuthenticationError,
|
@@ -35,10 +34,6 @@ from ...operations._block_blob_operations import (
|
|
35
34
|
build_upload_request,
|
36
35
|
)
|
37
36
|
|
38
|
-
if sys.version_info >= (3, 8):
|
39
|
-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
|
40
|
-
else:
|
41
|
-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
|
42
37
|
T = TypeVar("T")
|
43
38
|
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
44
39
|
|
@@ -66,7 +61,7 @@ class BlockBlobOperations:
|
|
66
61
|
async def upload( # pylint: disable=inconsistent-return-statements
|
67
62
|
self,
|
68
63
|
content_length: int,
|
69
|
-
body: IO,
|
64
|
+
body: IO[bytes],
|
70
65
|
timeout: Optional[int] = None,
|
71
66
|
transactional_content_md5: Optional[bytes] = None,
|
72
67
|
metadata: Optional[Dict[str, str]] = None,
|
@@ -93,7 +88,7 @@ class BlockBlobOperations:
|
|
93
88
|
:param content_length: The length of the request. Required.
|
94
89
|
:type content_length: int
|
95
90
|
:param body: Initial data. Required.
|
96
|
-
:type body: IO
|
91
|
+
:type body: IO[bytes]
|
97
92
|
:param timeout: The timeout parameter is expressed in seconds. For more information, see
|
98
93
|
:code:`<a
|
99
94
|
href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
|
@@ -142,11 +137,6 @@ class BlockBlobOperations:
|
|
142
137
|
:type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo
|
143
138
|
:param modified_access_conditions: Parameter group. Default value is None.
|
144
139
|
:type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
|
145
|
-
:keyword blob_type: Specifies the type of blob to create: block blob, page blob, or append
|
146
|
-
blob. Default value is "BlockBlob". Note that overriding this default value may result in
|
147
|
-
unsupported behavior.
|
148
|
-
:paramtype blob_type: str
|
149
|
-
:keyword callable cls: A custom type or function that will be passed the direct response
|
150
140
|
:return: None or the result of cls(response)
|
151
141
|
:rtype: None
|
152
142
|
:raises ~azure.core.exceptions.HttpResponseError:
|
@@ -205,7 +195,7 @@ class BlockBlobOperations:
|
|
205
195
|
_if_unmodified_since = modified_access_conditions.if_unmodified_since
|
206
196
|
_content = body
|
207
197
|
|
208
|
-
|
198
|
+
_request = build_upload_request(
|
209
199
|
url=self._config.url,
|
210
200
|
content_length=content_length,
|
211
201
|
timeout=timeout,
|
@@ -238,16 +228,15 @@ class BlockBlobOperations:
|
|
238
228
|
content_type=content_type,
|
239
229
|
version=self._config.version,
|
240
230
|
content=_content,
|
241
|
-
template_url=self.upload.metadata["url"],
|
242
231
|
headers=_headers,
|
243
232
|
params=_params,
|
244
233
|
)
|
245
|
-
|
246
|
-
|
234
|
+
_request = _convert_request(_request)
|
235
|
+
_request.url = self._client.format_url(_request.url)
|
247
236
|
|
248
237
|
_stream = False
|
249
238
|
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
250
|
-
|
239
|
+
_request, stream=_stream, **kwargs
|
251
240
|
)
|
252
241
|
|
253
242
|
response = pipeline_response.http_response
|
@@ -279,9 +268,7 @@ class BlockBlobOperations:
|
|
279
268
|
)
|
280
269
|
|
281
270
|
if cls:
|
282
|
-
return cls(pipeline_response, None, response_headers)
|
283
|
-
|
284
|
-
upload.metadata = {"url": "{url}"}
|
271
|
+
return cls(pipeline_response, None, response_headers) # type: ignore
|
285
272
|
|
286
273
|
@distributed_trace_async
|
287
274
|
async def put_blob_from_url( # pylint: disable=inconsistent-return-statements
|
@@ -372,11 +359,6 @@ class BlockBlobOperations:
|
|
372
359
|
:param source_modified_access_conditions: Parameter group. Default value is None.
|
373
360
|
:type source_modified_access_conditions:
|
374
361
|
~azure.storage.blob.models.SourceModifiedAccessConditions
|
375
|
-
:keyword blob_type: Specifies the type of blob to create: block blob, page blob, or append
|
376
|
-
blob. Default value is "BlockBlob". Note that overriding this default value may result in
|
377
|
-
unsupported behavior.
|
378
|
-
:paramtype blob_type: str
|
379
|
-
:keyword callable cls: A custom type or function that will be passed the direct response
|
380
362
|
:return: None or the result of cls(response)
|
381
363
|
:rtype: None
|
382
364
|
:raises ~azure.core.exceptions.HttpResponseError:
|
@@ -444,7 +426,7 @@ class BlockBlobOperations:
|
|
444
426
|
_source_if_tags = source_modified_access_conditions.source_if_tags
|
445
427
|
_source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since
|
446
428
|
|
447
|
-
|
429
|
+
_request = build_put_blob_from_url_request(
|
448
430
|
url=self._config.url,
|
449
431
|
content_length=content_length,
|
450
432
|
copy_source=copy_source,
|
@@ -481,16 +463,15 @@ class BlockBlobOperations:
|
|
481
463
|
copy_source_tags=copy_source_tags,
|
482
464
|
blob_type=blob_type,
|
483
465
|
version=self._config.version,
|
484
|
-
template_url=self.put_blob_from_url.metadata["url"],
|
485
466
|
headers=_headers,
|
486
467
|
params=_params,
|
487
468
|
)
|
488
|
-
|
489
|
-
|
469
|
+
_request = _convert_request(_request)
|
470
|
+
_request.url = self._client.format_url(_request.url)
|
490
471
|
|
491
472
|
_stream = False
|
492
473
|
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
493
|
-
|
474
|
+
_request, stream=_stream, **kwargs
|
494
475
|
)
|
495
476
|
|
496
477
|
response = pipeline_response.http_response
|
@@ -522,16 +503,14 @@ class BlockBlobOperations:
|
|
522
503
|
)
|
523
504
|
|
524
505
|
if cls:
|
525
|
-
return cls(pipeline_response, None, response_headers)
|
526
|
-
|
527
|
-
put_blob_from_url.metadata = {"url": "{url}"}
|
506
|
+
return cls(pipeline_response, None, response_headers) # type: ignore
|
528
507
|
|
529
508
|
@distributed_trace_async
|
530
509
|
async def stage_block( # pylint: disable=inconsistent-return-statements
|
531
510
|
self,
|
532
511
|
block_id: str,
|
533
512
|
content_length: int,
|
534
|
-
body: IO,
|
513
|
+
body: IO[bytes],
|
535
514
|
transactional_content_md5: Optional[bytes] = None,
|
536
515
|
transactional_content_crc64: Optional[bytes] = None,
|
537
516
|
timeout: Optional[int] = None,
|
@@ -550,7 +529,7 @@ class BlockBlobOperations:
|
|
550
529
|
:param content_length: The length of the request. Required.
|
551
530
|
:type content_length: int
|
552
531
|
:param body: Initial data. Required.
|
553
|
-
:type body: IO
|
532
|
+
:type body: IO[bytes]
|
554
533
|
:param transactional_content_md5: Specify the transactional md5 for the body, to be validated
|
555
534
|
by the service. Default value is None.
|
556
535
|
:type transactional_content_md5: bytes
|
@@ -572,10 +551,6 @@ class BlockBlobOperations:
|
|
572
551
|
:type cpk_info: ~azure.storage.blob.models.CpkInfo
|
573
552
|
:param cpk_scope_info: Parameter group. Default value is None.
|
574
553
|
:type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo
|
575
|
-
:keyword comp: comp. Default value is "block". Note that overriding this default value may
|
576
|
-
result in unsupported behavior.
|
577
|
-
:paramtype comp: str
|
578
|
-
:keyword callable cls: A custom type or function that will be passed the direct response
|
579
554
|
:return: None or the result of cls(response)
|
580
555
|
:rtype: None
|
581
556
|
:raises ~azure.core.exceptions.HttpResponseError:
|
@@ -610,7 +585,7 @@ class BlockBlobOperations:
|
|
610
585
|
_encryption_scope = cpk_scope_info.encryption_scope
|
611
586
|
_content = body
|
612
587
|
|
613
|
-
|
588
|
+
_request = build_stage_block_request(
|
614
589
|
url=self._config.url,
|
615
590
|
block_id=block_id,
|
616
591
|
content_length=content_length,
|
@@ -627,16 +602,15 @@ class BlockBlobOperations:
|
|
627
602
|
content_type=content_type,
|
628
603
|
version=self._config.version,
|
629
604
|
content=_content,
|
630
|
-
template_url=self.stage_block.metadata["url"],
|
631
605
|
headers=_headers,
|
632
606
|
params=_params,
|
633
607
|
)
|
634
|
-
|
635
|
-
|
608
|
+
_request = _convert_request(_request)
|
609
|
+
_request.url = self._client.format_url(_request.url)
|
636
610
|
|
637
611
|
_stream = False
|
638
612
|
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
639
|
-
|
613
|
+
_request, stream=_stream, **kwargs
|
640
614
|
)
|
641
615
|
|
642
616
|
response = pipeline_response.http_response
|
@@ -668,9 +642,7 @@ class BlockBlobOperations:
|
|
668
642
|
)
|
669
643
|
|
670
644
|
if cls:
|
671
|
-
return cls(pipeline_response, None, response_headers)
|
672
|
-
|
673
|
-
stage_block.metadata = {"url": "{url}"}
|
645
|
+
return cls(pipeline_response, None, response_headers) # type: ignore
|
674
646
|
|
675
647
|
@distributed_trace_async
|
676
648
|
async def stage_block_from_url( # pylint: disable=inconsistent-return-statements
|
@@ -730,10 +702,6 @@ class BlockBlobOperations:
|
|
730
702
|
:param source_modified_access_conditions: Parameter group. Default value is None.
|
731
703
|
:type source_modified_access_conditions:
|
732
704
|
~azure.storage.blob.models.SourceModifiedAccessConditions
|
733
|
-
:keyword comp: comp. Default value is "block". Note that overriding this default value may
|
734
|
-
result in unsupported behavior.
|
735
|
-
:paramtype comp: str
|
736
|
-
:keyword callable cls: A custom type or function that will be passed the direct response
|
737
705
|
:return: None or the result of cls(response)
|
738
706
|
:rtype: None
|
739
707
|
:raises ~azure.core.exceptions.HttpResponseError:
|
@@ -775,7 +743,7 @@ class BlockBlobOperations:
|
|
775
743
|
_source_if_none_match = source_modified_access_conditions.source_if_none_match
|
776
744
|
_source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since
|
777
745
|
|
778
|
-
|
746
|
+
_request = build_stage_block_from_url_request(
|
779
747
|
url=self._config.url,
|
780
748
|
block_id=block_id,
|
781
749
|
content_length=content_length,
|
@@ -797,16 +765,15 @@ class BlockBlobOperations:
|
|
797
765
|
copy_source_authorization=copy_source_authorization,
|
798
766
|
comp=comp,
|
799
767
|
version=self._config.version,
|
800
|
-
template_url=self.stage_block_from_url.metadata["url"],
|
801
768
|
headers=_headers,
|
802
769
|
params=_params,
|
803
770
|
)
|
804
|
-
|
805
|
-
|
771
|
+
_request = _convert_request(_request)
|
772
|
+
_request.url = self._client.format_url(_request.url)
|
806
773
|
|
807
774
|
_stream = False
|
808
775
|
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
809
|
-
|
776
|
+
_request, stream=_stream, **kwargs
|
810
777
|
)
|
811
778
|
|
812
779
|
response = pipeline_response.http_response
|
@@ -838,9 +805,7 @@ class BlockBlobOperations:
|
|
838
805
|
)
|
839
806
|
|
840
807
|
if cls:
|
841
|
-
return cls(pipeline_response, None, response_headers)
|
842
|
-
|
843
|
-
stage_block_from_url.metadata = {"url": "{url}"}
|
808
|
+
return cls(pipeline_response, None, response_headers) # type: ignore
|
844
809
|
|
845
810
|
@distributed_trace_async
|
846
811
|
async def commit_block_list( # pylint: disable=inconsistent-return-statements
|
@@ -921,10 +886,6 @@ class BlockBlobOperations:
|
|
921
886
|
:type cpk_scope_info: ~azure.storage.blob.models.CpkScopeInfo
|
922
887
|
:param modified_access_conditions: Parameter group. Default value is None.
|
923
888
|
:type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
|
924
|
-
:keyword comp: comp. Default value is "blocklist". Note that overriding this default value may
|
925
|
-
result in unsupported behavior.
|
926
|
-
:paramtype comp: str
|
927
|
-
:keyword callable cls: A custom type or function that will be passed the direct response
|
928
889
|
:return: None or the result of cls(response)
|
929
890
|
:rtype: None
|
930
891
|
:raises ~azure.core.exceptions.HttpResponseError:
|
@@ -983,7 +944,7 @@ class BlockBlobOperations:
|
|
983
944
|
_if_unmodified_since = modified_access_conditions.if_unmodified_since
|
984
945
|
_content = self._serialize.body(blocks, "BlockLookupList", is_xml=True)
|
985
946
|
|
986
|
-
|
947
|
+
_request = build_commit_block_list_request(
|
987
948
|
url=self._config.url,
|
988
949
|
timeout=timeout,
|
989
950
|
blob_cache_control=_blob_cache_control,
|
@@ -1015,16 +976,15 @@ class BlockBlobOperations:
|
|
1015
976
|
content_type=content_type,
|
1016
977
|
version=self._config.version,
|
1017
978
|
content=_content,
|
1018
|
-
template_url=self.commit_block_list.metadata["url"],
|
1019
979
|
headers=_headers,
|
1020
980
|
params=_params,
|
1021
981
|
)
|
1022
|
-
|
1023
|
-
|
982
|
+
_request = _convert_request(_request)
|
983
|
+
_request.url = self._client.format_url(_request.url)
|
1024
984
|
|
1025
985
|
_stream = False
|
1026
986
|
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
1027
|
-
|
987
|
+
_request, stream=_stream, **kwargs
|
1028
988
|
)
|
1029
989
|
|
1030
990
|
response = pipeline_response.http_response
|
@@ -1059,9 +1019,7 @@ class BlockBlobOperations:
|
|
1059
1019
|
)
|
1060
1020
|
|
1061
1021
|
if cls:
|
1062
|
-
return cls(pipeline_response, None, response_headers)
|
1063
|
-
|
1064
|
-
commit_block_list.metadata = {"url": "{url}"}
|
1022
|
+
return cls(pipeline_response, None, response_headers) # type: ignore
|
1065
1023
|
|
1066
1024
|
@distributed_trace_async
|
1067
1025
|
async def get_block_list(
|
@@ -1100,10 +1058,6 @@ class BlockBlobOperations:
|
|
1100
1058
|
:type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
|
1101
1059
|
:param modified_access_conditions: Parameter group. Default value is None.
|
1102
1060
|
:type modified_access_conditions: ~azure.storage.blob.models.ModifiedAccessConditions
|
1103
|
-
:keyword comp: comp. Default value is "blocklist". Note that overriding this default value may
|
1104
|
-
result in unsupported behavior.
|
1105
|
-
:paramtype comp: str
|
1106
|
-
:keyword callable cls: A custom type or function that will be passed the direct response
|
1107
1061
|
:return: BlockList or the result of cls(response)
|
1108
1062
|
:rtype: ~azure.storage.blob.models.BlockList
|
1109
1063
|
:raises ~azure.core.exceptions.HttpResponseError:
|
@@ -1129,7 +1083,7 @@ class BlockBlobOperations:
|
|
1129
1083
|
if modified_access_conditions is not None:
|
1130
1084
|
_if_tags = modified_access_conditions.if_tags
|
1131
1085
|
|
1132
|
-
|
1086
|
+
_request = build_get_block_list_request(
|
1133
1087
|
url=self._config.url,
|
1134
1088
|
snapshot=snapshot,
|
1135
1089
|
list_type=list_type,
|
@@ -1139,16 +1093,15 @@ class BlockBlobOperations:
|
|
1139
1093
|
request_id_parameter=request_id_parameter,
|
1140
1094
|
comp=comp,
|
1141
1095
|
version=self._config.version,
|
1142
|
-
template_url=self.get_block_list.metadata["url"],
|
1143
1096
|
headers=_headers,
|
1144
1097
|
params=_params,
|
1145
1098
|
)
|
1146
|
-
|
1147
|
-
|
1099
|
+
_request = _convert_request(_request)
|
1100
|
+
_request.url = self._client.format_url(_request.url)
|
1148
1101
|
|
1149
1102
|
_stream = False
|
1150
1103
|
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
|
1151
|
-
|
1104
|
+
_request, stream=_stream, **kwargs
|
1152
1105
|
)
|
1153
1106
|
|
1154
1107
|
response = pipeline_response.http_response
|
@@ -1175,8 +1128,6 @@ class BlockBlobOperations:
|
|
1175
1128
|
deserialized = self._deserialize("BlockList", pipeline_response)
|
1176
1129
|
|
1177
1130
|
if cls:
|
1178
|
-
return cls(pipeline_response, deserialized, response_headers)
|
1179
|
-
|
1180
|
-
return deserialized
|
1131
|
+
return cls(pipeline_response, deserialized, response_headers) # type: ignore
|
1181
1132
|
|
1182
|
-
|
1133
|
+
return deserialized # type: ignore
|