# coding: utf-8

"""
    Habitat repository and authorization API

    Habitat API  # noqa: E501

    OpenAPI spec version: V1.1.1
    Contact: zives@seas.upenn.edu
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from pennprov.models.attribute import Attribute  # noqa: F401,E501
from pennprov.models.prov_specifier_model import ProvSpecifierModel  # noqa: F401,E501


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

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'attributes': 'list[Attribute]',
        'type': 'str',
        'location': 'ProvSpecifierModel',
        'start_time': 'datetime',
        'end_time': 'datetime'
    }

    attribute_map = {
        'attributes': 'attributes',
        'type': 'type',
        'location': 'location',
        'start_time': 'startTime',
        'end_time': 'endTime'
    }

    def __init__(self, attributes=None, type=None, location=None, start_time=None, end_time=None):  # noqa: E501
        """NodeModel - a model defined in Swagger"""  # noqa: E501

        self._attributes = None
        self._type = None
        self._location = None
        self._start_time = None
        self._end_time = None
        self.discriminator = None

        if attributes is not None:
            self.attributes = attributes
        self.type = type
        if location is not None:
            self.location = location
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time

    @property
    def attributes(self):
        """Gets the attributes of this NodeModel.  # noqa: E501


        :return: The attributes of this NodeModel.  # noqa: E501
        :rtype: list[Attribute]
        """
        return self._attributes

    @attributes.setter
    def attributes(self, attributes):
        """Sets the attributes of this NodeModel.


        :param attributes: The attributes of this NodeModel.  # noqa: E501
        :type: list[Attribute]
        """

        self._attributes = attributes

    @property
    def type(self):
        """Gets the type of this NodeModel.  # noqa: E501


        :return: The type of this NodeModel.  # noqa: E501
        :rtype: str
        """
        return self._type

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


        :param type: The type of this NodeModel.  # noqa: E501
        :type: str
        """
        if type is None:
            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501
        allowed_values = ["ENTITY", "BUNDLE", "COLLECTION", "EMPTY_COLLECTION", "PLAN", "ACTIVITY", "AGENT", "ORGANIZATION", "PERSON", "SOFTWARE_AGENT"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

    @property
    def location(self):
        """Gets the location of this NodeModel.  # noqa: E501


        :return: The location of this NodeModel.  # noqa: E501
        :rtype: ProvSpecifierModel
        """
        return self._location

    @location.setter
    def location(self, location):
        """Sets the location of this NodeModel.


        :param location: The location of this NodeModel.  # noqa: E501
        :type: ProvSpecifierModel
        """

        self._location = location

    @property
    def start_time(self):
        """Gets the start_time of this NodeModel.  # noqa: E501

        it is an error to include start time unless type is ACTIVITY  # noqa: E501

        :return: The start_time of this NodeModel.  # noqa: E501
        :rtype: datetime
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this NodeModel.

        it is an error to include start time unless type is ACTIVITY  # noqa: E501

        :param start_time: The start_time of this NodeModel.  # noqa: E501
        :type: datetime
        """

        self._start_time = start_time

    @property
    def end_time(self):
        """Gets the end_time of this NodeModel.  # noqa: E501

        it is an error to include end time unless type is ACTIVITY  # noqa: E501

        :return: The end_time of this NodeModel.  # noqa: E501
        :rtype: datetime
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this NodeModel.

        it is an error to include end time unless type is ACTIVITY  # noqa: E501

        :param end_time: The end_time of this NodeModel.  # noqa: E501
        :type: datetime
        """

        self._end_time = end_time

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

        for attr, _ in six.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
        if issubclass(NodeModel, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.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, NodeModel):
            return False

        return self.__dict__ == other.__dict__

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