@@ -1228,6 +1228,9 @@ def set_immutability_policy(
1228
1228
.. versionadded:: 12.10.0
1229
1229
This was introduced in API version '2020-10-02'.
1230
1230
1231
+ :keyword str version_id:
1232
+ The version id parameter is an opaque DateTime
1233
+ value that, when present, specifies the version of the blob to check if it exists.
1231
1234
:keyword int timeout:
1232
1235
Sets the server-side timeout for the operation in seconds. For more details see
1233
1236
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
@@ -1238,9 +1241,11 @@ def set_immutability_policy(
1238
1241
:rtype: Dict[str, str]
1239
1242
"""
1240
1243
1244
+ version_id = get_version_id (self .version_id , kwargs )
1241
1245
kwargs ['immutability_policy_expiry' ] = immutability_policy .expiry_time
1242
1246
kwargs ['immutability_policy_mode' ] = immutability_policy .policy_mode
1243
- return cast (Dict [str , str ], self ._client .blob .set_immutability_policy (cls = return_response_headers , ** kwargs ))
1247
+ return cast (Dict [str , str ], self ._client .blob .set_immutability_policy (
1248
+ cls = return_response_headers , version_id = version_id , ** kwargs ))
1244
1249
1245
1250
@distributed_trace
1246
1251
def delete_immutability_policy (self , ** kwargs : Any ) -> None :
@@ -1249,6 +1254,9 @@ def delete_immutability_policy(self, **kwargs: Any) -> None:
1249
1254
.. versionadded:: 12.10.0
1250
1255
This operation was introduced in API version '2020-10-02'.
1251
1256
1257
+ :keyword str version_id:
1258
+ The version id parameter is an opaque DateTime
1259
+ value that, when present, specifies the version of the blob to check if it exists.
1252
1260
:keyword int timeout:
1253
1261
Sets the server-side timeout for the operation in seconds. For more details see
1254
1262
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
@@ -1259,7 +1267,8 @@ def delete_immutability_policy(self, **kwargs: Any) -> None:
1259
1267
:rtype: Dict[str, str]
1260
1268
"""
1261
1269
1262
- self ._client .blob .delete_immutability_policy (** kwargs )
1270
+ version_id = get_version_id (self .version_id , kwargs )
1271
+ self ._client .blob .delete_immutability_policy (version_id = version_id , ** kwargs )
1263
1272
1264
1273
@distributed_trace
1265
1274
def set_legal_hold (self , legal_hold : bool , ** kwargs : Any ) -> Dict [str , Union [str , datetime , bool ]]:
@@ -1270,6 +1279,9 @@ def set_legal_hold(self, legal_hold: bool, **kwargs: Any) -> Dict[str, Union[str
1270
1279
1271
1280
:param bool legal_hold:
1272
1281
Specified if a legal hold should be set on the blob.
1282
+ :keyword str version_id:
1283
+ The version id parameter is an opaque DateTime
1284
+ value that, when present, specifies the version of the blob to check if it exists.
1273
1285
:keyword int timeout:
1274
1286
Sets the server-side timeout for the operation in seconds. For more details see
1275
1287
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations.
@@ -1280,8 +1292,9 @@ def set_legal_hold(self, legal_hold: bool, **kwargs: Any) -> Dict[str, Union[str
1280
1292
:rtype: Dict[str, Union[str, datetime, bool]]
1281
1293
"""
1282
1294
1283
- return cast (Dict [str , Union [str , datetime , bool ]],
1284
- self ._client .blob .set_legal_hold (legal_hold , cls = return_response_headers , ** kwargs ))
1295
+ version_id = get_version_id (self .version_id , kwargs )
1296
+ return cast (Dict [str , Union [str , datetime , bool ]], self ._client .blob .set_legal_hold (
1297
+ legal_hold , version_id = version_id , cls = return_response_headers , ** kwargs ))
1285
1298
1286
1299
@distributed_trace
1287
1300
def create_page_blob (
0 commit comments