@@ -791,8 +791,6 @@ def compatibility_formatter(data: Json) -> Json:
791791 result ["deleted" ] = data ["deleted" ]
792792 if "syncByRevision" in data :
793793 result ["sync_by_revision" ] = data ["syncByRevision" ]
794- if "tempObjectId" in data :
795- result ["temp_object_id" ] = data ["tempObjectId" ]
796794 if "usesRevisionsAsDocumentIds" in data :
797795 result ["rev_as_id" ] = data ["usesRevisionsAsDocumentIds" ]
798796 if "isDisjoint" in data :
@@ -819,6 +817,146 @@ def format(self, formatter: Optional[Formatter] = None) -> Json:
819817 return self .compatibility_formatter (self ._data )
820818
821819
820+ class CollectionStatistics (JsonWrapper ):
821+ """Statistical information about the collection.
822+
823+ Example:
824+ .. code-block:: json
825+
826+ {
827+ "figures" : {
828+ "indexes" : {
829+ "count" : 1,
830+ "size" : 1234
831+ },
832+ "documentsSize" : 5601,
833+ "cacheInUse" : false,
834+ "cacheSize" : 0,
835+ "cacheUsage" : 0,
836+ "engine" : {
837+ "documents" : 1,
838+ "indexes" : [
839+ {
840+ "type" : "primary",
841+ "id" : 0,
842+ "count" : 1
843+ }
844+ ]
845+ }
846+ },
847+ "writeConcern" : 1,
848+ "waitForSync" : false,
849+ "usesRevisionsAsDocumentIds" : true,
850+ "syncByRevision" : true,
851+ "statusString" : "loaded",
852+ "id" : "69123",
853+ "isSmartChild" : false,
854+ "schema" : null,
855+ "name" : "products",
856+ "type" : 2,
857+ "status" : 3,
858+ "count" : 1,
859+ "cacheEnabled" : false,
860+ "isSystem" : false,
861+ "internalValidatorType" : 0,
862+ "globallyUniqueId" : "hB7C02EE43DCE/69123",
863+ "keyOptions" : {
864+ "allowUserKeys" : true,
865+ "type" : "traditional",
866+ "lastValue" : 69129
867+ },
868+ "computedValues" : null,
869+ "objectId" : "69124"
870+ }
871+
872+ References:
873+ - `get-the-collection-statistics <https://docs.arangodb.com/stable/develop/http-api/collections/#get-the-collection-statistics>`__
874+ """ # noqa: E501
875+
876+ def __init__ (self , data : Json ) -> None :
877+ super ().__init__ (data )
878+
879+ @property
880+ def figures (self ) -> Json :
881+ return cast (Json , self ._data .get ("figures" ))
882+
883+ @property
884+ def write_concern (self ) -> Optional [int ]:
885+ return self ._data .get ("writeConcern" )
886+
887+ @property
888+ def wait_for_sync (self ) -> Optional [bool ]:
889+ return self ._data .get ("waitForSync" )
890+
891+ @property
892+ def use_revisions_as_document_ids (self ) -> Optional [bool ]:
893+ return self ._data .get ("usesRevisionsAsDocumentIds" )
894+
895+ @property
896+ def sync_by_revision (self ) -> Optional [bool ]:
897+ return self ._data .get ("syncByRevision" )
898+
899+ @property
900+ def status_string (self ) -> Optional [str ]:
901+ return self ._data .get ("statusString" )
902+
903+ @property
904+ def id (self ) -> str :
905+ return self ._data ["id" ] # type: ignore[no-any-return]
906+
907+ @property
908+ def is_smart_child (self ) -> bool :
909+ return self ._data ["isSmartChild" ] # type: ignore[no-any-return]
910+
911+ @property
912+ def schema (self ) -> Optional [Json ]:
913+ return self ._data .get ("schema" )
914+
915+ @property
916+ def name (self ) -> str :
917+ return self ._data ["name" ] # type: ignore[no-any-return]
918+
919+ @property
920+ def type (self ) -> CollectionType :
921+ return CollectionType .from_int (self ._data ["type" ])
922+
923+ @property
924+ def status (self ) -> CollectionStatus :
925+ return CollectionStatus .from_int (self ._data ["status" ])
926+
927+ @property
928+ def count (self ) -> int :
929+ return self ._data ["count" ] # type: ignore[no-any-return]
930+
931+ @property
932+ def cache_enabled (self ) -> Optional [bool ]:
933+ return self ._data .get ("cacheEnabled" )
934+
935+ @property
936+ def is_system (self ) -> bool :
937+ return self ._data ["isSystem" ] # type: ignore[no-any-return]
938+
939+ @property
940+ def internal_validator_type (self ) -> Optional [int ]:
941+ return self ._data .get ("internalValidatorType" )
942+
943+ @property
944+ def globally_unique_id (self ) -> str :
945+ return self ._data ["globallyUniqueId" ] # type: ignore[no-any-return]
946+
947+ @property
948+ def key_options (self ) -> KeyOptions :
949+ return KeyOptions (self ._data ["keyOptions" ])
950+
951+ @property
952+ def computed_values (self ) -> Optional [Json ]:
953+ return self ._data .get ("computedValues" )
954+
955+ @property
956+ def object_id (self ) -> str :
957+ return self ._data ["objectId" ] # type: ignore[no-any-return]
958+
959+
822960class IndexProperties (JsonWrapper ):
823961 """Properties of an index.
824962
0 commit comments