|
7 | 7 | # pylint: disable=invalid-overridden-method |
8 | 8 | import functools |
9 | 9 | from typing import ( # pylint: disable=unused-import |
10 | | - Union, Optional, Any, Dict, TYPE_CHECKING, |
11 | | - AsyncIterator) |
12 | | - |
13 | | -from azure.core.pipeline.transport import AsyncHttpResponse |
| 10 | + Union, Optional, Any, Dict, |
| 11 | + TYPE_CHECKING |
| 12 | +) |
14 | 13 |
|
15 | 14 | from azure.core.exceptions import HttpResponseError |
16 | 15 | from azure.core.tracing.decorator import distributed_trace |
@@ -716,71 +715,72 @@ async def delete_file(self, file, # type: Union[FileProperties, str] |
716 | 715 | await file_client.delete_file(**kwargs) |
717 | 716 | return file_client |
718 | 717 |
|
719 | | - @distributed_trace_async |
720 | | - async def delete_files(self, *files, **kwargs): |
721 | | - # type: (...) -> AsyncIterator[AsyncHttpResponse] |
722 | | - """Marks the specified files or empty directories for deletion. |
723 | | -
|
724 | | - The files/empty directories are later deleted during garbage collection. |
725 | | -
|
726 | | - If a delete retention policy is enabled for the service, then this operation soft deletes the |
727 | | - files/empty directories and retains the files or snapshots for specified number of days. |
728 | | - After specified number of days, files' data is removed from the service during garbage collection. |
729 | | - Soft deleted files/empty directories are accessible through :func:`list_deleted_paths()`. |
730 | | -
|
731 | | - :param files: |
732 | | - The files/empty directories to delete. This can be a single file/empty directory, or multiple values can |
733 | | - be supplied, where each value is either the name of the file/directory (str) or |
734 | | - FileProperties/DirectoryProperties. |
735 | | -
|
736 | | - .. note:: |
737 | | - When the file/dir type is dict, here's a list of keys, value rules. |
738 | | -
|
739 | | - blob name: |
740 | | - key: 'name', value type: str |
741 | | - if the file modified or not: |
742 | | - key: 'if_modified_since', 'if_unmodified_since', value type: datetime |
743 | | - etag: |
744 | | - key: 'etag', value type: str |
745 | | - match the etag or not: |
746 | | - key: 'match_condition', value type: MatchConditions |
747 | | - lease: |
748 | | - key: 'lease_id', value type: Union[str, LeaseClient] |
749 | | - timeout for subrequest: |
750 | | - key: 'timeout', value type: int |
751 | | -
|
752 | | - :type files: list[str], list[dict], |
753 | | - or list[Union[~azure.storage.filedatalake.FileProperties, ~azure.storage.filedatalake.DirectoryProperties] |
754 | | - :keyword ~datetime.datetime if_modified_since: |
755 | | - A DateTime value. Azure expects the date value passed in to be UTC. |
756 | | - If timezone is included, any non-UTC datetimes will be converted to UTC. |
757 | | - If a date is passed in without timezone info, it is assumed to be UTC. |
758 | | - Specify this header to perform the operation only |
759 | | - if the resource has been modified since the specified time. |
760 | | - :keyword ~datetime.datetime if_unmodified_since: |
761 | | - A DateTime value. Azure expects the date value passed in to be UTC. |
762 | | - If timezone is included, any non-UTC datetimes will be converted to UTC. |
763 | | - If a date is passed in without timezone info, it is assumed to be UTC. |
764 | | - Specify this header to perform the operation only if |
765 | | - the resource has not been modified since the specified date/time. |
766 | | - :keyword bool raise_on_any_failure: |
767 | | - This is a boolean param which defaults to True. When this is set, an exception |
768 | | - is raised even if there is a single operation failure. |
769 | | - :keyword int timeout: |
770 | | - The timeout parameter is expressed in seconds. |
771 | | - :return: An iterator of responses, one for each blob in order |
772 | | - :rtype: AsyncIterator[~azure.core.pipeline.transport.AsyncHttpResponse] |
773 | | -
|
774 | | - .. admonition:: Example: |
775 | | -
|
776 | | - .. literalinclude:: ../samples/datalake_samples_file_system_async.py |
777 | | - :start-after: [START batch_delete_files_or_empty_directories] |
778 | | - :end-before: [END batch_delete_files_or_empty_directories] |
779 | | - :language: python |
780 | | - :dedent: 4 |
781 | | - :caption: Deleting multiple files or empty directories. |
782 | | - """ |
783 | | - return await self._container_client.delete_blobs(*files, **kwargs) |
| 718 | + # TODO: Temporarily removing this for GA release. |
| 719 | + # @distributed_trace_async |
| 720 | + # async def delete_files(self, *files, **kwargs): |
| 721 | + # # type: (...) -> AsyncIterator[AsyncHttpResponse] |
| 722 | + # """Marks the specified files or empty directories for deletion. |
| 723 | + |
| 724 | + # The files/empty directories are later deleted during garbage collection. |
| 725 | + |
| 726 | + # If a delete retention policy is enabled for the service, then this operation soft deletes the |
| 727 | + # files/empty directories and retains the files or snapshots for specified number of days. |
| 728 | + # After specified number of days, files' data is removed from the service during garbage collection. |
| 729 | + # Soft deleted files/empty directories are accessible through :func:`list_deleted_paths()`. |
| 730 | + |
| 731 | + # :param files: |
| 732 | + # The files/empty directories to delete. This can be a single file/empty directory, or multiple values can |
| 733 | + # be supplied, where each value is either the name of the file/directory (str) or |
| 734 | + # FileProperties/DirectoryProperties. |
| 735 | + |
| 736 | + # .. note:: |
| 737 | + # When the file/dir type is dict, here's a list of keys, value rules. |
| 738 | + |
| 739 | + # blob name: |
| 740 | + # key: 'name', value type: str |
| 741 | + # if the file modified or not: |
| 742 | + # key: 'if_modified_since', 'if_unmodified_since', value type: datetime |
| 743 | + # etag: |
| 744 | + # key: 'etag', value type: str |
| 745 | + # match the etag or not: |
| 746 | + # key: 'match_condition', value type: MatchConditions |
| 747 | + # lease: |
| 748 | + # key: 'lease_id', value type: Union[str, LeaseClient] |
| 749 | + # timeout for subrequest: |
| 750 | + # key: 'timeout', value type: int |
| 751 | + |
| 752 | + # :type files: list[str], list[dict], |
| 753 | + # or list[Union[~azure.storage.filedatalake.FileProperties, ~azure.storage.filedatalake.DirectoryProperties] |
| 754 | + # :keyword ~datetime.datetime if_modified_since: |
| 755 | + # A DateTime value. Azure expects the date value passed in to be UTC. |
| 756 | + # If timezone is included, any non-UTC datetimes will be converted to UTC. |
| 757 | + # If a date is passed in without timezone info, it is assumed to be UTC. |
| 758 | + # Specify this header to perform the operation only |
| 759 | + # if the resource has been modified since the specified time. |
| 760 | + # :keyword ~datetime.datetime if_unmodified_since: |
| 761 | + # A DateTime value. Azure expects the date value passed in to be UTC. |
| 762 | + # If timezone is included, any non-UTC datetimes will be converted to UTC. |
| 763 | + # If a date is passed in without timezone info, it is assumed to be UTC. |
| 764 | + # Specify this header to perform the operation only if |
| 765 | + # the resource has not been modified since the specified date/time. |
| 766 | + # :keyword bool raise_on_any_failure: |
| 767 | + # This is a boolean param which defaults to True. When this is set, an exception |
| 768 | + # is raised even if there is a single operation failure. |
| 769 | + # :keyword int timeout: |
| 770 | + # The timeout parameter is expressed in seconds. |
| 771 | + # :return: An iterator of responses, one for each blob in order |
| 772 | + # :rtype: AsyncIterator[~azure.core.pipeline.transport.AsyncHttpResponse] |
| 773 | + |
| 774 | + # .. admonition:: Example: |
| 775 | + |
| 776 | + # .. literalinclude:: ../samples/datalake_samples_file_system_async.py |
| 777 | + # :start-after: [START batch_delete_files_or_empty_directories] |
| 778 | + # :end-before: [END batch_delete_files_or_empty_directories] |
| 779 | + # :language: python |
| 780 | + # :dedent: 4 |
| 781 | + # :caption: Deleting multiple files or empty directories. |
| 782 | + # """ |
| 783 | + # return await self._container_client.delete_blobs(*files, **kwargs) |
784 | 784 |
|
785 | 785 | @distributed_trace_async |
786 | 786 | async def _undelete_path(self, deleted_path_name, deletion_id, **kwargs): |
|
0 commit comments