From 7101f47fde663eec4bbaaa246c7fe4e973ca2506 Mon Sep 17 00:00:00 2001 From: cojenco Date: Thu, 11 Aug 2022 12:06:10 -0700 Subject: [PATCH] docs: clarify prefixes entity in list_blobs and link sample (#837) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve documentation as part of 294 - clarify `prefixes` entity exists as part of the response - add link to sample broswer ["List the objects in a bucket using a prefix filter"](https://cloud.google.com/storage/docs/samples/storage-list-files-with-prefix#storage_list_files_with_prefix-python) Fixes #294 🦕 --- google/cloud/storage/client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/google/cloud/storage/client.py b/google/cloud/storage/client.py index acf675fbe..05a64f57f 100644 --- a/google/cloud/storage/client.py +++ b/google/cloud/storage/client.py @@ -1271,14 +1271,14 @@ def list_blobs( Iterator of all :class:`~google.cloud.storage.blob.Blob` in this bucket matching the arguments. - Example: - List blobs in the bucket with user_project. + As part of the response, you'll also get back an iterator.prefixes entity that lists object names + up to and including the requested delimiter. Duplicate entries are omitted from this list. - >>> from google.cloud import storage - >>> client = storage.Client() + .. note:: + List prefixes (directories) in a bucket using a prefix and delimiter. + See a [sample](https://cloud.google.com/storage/docs/samples/storage-list-files-with-prefix#storage_list_files_with_prefix-python) + listing objects using a prefix filter. - >>> bucket = storage.Bucket(client, "my-bucket-name", user_project="my-project") - >>> all_blobs = list(client.list_blobs(bucket)) """ bucket = self._bucket_arg_to_bucket(bucket_or_name)