Skip to content

Commit 4b654b5

Browse files
Gurov Ilyafrankyn
andauthored
refactor(storage): deprecate preserve_acl arg in copy_blob() method (#104)
* refactor(storage): deprecate preserve_acl arg in copy_blob() method * Revert "refactor(storage): deprecate preserve_acl arg in copy_blob() method" This reverts commit edd0137. * add deprecation warning into docs, provide a snippet of how to copy ACL Co-authored-by: Frank Natividad <[email protected]>
1 parent 76bd652 commit 4b654b5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

google/cloud/storage/bucket.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,8 @@ def copy_blob(
12721272
to the ``client`` stored on the current bucket.
12731273
12741274
:type preserve_acl: bool
1275-
:param preserve_acl: (Optional) Copies ACL from old blob to new blob.
1275+
:param preserve_acl: DEPRECATED. This argument is not functional!
1276+
(Optional) Copies ACL from old blob to new blob.
12761277
Default: True.
12771278
12781279
:type source_generation: long
@@ -1288,6 +1289,20 @@ def copy_blob(
12881289
12891290
:rtype: :class:`google.cloud.storage.blob.Blob`
12901291
:returns: The new Blob.
1292+
1293+
Example:
1294+
Copy a blob including ACL.
1295+
1296+
>>> from google.cloud import storage
1297+
1298+
>>> client = storage.Client(project="project")
1299+
1300+
>>> bucket = client.bucket("bucket")
1301+
>>> dst_bucket = client.bucket("destination-bucket")
1302+
1303+
>>> blob = bucket.blob("file.ext")
1304+
>>> new_blob = bucket.copy_blob(blob, dst_bucket)
1305+
>>> new_blob.acl.save(blob.acl)
12911306
"""
12921307
client = self._require_client(client)
12931308
query_params = {}

0 commit comments

Comments
 (0)