Skip to content

Commit

Permalink
Storage: sourceGeneration in copy_blob googleapis#4533
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebelloni committed Dec 7, 2017
1 parent 67e8c54 commit ac7cd2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage/google/cloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def delete_blobs(self, blobs, on_error=None, client=None):
raise

def copy_blob(self, blob, destination_bucket, new_name=None,
client=None, preserve_acl=True):
client=None, preserve_acl=True, source_generation=None):
"""Copy the given blob to the given bucket, optionally with a new name.
If :attr:`user_project` is set, bills the API request to that project.
Expand Down Expand Up @@ -687,6 +687,9 @@ def copy_blob(self, blob, destination_bucket, new_name=None,
if self.user_project is not None:
query_params['userProject'] = self.user_project

if source_generation is not None:
query_params['sourceGeneration'] = source_generation

if new_name is None:
new_name = blob.name

Expand Down

0 comments on commit ac7cd2b

Please sign in to comment.