"""This module contains the views for the v2 api of the ``metaplans`` app"""

from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated

from mtp.apps.metaplans.models import Metaplan

from .serializers import MetaplanSerializer


class MetaplanViewSet(viewsets.mixins.RetrieveModelMixin, viewsets.GenericViewSet):
    """ViewSet for the ``Metaplan`` model"""

    queryset = Metaplan.objects.non_deleted()
    permission_classes = [IsAuthenticated]
    serializer_class = MetaplanSerializer
