Skip to content

Commit

Permalink
fix(storage): add documentaion of list_blobs with user project (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
HemangChothani committed May 18, 2020
1 parent ddad20b commit 792b21f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions google/cloud/storage/bucket.py
Expand Up @@ -1054,6 +1054,15 @@ def list_blobs(
:rtype: :class:`~google.api_core.page_iterator.Iterator`
:returns: Iterator of all :class:`~google.cloud.storage.blob.Blob`
in this bucket matching the arguments.
Example:
List blobs in the bucket with user_project.
>>> from google.cloud import storage
>>> client = storage.Client()
>>> bucket = storage.Bucket("my-bucket-name", user_project='my-project')
>>> all_blobs = list(bucket.list_blobs())
"""
extra_params = {"projection": projection}

Expand Down
9 changes: 9 additions & 0 deletions google/cloud/storage/client.py
Expand Up @@ -657,6 +657,15 @@ def list_blobs(
Returns:
Iterator of all :class:`~google.cloud.storage.blob.Blob`
in this bucket matching the arguments.
Example:
List blobs in the bucket with user_project.
>>> from google.cloud import storage
>>> client = storage.Client()
>>> bucket = storage.Bucket("my-bucket-name", user_project='my-project')
>>> all_blobs = list(client.list_blobs(bucket))
"""
bucket = self._bucket_arg_to_bucket(bucket_or_name)
return bucket.list_blobs(
Expand Down

0 comments on commit 792b21f

Please sign in to comment.