# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from .base_model_ import Model
from application.api import util


class Notification(Model):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    def __init__(self, id: int=None, recipient_id: int=None, title: str=None, text: str=None):
        """User - a model defined in Swagger

        :param id: The id of this User.
        :type id: int
        :param recipient_id: The recipient_id of this User.
        :type recipient_id: int
        :param title: Title.
        :type title: str
        :param text: Text.
        :type text: str
        """
        self.swagger_types = {
            'id': int,
            'recipient_id': int,
            'title': str,
            'text': str,
        }

        self.attribute_map = {
            'id': 'id',
            'recipient_id': 'recipient_id',
            'title': 'title',
            'text': 'text'
        }

        self._id = id
        self._recipient_id = recipient_id
        self._title = title
        self._text = text

    @classmethod
    def from_dict(cls, attr_dict) -> 'Notification':
        """Returns the dict as a model

        :param attr_dict: A dict.
        :type: dict
        :return: The User of this User.
        :rtype: User
        """
        return util.deserialize_model(attr_dict, cls)

    @classmethod
    def from_persistence(cls, notification):
        return Notification(notification.id, notification.recipient_id, notification.title,
                            notification.text)

    @property
    def id(self) -> int:
        """Gets the id of this User.


        :return: The id of this User.
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id: int):
        """Sets the id of this User.


        :param id: The id of this User.
        :type id: int
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")

        self._id = id

    @property
    def recipient_id(self) -> int:
        """Gets the recipient_id of this User.


        :return: The recipient_id of this User.
        :rtype: int
        """
        return self._recipient_id

    @recipient_id.setter
    def recipient_id(self, recipient_id: int):
        """Sets the recipient_id of this User.


        :param recipient_id: The recipient_id of this User.
        :type recipient_id: int
        """
        if recipient_id is None:
            raise ValueError("Invalid value for `recipient_id`, must not be `None`")

        self._recipient_id = recipient_id

    @property
    def title(self) -> str:
        """Gets the title of this User.


        :return: The title of this User.
        :rtype: str
        """
        return self._title

    @title.setter
    def title(self, title: str):
        """Sets the title of this User.


        :param title: The title of this User.
        :type title: str
        """
        if title is None:
            raise ValueError("Invalid value for `title`, must not be `None`")

        self._title = title

    @property
    def text(self) -> str:
        """Gets the text of this User.


        :return: The text of this User.
        :rtype: str
        """
        return self._text

    @text.setter
    def text(self, text: str):
        """Sets the text of this User.


        :param text: The text of this User.
        :type text: str
        """
        allowed_values = ["Student", "Teacher"]
        if text not in allowed_values:
            raise ValueError(
                "Invalid value for `text` ({0}), must be one of {1}"
                .format(text, allowed_values)
            )

        self._text = text
