Source code for luna_handlers.app.handlers.handlers_validator_handler

""" Handler for a validate policies. """
from sanic.response import HTTPResponse

from app.handlers.base_handler import BaseHandler
from classes.schemas.handler import ValidatorHandlerModel


[docs]class HandlerValidator(BaseHandler): """ Handler validator. Resource: "/{api_version}/handlers/validator" """
[docs] async def post(self) -> HTTPResponse: # pylint: disable-msg=W0221 """ Validate handler policies. See `spec_validate_handler_policies`_. .. _spec_validate_handler_policies: _static/api.html#operation/validatePolicies Returns: Response with empty body """ handler = self.loadDataFromJson(self.request.json, ValidatorHandlerModel) await handler.policies.checkListsAvailability(self.luna3Client, accountId=handler.accountId) return self.success(204)