# coding: utf-8

"""
    OneRoster OpenAPI (JSON) Definition

    The OneRoster service binding is available in WSDL/XSD and REST/JSON. The model is based upon the IMS PSM modelling approach.  # noqa: E501

    OpenAPI spec version: 1.1
    Contact: platform@strongmind.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six
from oneroster_client.models.base_type import BaseType  # noqa: F401,E501

class EnrollmentType(BaseType):
    """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 = {
        'user': 'GUIDRefType',
        '_class': 'GUIDRefType',
        'school': 'GUIDRefType',
        'role': 'str',
        'primary': 'bool',
        'begin_date': 'date',
        'end_date': 'date'
    }
    if hasattr(BaseType, "swagger_types"):
        swagger_types.update(BaseType.swagger_types)

    attribute_map = {
        'user': 'user',
        '_class': 'class',
        'school': 'school',
        'role': 'role',
        'primary': 'primary',
        'begin_date': 'beginDate',
        'end_date': 'endDate'
    }
    if hasattr(BaseType, "attribute_map"):
        attribute_map.update(BaseType.attribute_map)

    def __init__(self, user=None, _class=None, school=None, role=None, primary=None, begin_date=None, end_date=None, *args, **kwargs):  # noqa: E501
        """EnrollmentType - a model defined in Swagger"""  # noqa: E501
        self._user = None
        self.__class = None
        self._school = None
        self._role = None
        self._primary = None
        self._begin_date = None
        self._end_date = None
        self.discriminator = None
        self.user = user
        self._class = _class
        self.school = school
        self.role = role
        if primary is not None:
            self.primary = primary
        if begin_date is not None:
            self.begin_date = begin_date
        if end_date is not None:
            self.end_date = end_date
        BaseType.__init__(self, *args, **kwargs)

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


        :return: The user of this EnrollmentType.  # noqa: E501
        :rtype: GUIDRefType
        """
        return self._user

    @user.setter
    def user(self, user):
        """Sets the user of this EnrollmentType.


        :param user: The user of this EnrollmentType.  # noqa: E501
        :type: GUIDRefType
        """
        if user is None:
            raise ValueError("Invalid value for `user`, must not be `None`")  # noqa: E501

        self._user = user

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


        :return: The _class of this EnrollmentType.  # noqa: E501
        :rtype: GUIDRefType
        """
        return self.__class

    @_class.setter
    def _class(self, _class):
        """Sets the _class of this EnrollmentType.


        :param _class: The _class of this EnrollmentType.  # noqa: E501
        :type: GUIDRefType
        """
        if _class is None:
            raise ValueError("Invalid value for `_class`, must not be `None`")  # noqa: E501

        self.__class = _class

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


        :return: The school of this EnrollmentType.  # noqa: E501
        :rtype: GUIDRefType
        """
        return self._school

    @school.setter
    def school(self, school):
        """Sets the school of this EnrollmentType.


        :param school: The school of this EnrollmentType.  # noqa: E501
        :type: GUIDRefType
        """
        if school is None:
            raise ValueError("Invalid value for `school`, must not be `None`")  # noqa: E501

        self._school = school

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


        :return: The role of this EnrollmentType.  # noqa: E501
        :rtype: str
        """
        return self._role

    @role.setter
    def role(self, role):
        """Sets the role of this EnrollmentType.


        :param role: The role of this EnrollmentType.  # noqa: E501
        :type: str
        """
        if role is None:
            raise ValueError("Invalid value for `role`, must not be `None`")  # noqa: E501
        allowed_values = ["administrator", "aide", "guardian", "parent", "proctor", "relative", "student", "teacher"]  # noqa: E501
        if role not in allowed_values:
            raise ValueError(
                "Invalid value for `role` ({0}), must be one of {1}"  # noqa: E501
                .format(role, allowed_values)
            )

        self._role = role

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

        Model Primitive Datatype = Boolean  # noqa: E501

        :return: The primary of this EnrollmentType.  # noqa: E501
        :rtype: bool
        """
        return self._primary

    @primary.setter
    def primary(self, primary):
        """Sets the primary of this EnrollmentType.

        Model Primitive Datatype = Boolean  # noqa: E501

        :param primary: The primary of this EnrollmentType.  # noqa: E501
        :type: bool
        """

        self._primary = primary

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

        Model Primitive Datatype = Date  # noqa: E501

        :return: The begin_date of this EnrollmentType.  # noqa: E501
        :rtype: date
        """
        return self._begin_date

    @begin_date.setter
    def begin_date(self, begin_date):
        """Sets the begin_date of this EnrollmentType.

        Model Primitive Datatype = Date  # noqa: E501

        :param begin_date: The begin_date of this EnrollmentType.  # noqa: E501
        :type: date
        """

        self._begin_date = begin_date

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

        Model Primitive Datatype = Date  # noqa: E501

        :return: The end_date of this EnrollmentType.  # noqa: E501
        :rtype: date
        """
        return self._end_date

    @end_date.setter
    def end_date(self, end_date):
        """Sets the end_date of this EnrollmentType.

        Model Primitive Datatype = Date  # noqa: E501

        :param end_date: The end_date of this EnrollmentType.  # noqa: E501
        :type: date
        """

        self._end_date = end_date

    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(EnrollmentType, 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, EnrollmentType):
            return False

        return self.__dict__ == other.__dict__

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