Skip to content
Permalink
Browse files
fix(storage): add documentaion of list_blobs with user project (#147)
  • Loading branch information
HemangChothani committed May 18, 2020
1 parent ddad20b commit 792b21fd2263b518d56f79cab6a4a1bb06c6e4e7
Showing with 18 additions and 0 deletions.
  1. +9 −0 google/cloud/storage/bucket.py
  2. +9 −0 google/cloud/storage/client.py
@@ -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}

@@ -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(

0 comments on commit 792b21f

Please sign in to comment.