@@ -260,23 +260,19 @@ def close(self):
260
260
261
261
262
262
class RewrapManyDataKeyResult (object ):
263
- def __init__ (self , bulk_write_result : Optional [BulkWriteResult ] = None ) -> None :
264
- """Result object returned by a ``rewrap_many_data_key`` operation.
263
+ """Result object returned by a :meth:`~ClientEncryption.rewrap_many_data_key` operation.
265
264
266
- :Parameters:
267
- - `bulk_write_result`: The result of the bulk write operation used to
268
- update the key vault collection with one or more rewrapped data keys.
269
- If ``rewrap_many_data_key()`` does not find any matching keys to
270
- rewrap, no bulk write operation will be executed and this field will
271
- be ``None``.
272
- """
265
+ .. versionadded:: 4.2
266
+ """
267
+
268
+ def __init__ (self , bulk_write_result : Optional [BulkWriteResult ] = None ) -> None :
273
269
self ._bulk_write_result = bulk_write_result
274
270
275
271
@property
276
272
def bulk_write_result (self ) -> Optional [BulkWriteResult ]:
277
273
"""The result of the bulk write operation used to update the key vault
278
274
collection with one or more rewrapped data keys. If
279
- `` rewrap_many_data_key()` ` does not find any matching keys to rewrap,
275
+ :meth:`~ClientEncryption. rewrap_many_data_key` does not find any matching keys to rewrap,
280
276
no bulk write operation will be executed and this field will be
281
277
``None``.
282
278
"""
@@ -717,6 +713,8 @@ def get_key(self, id: Binary) -> Optional[RawBSONDocument]:
717
713
718
714
:Returns:
719
715
The key document.
716
+
717
+ .. versionadded:: 4.2
720
718
"""
721
719
self ._check_closed ()
722
720
return self ._key_vault_coll .find_one ({"_id" : id })
@@ -727,6 +725,8 @@ def get_keys(self) -> Cursor[RawBSONDocument]:
727
725
:Returns:
728
726
An instance of :class:`~pymongo.cursor.Cursor` over the data key
729
727
documents.
728
+
729
+ .. versionadded:: 4.2
730
730
"""
731
731
self ._check_closed ()
732
732
return self ._key_vault_coll .find ({})
@@ -741,6 +741,8 @@ def delete_key(self, id: Binary) -> DeleteResult:
741
741
742
742
:Returns:
743
743
The delete result.
744
+
745
+ .. versionadded:: 4.2
744
746
"""
745
747
self ._check_closed ()
746
748
return self ._key_vault_coll .delete_one ({"_id" : id })
@@ -756,6 +758,8 @@ def add_key_alt_name(self, id: Binary, key_alt_name: str) -> Any:
756
758
757
759
:Returns:
758
760
The previous version of the key document.
761
+
762
+ .. versionadded:: 4.2
759
763
"""
760
764
self ._check_closed ()
761
765
update = {"$addToSet" : {"keyAltNames" : key_alt_name }}
@@ -769,6 +773,8 @@ def get_key_by_alt_name(self, key_alt_name: str) -> Optional[RawBSONDocument]:
769
773
770
774
:Returns:
771
775
The key document.
776
+
777
+ .. versionadded:: 4.2
772
778
"""
773
779
self ._check_closed ()
774
780
return self ._key_vault_coll .find_one ({"keyAltNames" : key_alt_name })
@@ -786,6 +792,8 @@ def remove_key_alt_name(self, id: Binary, key_alt_name: str) -> Optional[RawBSON
786
792
787
793
:Returns:
788
794
Returns the previous version of the key document.
795
+
796
+ .. versionadded:: 4.2
789
797
"""
790
798
self ._check_closed ()
791
799
pipeline = [
@@ -825,6 +833,8 @@ def rewrap_many_data_key(
825
833
826
834
:Returns:
827
835
A :class:`RewrapManyDataKeyResult`.
836
+
837
+ .. versionadded:: 4.2
828
838
"""
829
839
self ._check_closed ()
830
840
with _wrap_encryption_errors ():
0 commit comments