azure-storage-blob 12.26.0__py3-none-any.whl → 12.27.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.
Files changed (50) hide show
  1. azure/storage/blob/__init__.py +3 -3
  2. azure/storage/blob/_blob_client.py +16 -0
  3. azure/storage/blob/_blob_client.pyi +780 -0
  4. azure/storage/blob/_blob_service_client.py +41 -4
  5. azure/storage/blob/_blob_service_client.pyi +182 -0
  6. azure/storage/blob/_container_client.py +22 -0
  7. azure/storage/blob/_container_client.pyi +380 -0
  8. azure/storage/blob/_generated/_azure_blob_storage.py +3 -2
  9. azure/storage/blob/_generated/_configuration.py +2 -2
  10. azure/storage/blob/_generated/_utils/__init__.py +6 -0
  11. azure/storage/blob/_generated/{_serialization.py → _utils/serialization.py} +4 -22
  12. azure/storage/blob/_generated/aio/_azure_blob_storage.py +3 -2
  13. azure/storage/blob/_generated/aio/_configuration.py +2 -2
  14. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +6 -10
  15. azure/storage/blob/_generated/aio/operations/_blob_operations.py +35 -39
  16. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +9 -13
  17. azure/storage/blob/_generated/aio/operations/_container_operations.py +20 -24
  18. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +13 -17
  19. azure/storage/blob/_generated/aio/operations/_service_operations.py +10 -14
  20. azure/storage/blob/_generated/models/_models_py3.py +30 -9
  21. azure/storage/blob/_generated/operations/_append_blob_operations.py +11 -15
  22. azure/storage/blob/_generated/operations/_blob_operations.py +60 -64
  23. azure/storage/blob/_generated/operations/_block_blob_operations.py +16 -20
  24. azure/storage/blob/_generated/operations/_container_operations.py +39 -43
  25. azure/storage/blob/_generated/operations/_page_blob_operations.py +23 -27
  26. azure/storage/blob/_generated/operations/_service_operations.py +19 -23
  27. azure/storage/blob/_lease.py +2 -2
  28. azure/storage/blob/_lease.pyi +81 -0
  29. azure/storage/blob/_list_blobs_helper.py +1 -1
  30. azure/storage/blob/_serialize.py +1 -0
  31. azure/storage/blob/_shared/base_client.py +0 -13
  32. azure/storage/blob/_shared/base_client_async.py +0 -22
  33. azure/storage/blob/_shared/models.py +1 -0
  34. azure/storage/blob/_shared/policies.py +10 -2
  35. azure/storage/blob/_shared/response_handlers.py +5 -0
  36. azure/storage/blob/_version.py +1 -1
  37. azure/storage/blob/aio/__init__.py +5 -8
  38. azure/storage/blob/aio/_blob_client_async.py +28 -8
  39. azure/storage/blob/aio/_blob_client_async.pyi +763 -0
  40. azure/storage/blob/aio/_blob_service_client_async.py +41 -4
  41. azure/storage/blob/aio/_blob_service_client_async.pyi +187 -0
  42. azure/storage/blob/aio/_container_client_async.py +27 -1
  43. azure/storage/blob/aio/_container_client_async.pyi +384 -0
  44. azure/storage/blob/aio/_lease_async.py +2 -2
  45. azure/storage/blob/aio/_lease_async.pyi +81 -0
  46. {azure_storage_blob-12.26.0.dist-info → azure_storage_blob-12.27.0.dist-info}/METADATA +17 -5
  47. {azure_storage_blob-12.26.0.dist-info → azure_storage_blob-12.27.0.dist-info}/RECORD +50 -41
  48. {azure_storage_blob-12.26.0.dist-info → azure_storage_blob-12.27.0.dist-info}/WHEEL +1 -1
  49. {azure_storage_blob-12.26.0.dist-info → azure_storage_blob-12.27.0.dist-info/licenses}/LICENSE +0 -0
  50. {azure_storage_blob-12.26.0.dist-info → azure_storage_blob-12.27.0.dist-info}/top_level.txt +0 -0
@@ -125,8 +125,8 @@ def upload_blob_to_url(
125
125
  :return: Blob-updated property dict (Etag and last modified)
126
126
  :rtype: dict(str, Any)
127
127
  """
128
- with BlobClient.from_blob_url(blob_url, credential=credential) as client:
129
- return cast(BlobClient, client).upload_blob(data=data, blob_type=BlobType.BLOCKBLOB, **kwargs)
128
+ with BlobClient.from_blob_url(blob_url, credential=credential) as client: # pylint: disable=not-context-manager
129
+ return client.upload_blob(data=data, blob_type=BlobType.BLOCKBLOB, **kwargs)
130
130
 
131
131
 
132
132
  def _download_to_stream(client: BlobClient, handle: IO[bytes], **kwargs: Any) -> None:
@@ -194,7 +194,7 @@ def download_blob_from_url(
194
194
  :rtype: None
195
195
  """
196
196
  overwrite = kwargs.pop('overwrite', False)
197
- with BlobClient.from_blob_url(blob_url, credential=credential) as client:
197
+ with BlobClient.from_blob_url(blob_url, credential=credential) as client: # pylint: disable=not-context-manager
198
198
  if hasattr(output, 'write'):
199
199
  _download_to_stream(client, cast(IO[bytes], output), **kwargs)
200
200
  else:
@@ -190,6 +190,22 @@ class BlobClient(StorageAccountHostsMixin, StorageEncryptionMixin): # pylint: d
190
190
  self._client._config.version = get_api_version(kwargs) # type: ignore [assignment]
191
191
  self._configure_encryption(kwargs)
192
192
 
193
+ def __enter__(self) -> Self:
194
+ self._client.__enter__()
195
+ return self
196
+
197
+ def __exit__(self, *args) -> None:
198
+ self._client.__exit__(*args)
199
+
200
+ def close(self) -> None:
201
+ """This method is to close the sockets opened by the client.
202
+ It need not be used when using with a context manager.
203
+
204
+ :return: None
205
+ :rtype: None
206
+ """
207
+ self._client.close()
208
+
193
209
  def _format_url(self, hostname: str) -> str:
194
210
  return _format_url(
195
211
  container_name=self.container_name,