Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
BeginRequest,
_with_api_key("begin", self._serializer.unstructure_attrs_asdict),
)
self._serializer.register_unstructure_hook(
EndRequest, _with_api_key("end", self._serializer.unstructure_attrs_asdict)
)
self._serializer.register_unstructure_hook(
CallbacksRequest,
_with_api_key("callbacks", self._serializer.unstructure_attrs_asdict),
)
self._serializer.register_unstructure_hook(
CompleteRequest,
_with_api_key("complete", self._serializer.unstructure_attrs_asdict),
)
self._serializer.register_unstructure_hook(
StatsRequest,
_with_api_key("stats", self._serializer.unstructure_attrs_asdict),
)
self._serializer.register_unstructure_hook(
Override, self._serializer.unstructure_attrs_asdict
)
self._serializer.register_unstructure_hook(ObjRef, _unstructure_ref)
self._serializer.register_structure_hook(ObjRef, _with_reference)
self._ctx_stack = contextlib.ExitStack()
def stats(self, request: Optional[StatsRequest] = None) -> StatsResponse:
if request is None:
request = StatsRequest()
return self._process.send(request, StatsResponse)
def stats(self):
resp = self.provider.stats(StatsRequest())
return Statistics(object_count=resp.objectCount)