from datetime import datetime

from ._PublicationAction import PublicationAction


class PublicationHistoryDto(object):
    def __init__(
        self,           # type: PublicationHistoryDto
        created_at,     # type: datetime
        action          # type: PublicationAction
    ):
        self.created_at = created_at
        self.action = action

    def to_dict(self):
        return {
            "createdAt": self.created_at.isoformat(),
            "action": self.action.name,
        }
