from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from users.models import User
from users.serializers import UserSerializer, UserDetailSerializer


class ListCreateUser(ListCreateAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'POST':
            return UserSerializer


class RetrieveUpdateDestroyUser(RetrieveUpdateDestroyAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'PATCH' or self.request.method == 'PUT':
            return UserSerializer

4cf176671cfbdfcfcfb28da06c3e5062d83ddbac
<mask token>


class ListCreateUser(ListCreateAPIView):
    <mask token>
    <mask token>


class RetrieveUpdateDestroyUser(RetrieveUpdateDestroyAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'PATCH' or self.request.method == 'PUT':
            return UserSerializer

<mask token>


class ListCreateUser(ListCreateAPIView):
    <mask token>

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'POST':
            return UserSerializer


class RetrieveUpdateDestroyUser(RetrieveUpdateDestroyAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'PATCH' or self.request.method == 'PUT':
            return UserSerializer

<mask token>


class ListCreateUser(ListCreateAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'POST':
            return UserSerializer


class RetrieveUpdateDestroyUser(RetrieveUpdateDestroyAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'PATCH' or self.request.method == 'PUT':
            return UserSerializer

from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from users.models import User
from users.serializers import UserSerializer, UserDetailSerializer


class ListCreateUser(ListCreateAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'POST':
            return UserSerializer


class RetrieveUpdateDestroyUser(RetrieveUpdateDestroyAPIView):
    queryset = User.objects.all()

    def get_serializer_class(self):
        if self.request.method == 'GET':
            return UserDetailSerializer
        elif self.request.method == 'PATCH' or self.request.method == 'PUT':
            return UserSerializer
