# coding: utf-8

from __future__ import absolute_import
from swagger_server.models.datasource_model import DatasourceModel
from swagger_server.models.scholix_author_model import ScholixAuthorModel
from swagger_server.models.scholix_identifier import ScholixIdentifier
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model


class ScholixResourceModel(Model):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, publisher=None, creator=None, title=None, publication_date=None, identifier=None, type=None):
        """
        ScholixResourceModel - a model defined in Swagger

        :param publisher: The publisher of this ScholixResourceModel.
        :type publisher: List[DatasourceModel]
        :param creator: The creator of this ScholixResourceModel.
        :type creator: List[ScholixAuthorModel]
        :param title: The title of this ScholixResourceModel.
        :type title: str
        :param publication_date: The publication_date of this ScholixResourceModel.
        :type publication_date: str
        :param identifier: The identifier of this ScholixResourceModel.
        :type identifier: List[ScholixIdentifier]
        :param type: The type of this ScholixResourceModel.
        :type type: str
        """
        self.swagger_types = {
            'publisher': List[DatasourceModel],
            'creator': List[ScholixAuthorModel],
            'title': str,
            'publication_date': str,
            'identifier': List[ScholixIdentifier],
            'type': str
        }

        self.attribute_map = {
            'publisher': 'Publisher',
            'creator': 'Creator',
            'title': 'Title',
            'publication_date': 'PublicationDate',
            'identifier': 'Identifier',
            'type': 'Type'
        }

        self._publisher = publisher
        self._creator = creator
        self._title = title
        self._publication_date = publication_date
        self._identifier = identifier
        self._type = type

    @classmethod
    def from_dict(cls, dikt):
        """
        Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The Scholix Resource Model of this ScholixResourceModel.
        :rtype: ScholixResourceModel
        """
        return deserialize_model(dikt, cls)

    @property
    def publisher(self):
        """
        Gets the publisher of this ScholixResourceModel.

        :return: The publisher of this ScholixResourceModel.
        :rtype: List[DatasourceModel]
        """
        return self._publisher

    @publisher.setter
    def publisher(self, publisher):
        """
        Sets the publisher of this ScholixResourceModel.

        :param publisher: The publisher of this ScholixResourceModel.
        :type publisher: List[DatasourceModel]
        """

        self._publisher = publisher

    @property
    def creator(self):
        """
        Gets the creator of this ScholixResourceModel.

        :return: The creator of this ScholixResourceModel.
        :rtype: List[ScholixAuthorModel]
        """
        return self._creator

    @creator.setter
    def creator(self, creator):
        """
        Sets the creator of this ScholixResourceModel.

        :param creator: The creator of this ScholixResourceModel.
        :type creator: List[ScholixAuthorModel]
        """

        self._creator = creator

    @property
    def title(self):
        """
        Gets the title of this ScholixResourceModel.

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

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

        :param title: The title of this ScholixResourceModel.
        :type title: str
        """

        self._title = title

    @property
    def publication_date(self):
        """
        Gets the publication_date of this ScholixResourceModel.

        :return: The publication_date of this ScholixResourceModel.
        :rtype: str
        """
        return self._publication_date

    @publication_date.setter
    def publication_date(self, publication_date):
        """
        Sets the publication_date of this ScholixResourceModel.

        :param publication_date: The publication_date of this ScholixResourceModel.
        :type publication_date: str
        """

        self._publication_date = publication_date

    @property
    def identifier(self):
        """
        Gets the identifier of this ScholixResourceModel.

        :return: The identifier of this ScholixResourceModel.
        :rtype: List[ScholixIdentifier]
        """
        return self._identifier

    @identifier.setter
    def identifier(self, identifier):
        """
        Sets the identifier of this ScholixResourceModel.

        :param identifier: The identifier of this ScholixResourceModel.
        :type identifier: List[ScholixIdentifier]
        """

        self._identifier = identifier

    @property
    def type(self):
        """
        Gets the type of this ScholixResourceModel.

        :return: The type of this ScholixResourceModel.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this ScholixResourceModel.

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

        self._type = type

