| 759 | self.invalidate_cache(path) |
| 760 | |
| 761 | def rm(self, path, recursive=False, maxdepth=None, **kwargs) -> None: |
| 762 | bucket, key, version_id = self.parse_path(path) |
| 763 | if not key: |
| 764 | raise ValueError("Cannot delete the bucket.") |
| 765 | |
| 766 | expand_path = self.expand_path(path, recursive=recursive, maxdepth=maxdepth) |
| 767 | self._delete_objects(bucket, expand_path, **kwargs) |
| 768 | for p in expand_path: |
| 769 | self.invalidate_cache(p) |
| 770 | |
| 771 | def _delete_object( |
| 772 | self, bucket: str, key: str, version_id: str | None = None, **kwargs |