# -*- coding: utf-8 -*-
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status

{% for obj in names %}
class {{ obj.name }}(APIView):
    {% if obj.data.doc %}"""
    {% for line in obj.data.doc %}{{ line }}
    {% endfor %}
    """{% endif %}{% for method in obj.data.methods %}
    def {{ method.method }}(self, request, *args, **kwargs):
        # validated request data will be here
        data = kwargs.get('data', None){% if method.model %}
        resp = {{ method.model }}{% endif %}

        return Response({% if method.model %}resp, {% endif %}status = status.HTTP_200_OK)
    {% endfor %}

{% endfor %}