@@ -2022,6 +2022,9 @@ def rename_blob(
20222022 This method will first duplicate the data and then delete the
20232023 old blob. This means that with very large objects renaming
20242024 could be a very (temporarily) costly or a very slow operation.
2025+ If you need more control over the copy and deletion, instead
2026+ use `google.cloud.storage.blob.Blob.copy_to` and
2027+ `google.cloud.storage.blob.Blob.delete` directly.
20252028
20262029 :type blob: :class:`google.cloud.storage.blob.Blob`
20272030 :param blob: The blob to be renamed.
@@ -2079,25 +2082,29 @@ def rename_blob(
20792082 :param if_source_generation_match: (Optional) Makes the operation
20802083 conditional on whether the source
20812084 object's generation matches the
2082- given value.
2085+ given value. Also used in the
2086+ delete request.
20832087
20842088 :type if_source_generation_not_match: long
20852089 :param if_source_generation_not_match: (Optional) Makes the operation
20862090 conditional on whether the source
20872091 object's generation does not match
2088- the given value.
2092+ the given value. Also used in the
2093+ delete request.
20892094
20902095 :type if_source_metageneration_match: long
20912096 :param if_source_metageneration_match: (Optional) Makes the operation
20922097 conditional on whether the source
20932098 object's current metageneration
2094- matches the given value.
2099+ matches the given value.Also used in the
2100+ delete request.
20952101
20962102 :type if_source_metageneration_not_match: long
20972103 :param if_source_metageneration_not_match: (Optional) Makes the operation
20982104 conditional on whether the source
20992105 object's current metageneration
21002106 does not match the given value.
2107+ Also used in the delete request.
21012108
21022109 :type retry: google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy
21032110 :param retry: (Optional) How to retry the RPC. A None value will disable retries.
@@ -2139,10 +2146,10 @@ def rename_blob(
21392146 blob .delete (
21402147 client = client ,
21412148 timeout = timeout ,
2142- if_generation_match = if_generation_match ,
2143- if_generation_not_match = if_generation_not_match ,
2144- if_metageneration_match = if_metageneration_match ,
2145- if_metageneration_not_match = if_metageneration_not_match ,
2149+ if_generation_match = if_source_generation_match ,
2150+ if_generation_not_match = if_source_generation_not_match ,
2151+ if_metageneration_match = if_source_metageneration_match ,
2152+ if_metageneration_not_match = if_source_metageneration_not_match ,
21462153 retry = retry ,
21472154 )
21482155 return new_blob
0 commit comments