# coding: utf-8

"""
    ORCID Member

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: Latest
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class PublicationDate(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, year=None, month=None, day=None, media_type=None):
        """
        PublicationDate - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'year': 'Year',
            'month': 'Month',
            'day': 'Day',
            'media_type': 'str'
        }

        self.attribute_map = {
            'year': 'year',
            'month': 'month',
            'day': 'day',
            'media_type': 'media-type'
        }

        self._year = year
        self._month = month
        self._day = day
        self._media_type = media_type

    @property
    def year(self):
        """
        Gets the year of this PublicationDate.

        :return: The year of this PublicationDate.
        :rtype: Year
        """
        return self._year

    @year.setter
    def year(self, year):
        """
        Sets the year of this PublicationDate.

        :param year: The year of this PublicationDate.
        :type: Year
        """
        if year is None:
            raise ValueError("Invalid value for `year`, must not be `None`")

        self._year = year

    @property
    def month(self):
        """
        Gets the month of this PublicationDate.

        :return: The month of this PublicationDate.
        :rtype: Month
        """
        return self._month

    @month.setter
    def month(self, month):
        """
        Sets the month of this PublicationDate.

        :param month: The month of this PublicationDate.
        :type: Month
        """

        self._month = month

    @property
    def day(self):
        """
        Gets the day of this PublicationDate.

        :return: The day of this PublicationDate.
        :rtype: Day
        """
        return self._day

    @day.setter
    def day(self, day):
        """
        Sets the day of this PublicationDate.

        :param day: The day of this PublicationDate.
        :type: Day
        """

        self._day = day

    @property
    def media_type(self):
        """
        Gets the media_type of this PublicationDate.

        :return: The media_type of this PublicationDate.
        :rtype: str
        """
        return self._media_type

    @media_type.setter
    def media_type(self, media_type):
        """
        Sets the media_type of this PublicationDate.

        :param media_type: The media_type of this PublicationDate.
        :type: str
        """
        allowed_values = ["PRINT", "ONLINE", "OTHER"]
        if media_type not in allowed_values:
            raise ValueError(
                "Invalid value for `media_type` ({0}), must be one of {1}"
                .format(media_type, allowed_values)
            )

        self._media_type = media_type

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, PublicationDate):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
