fC!dZddlmZddlmZmZmZmZddlm Z GddZ Gdde Z Gd d e Z Gd d e Z Gd de ZGdde Zy)zResult class definitions.) annotations)AnyMappingOptionalcast)InvalidOperationc>eZdZdZdZddZd dZd dZed dZ y) _WriteResultz$Base class for write result classes.)__acknowledgedc||_yN_WriteResult__acknowledged)self acknowledgeds X/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/pymongo/results.py__init__z_WriteResult.__init__s *cN|jjd|jdS)N()) __class____name__rrs r__repr__z_WriteResult.__repr__s'..))*!D,?,?+@BBrc:|jstd|dy)z8Raise an exception on property access if unacknowledged.z A value for zi is not available when the write is unacknowledged. Check the acknowledged attribute to avoid this error.N)rr)r property_names r_raise_if_unacknowledgedz%_WriteResult._raise_if_unacknowledged"s."""}o. #rc|jS)aCIs this the result of an acknowledged write operation? The :attr:`acknowledged` attribute will be ``False`` when using ``WriteConcern(w=0)``, otherwise ``True``. .. note:: If the :attr:`acknowledged` attribute is ``False`` all other attributes of this class will raise :class:`~pymongo.errors.InvalidOperation` when accessed. Values for other attributes cannot be determined if the write operation was unacknowledged. .. seealso:: :class:`~pymongo.write_concern.WriteConcern` rrs rrz_WriteResult.acknowledged,s""""rN)rboolreturnNoner!str)rr$r!r")r!r ) r __module__ __qualname____doc__ __slots__rrrpropertyrrrr r s..#I+C##rr cBeZdZdZdZdfd ZddZeddZxZ S) InsertOneResultzFThe return type for :meth:`~pymongo.collection.Collection.insert_one`.) __inserted_idc2||_t| |yr )_InsertOneResult__inserted_idsuperr)r inserted_idrrs rrzInsertOneResult.__init__Es( &rch|jjd|jd|jdSNrz, acknowledged=r)rrr/rrs rrzInsertOneResult.__repr__Is7~~&&'q););(>odN_N_M``a b rc|jS)zThe inserted document's _id.)r/rs rr1zInsertOneResult.inserted_idNs!!!r)r1rrr r!r"r#r!r) rr%r&r'r(rrr)r1 __classcell__rs@rr,r,@s)P"I' ""rr,cBeZdZdZdZdfd ZddZeddZxZ S) InsertManyResultzGThe return type for :meth:`~pymongo.collection.Collection.insert_many`.)__inserted_idsc2||_t| |yr )_InsertManyResult__inserted_idsr0r)r inserted_idsrrs rrzInsertManyResult.__init__Ys* &rch|jjd|jd|jdSr3)rrr<rrs rrzInsertManyResult.__repr__]s7~~&&'q)<)<(?tO`O`Naab c rc|jS)a@A list of _ids of the inserted documents, in the order provided. .. note:: If ``False`` is passed for the `ordered` parameter to :meth:`~pymongo.collection.Collection.insert_many` the server may have inserted the documents in a different order than what is presented here. )r<rs rr=zInsertManyResult.inserted_idsbs"""r)r= list[Any]rr r!r"r#)r!r@) rr%r&r'r(rrr)r=r6r7s@rr9r9Ts)Q#I' ##rr9cxeZdZdZdZd fd Zd dZed dZed dZ ed dZ ed dZ xZ S) UpdateResultzThe return type for :meth:`~pymongo.collection.Collection.update_one`, :meth:`~pymongo.collection.Collection.update_many`, and :meth:`~pymongo.collection.Collection.replace_one`.  __raw_resultc2||_t| |yr )_UpdateResult__raw_resultr0rr raw_resultrrs rrzUpdateResult.__init__v& &rch|jjd|jd|jdSr3)rrrFrrs rrzUpdateResult.__repr__z6..))*!D,=,=+@PTPaPaObbcddrc|jSz/The raw result document returned by the server.)rFrs rrHzUpdateResult.raw_result}   rc|jd|jy|jJ|jjddS)z0The number of documents matched for this update. matched_countrn)r upserted_idrFgetrs rrPzUpdateResult.matched_countsL %%o6    '  ,,,  $$S!,,rc|jd|jJtt|jj dSz!The number of documents modified.modified_count nModified)rrFrintrSrs rrVzUpdateResult.modified_countsC %%&67  ,,,C**..{;<rs^ "//+&#&#R"l"(#|#4+1<+1\-<-4<l<r