from games.models import Developer, Game, GameSystem, Genre, Publisher
from rest_framework import serializers


# Serializers define the API representation.
class GameSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Game
        fields = (
            "id",
            "name",
            "publisher",
            "developer",
            "players",
            "rating",
            "game_system",
            "genre",
        )


class DeveloperSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Developer
        fields = (
            "id",
            "name",
            "slug",
        )


class PublisherSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Publisher
        fields = (
            "id",
            "name",
            "slug",
        )


class GenreSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Genre
        fields = (
            "id",
            "name",
            "slug",
        )


class GameSystemSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = GameSystem
        fields = (
            "id",
            "name",
            "retropie_slug",
            "slug",
        )
