Source code for luna_faces.app.handlers.attributes_counter_handler

"""
Module realized a handler for getting temporary attribute count
"""
from sanic.response import HTTPResponse

from app.handlers.base_handler import BaseRequestHandler


[docs]class AttributesHandlerCounter(BaseRequestHandler): """ Handler for counting attributes Resource: "/{api_version}/attributes/count" """
[docs] async def get(self) -> HTTPResponse: """ Get temporary attribute count. See `spec_get_attribute_count`_. .. _spec_get_attribute_count: _static/api.html#operation/getTemporaryAttributesCount Returns: response is json with count """ countAttributes = await self.attributesContext.getAttributesCount() return self.success(200, outputJson={"attributes_count": countAttributes})