# coding: utf-8

"""
    Trackside Software TeamDB API v2.0

    This API enables you to access TeamDB data  # noqa: E501

    OpenAPI spec version: 2.0
    Contact: support@trackside.fr
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from teamdbapi.configuration import Configuration


class Session(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 = {
        'id': 'str',
        'name': 'str',
        'number': 'int',
        'car_id': 'str',
        'track_layout_id': 'str',
        'session_date': 'datetime',
        'session_status': 'str',
        'last_update_date_utc': 'datetime',
        'last_update_user': 'str',
        'revision': 'int',
        'lap_count': 'int',
        'run_count': 'int',
        'distance': 'float',
        'distance_real': 'float',
        'default_assemblies': 'list[str]',
        'duration': 'float'
    }

    attribute_map = {
        'id': 'Id',
        'name': 'Name',
        'number': 'Number',
        'car_id': 'CarId',
        'track_layout_id': 'TrackLayoutId',
        'session_date': 'SessionDate',
        'session_status': 'SessionStatus',
        'last_update_date_utc': 'LastUpdateDateUtc',
        'last_update_user': 'LastUpdateUser',
        'revision': 'Revision',
        'lap_count': 'LapCount',
        'run_count': 'RunCount',
        'distance': 'Distance',
        'distance_real': 'DistanceReal',
        'default_assemblies': 'DefaultAssemblies',
        'duration': 'Duration'
    }

    def __init__(self, id=None, name=None, number=None, car_id=None, track_layout_id=None, session_date=None, session_status=None, last_update_date_utc=None, last_update_user=None, revision=None, lap_count=None, run_count=None, distance=None, distance_real=None, default_assemblies=None, duration=None, _configuration=None):  # noqa: E501
        """Session - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._name = None
        self._number = None
        self._car_id = None
        self._track_layout_id = None
        self._session_date = None
        self._session_status = None
        self._last_update_date_utc = None
        self._last_update_user = None
        self._revision = None
        self._lap_count = None
        self._run_count = None
        self._distance = None
        self._distance_real = None
        self._default_assemblies = None
        self._duration = None
        self.discriminator = None

        self.id = id
        self.name = name
        self.number = number
        self.car_id = car_id
        self.track_layout_id = track_layout_id
        self.session_date = session_date
        if session_status is not None:
            self.session_status = session_status
        if last_update_date_utc is not None:
            self.last_update_date_utc = last_update_date_utc
        if last_update_user is not None:
            self.last_update_user = last_update_user
        if revision is not None:
            self.revision = revision
        if lap_count is not None:
            self.lap_count = lap_count
        if run_count is not None:
            self.run_count = run_count
        if distance is not None:
            self.distance = distance
        if distance_real is not None:
            self.distance_real = distance_real
        if default_assemblies is not None:
            self.default_assemblies = default_assemblies
        if duration is not None:
            self.duration = duration

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

        The unique session Id.  Set the Id to Guid.Empty (00000000-0000-0000-0000-000000000000) if you want to create a new Session.  # noqa: E501

        :return: The id of this Session.  # noqa: E501
        :rtype: str
        """
        return self._id

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

        The unique session Id.  Set the Id to Guid.Empty (00000000-0000-0000-0000-000000000000) if you want to create a new Session.  # noqa: E501

        :param id: The id of this Session.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        The session name.  # noqa: E501

        :return: The name of this Session.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Session.

        The session name.  # noqa: E501

        :param name: The name of this Session.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501

        self._name = name

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

        The session number.  # noqa: E501

        :return: The number of this Session.  # noqa: E501
        :rtype: int
        """
        return self._number

    @number.setter
    def number(self, number):
        """Sets the number of this Session.

        The session number.  # noqa: E501

        :param number: The number of this Session.  # noqa: E501
        :type: int
        """
        if self._configuration.client_side_validation and number is None:
            raise ValueError("Invalid value for `number`, must not be `None`")  # noqa: E501

        self._number = number

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

        The car unique id to which the session is linked.  # noqa: E501

        :return: The car_id of this Session.  # noqa: E501
        :rtype: str
        """
        return self._car_id

    @car_id.setter
    def car_id(self, car_id):
        """Sets the car_id of this Session.

        The car unique id to which the session is linked.  # noqa: E501

        :param car_id: The car_id of this Session.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and car_id is None:
            raise ValueError("Invalid value for `car_id`, must not be `None`")  # noqa: E501

        self._car_id = car_id

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

        The track layout unique id.  # noqa: E501

        :return: The track_layout_id of this Session.  # noqa: E501
        :rtype: str
        """
        return self._track_layout_id

    @track_layout_id.setter
    def track_layout_id(self, track_layout_id):
        """Sets the track_layout_id of this Session.

        The track layout unique id.  # noqa: E501

        :param track_layout_id: The track_layout_id of this Session.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and track_layout_id is None:
            raise ValueError("Invalid value for `track_layout_id`, must not be `None`")  # noqa: E501

        self._track_layout_id = track_layout_id

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

        The session date.  The date must be an UTC date time. Here is an example : 2018-06-05T12:36:34.168Z  # noqa: E501

        :return: The session_date of this Session.  # noqa: E501
        :rtype: datetime
        """
        return self._session_date

    @session_date.setter
    def session_date(self, session_date):
        """Sets the session_date of this Session.

        The session date.  The date must be an UTC date time. Here is an example : 2018-06-05T12:36:34.168Z  # noqa: E501

        :param session_date: The session_date of this Session.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and session_date is None:
            raise ValueError("Invalid value for `session_date`, must not be `None`")  # noqa: E501

        self._session_date = session_date

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

        The session status.  # noqa: E501

        :return: The session_status of this Session.  # noqa: E501
        :rtype: str
        """
        return self._session_status

    @session_status.setter
    def session_status(self, session_status):
        """Sets the session_status of this Session.

        The session status.  # noqa: E501

        :param session_status: The session_status of this Session.  # noqa: E501
        :type: str
        """
        allowed_values = ["Normal", "Assembly", "Disassembly"]  # noqa: E501
        if (self._configuration.client_side_validation and
                session_status not in allowed_values):
            raise ValueError(
                "Invalid value for `session_status` ({0}), must be one of {1}"  # noqa: E501
                .format(session_status, allowed_values)
            )

        self._session_status = session_status

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

        The last utc date time when the properties of this object have been updated.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :return: The last_update_date_utc of this Session.  # noqa: E501
        :rtype: datetime
        """
        return self._last_update_date_utc

    @last_update_date_utc.setter
    def last_update_date_utc(self, last_update_date_utc):
        """Sets the last_update_date_utc of this Session.

        The last utc date time when the properties of this object have been updated.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :param last_update_date_utc: The last_update_date_utc of this Session.  # noqa: E501
        :type: datetime
        """

        self._last_update_date_utc = last_update_date_utc

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

        The name of the last user having updated this object.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :return: The last_update_user of this Session.  # noqa: E501
        :rtype: str
        """
        return self._last_update_user

    @last_update_user.setter
    def last_update_user(self, last_update_user):
        """Sets the last_update_user of this Session.

        The name of the last user having updated this object.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :param last_update_user: The last_update_user of this Session.  # noqa: E501
        :type: str
        """

        self._last_update_user = last_update_user

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

        The revision number of the object.  # noqa: E501

        :return: The revision of this Session.  # noqa: E501
        :rtype: int
        """
        return self._revision

    @revision.setter
    def revision(self, revision):
        """Sets the revision of this Session.

        The revision number of the object.  # noqa: E501

        :param revision: The revision of this Session.  # noqa: E501
        :type: int
        """

        self._revision = revision

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

        Lap count in the session  # noqa: E501

        :return: The lap_count of this Session.  # noqa: E501
        :rtype: int
        """
        return self._lap_count

    @lap_count.setter
    def lap_count(self, lap_count):
        """Sets the lap_count of this Session.

        Lap count in the session  # noqa: E501

        :param lap_count: The lap_count of this Session.  # noqa: E501
        :type: int
        """

        self._lap_count = lap_count

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

        Run count in the session  # noqa: E501

        :return: The run_count of this Session.  # noqa: E501
        :rtype: int
        """
        return self._run_count

    @run_count.setter
    def run_count(self, run_count):
        """Sets the run_count of this Session.

        Run count in the session  # noqa: E501

        :param run_count: The run_count of this Session.  # noqa: E501
        :type: int
        """

        self._run_count = run_count

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

        Distance performed during the session  # noqa: E501

        :return: The distance of this Session.  # noqa: E501
        :rtype: float
        """
        return self._distance

    @distance.setter
    def distance(self, distance):
        """Sets the distance of this Session.

        Distance performed during the session  # noqa: E501

        :param distance: The distance of this Session.  # noqa: E501
        :type: float
        """

        self._distance = distance

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

        Distance real performed during the session  # noqa: E501

        :return: The distance_real of this Session.  # noqa: E501
        :rtype: float
        """
        return self._distance_real

    @distance_real.setter
    def distance_real(self, distance_real):
        """Sets the distance_real of this Session.

        Distance real performed during the session  # noqa: E501

        :param distance_real: The distance_real of this Session.  # noqa: E501
        :type: float
        """

        self._distance_real = distance_real

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

        List of the default Assemblies used to create the first session's run.  You have to specify one assemblies by target.  # noqa: E501

        :return: The default_assemblies of this Session.  # noqa: E501
        :rtype: list[str]
        """
        return self._default_assemblies

    @default_assemblies.setter
    def default_assemblies(self, default_assemblies):
        """Sets the default_assemblies of this Session.

        List of the default Assemblies used to create the first session's run.  You have to specify one assemblies by target.  # noqa: E501

        :param default_assemblies: The default_assemblies of this Session.  # noqa: E501
        :type: list[str]
        """

        self._default_assemblies = default_assemblies

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

        The session duration in secondes  # noqa: E501

        :return: The duration of this Session.  # noqa: E501
        :rtype: float
        """
        return self._duration

    @duration.setter
    def duration(self, duration):
        """Sets the duration of this Session.

        The session duration in secondes  # noqa: E501

        :param duration: The duration of this Session.  # noqa: E501
        :type: float
        """

        self._duration = duration

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

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
