from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from .models import Pricing
from .serializers import PricingSerializer


class CreatePricingView(APIView):
    authentication_classes = [TokenAuthentication]
    permission_classes = [IsAuthenticated]

    def post(self, request):
        input_serializer = PricingSerializer(data=request.data)
        input_serializer.is_valid(raise_exception=True)
        new_pricing = Pricing.objects.create(**input_serializer.data)
        output_data = PricingSerializer(new_pricing).data
        return Response(output_data, status=status.HTTP_201_CREATED)

48d8923a72667596a7ff8b458da2959963e69a27
<mask token>


class CreatePricingView(APIView):
    <mask token>
    <mask token>
    <mask token>

<mask token>


class CreatePricingView(APIView):
    <mask token>
    <mask token>

    def post(self, request):
        input_serializer = PricingSerializer(data=request.data)
        input_serializer.is_valid(raise_exception=True)
        new_pricing = Pricing.objects.create(**input_serializer.data)
        output_data = PricingSerializer(new_pricing).data
        return Response(output_data, status=status.HTTP_201_CREATED)

<mask token>


class CreatePricingView(APIView):
    authentication_classes = [TokenAuthentication]
    permission_classes = [IsAuthenticated]

    def post(self, request):
        input_serializer = PricingSerializer(data=request.data)
        input_serializer.is_valid(raise_exception=True)
        new_pricing = Pricing.objects.create(**input_serializer.data)
        output_data = PricingSerializer(new_pricing).data
        return Response(output_data, status=status.HTTP_201_CREATED)

from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from .models import Pricing
from .serializers import PricingSerializer


class CreatePricingView(APIView):
    authentication_classes = [TokenAuthentication]
    permission_classes = [IsAuthenticated]

    def post(self, request):
        input_serializer = PricingSerializer(data=request.data)
        input_serializer.is_valid(raise_exception=True)
        new_pricing = Pricing.objects.create(**input_serializer.data)
        output_data = PricingSerializer(new_pricing).data
        return Response(output_data, status=status.HTTP_201_CREATED)
