from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView

from flower.error_code_registry import list_error_code_groups


class ErrorCodeListView(APIView):
    permission_classes = [AllowAny]

    def get(self, request):
        return Response({'modules': list_error_code_groups()})
