Source code for luna_handlers.app.handlers.verifiers_count_handler
""" Verifier count handler. """
from sanic.response import HTTPResponse
from app.handlers.base_handler import BaseHandler
from crutches_on_wheels.web.query_getters import uuidGetter
[docs]class VerifierCountHandler(BaseHandler):
"""
Handler for getting verifier count
Resource: "/{api_version}/verifiers/count"
"""
[docs] async def get(self) -> HTTPResponse:
"""
Count verifiers that satisfy the filters. See `spec_count_verifiers`_.
.. _spec_count_verifiers:
_static/api.html#operation/countVerifiers
Returns:
Response with verifier count
"""
description = self.getQueryParam("description")
accountId = self.getQueryParam("account_id", uuidGetter)
verifierCount = await self.dbContext.getVerifierCount(accountId=accountId, description=description)
return self.success(200, outputJson={"verifiers_count": verifierCount})