Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clarify prefixes entity in list_blobs and link sample #837

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions google/cloud/storage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
cojenco marked this conversation as resolved.
Show resolved Hide resolved
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)

Expand Down