# 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 Lap(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',
        'number': 'int',
        'absolute_number': 'int',
        'order': 'int',
        'run_id': 'str',
        'lap_date': 'datetime',
        'lap_time': 'float',
        'is_valid': 'bool',
        'last_update_date_utc': 'datetime',
        'last_update_user': 'str',
        'revision': 'int',
        'distance_real': 'float',
        'tire_fl_sliding_energy': 'float',
        'tire_fr_sliding_energy': 'float',
        'tire_rl_sliding_energy': 'float',
        'tire_rr_sliding_energy': 'float',
        'distance_power': 'float',
        'lap_time_power': 'float',
        'energy': 'float',
        'time_of_day': 'str',
        'consumption': 'float',
        'used_in_run_plan': 'bool'
    }

    attribute_map = {
        'id': 'Id',
        'number': 'Number',
        'absolute_number': 'AbsoluteNumber',
        'order': 'Order',
        'run_id': 'RunId',
        'lap_date': 'LapDate',
        'lap_time': 'LapTime',
        'is_valid': 'IsValid',
        'last_update_date_utc': 'LastUpdateDateUtc',
        'last_update_user': 'LastUpdateUser',
        'revision': 'Revision',
        'distance_real': 'DistanceReal',
        'tire_fl_sliding_energy': 'TireFL_SlidingEnergy',
        'tire_fr_sliding_energy': 'TireFR_SlidingEnergy',
        'tire_rl_sliding_energy': 'TireRL_SlidingEnergy',
        'tire_rr_sliding_energy': 'TireRR_SlidingEnergy',
        'distance_power': 'DistancePower',
        'lap_time_power': 'LapTimePower',
        'energy': 'Energy',
        'time_of_day': 'TimeOfDay',
        'consumption': 'Consumption',
        'used_in_run_plan': 'UsedInRunPlan'
    }

    def __init__(self, id=None, number=None, absolute_number=None, order=None, run_id=None, lap_date=None, lap_time=None, is_valid=True, last_update_date_utc=None, last_update_user=None, revision=None, distance_real=None, tire_fl_sliding_energy=None, tire_fr_sliding_energy=None, tire_rl_sliding_energy=None, tire_rr_sliding_energy=None, distance_power=None, lap_time_power=None, energy=None, time_of_day=None, consumption=None, used_in_run_plan=True, _configuration=None):  # noqa: E501
        """Lap - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._number = None
        self._absolute_number = None
        self._order = None
        self._run_id = None
        self._lap_date = None
        self._lap_time = None
        self._is_valid = None
        self._last_update_date_utc = None
        self._last_update_user = None
        self._revision = None
        self._distance_real = None
        self._tire_fl_sliding_energy = None
        self._tire_fr_sliding_energy = None
        self._tire_rl_sliding_energy = None
        self._tire_rr_sliding_energy = None
        self._distance_power = None
        self._lap_time_power = None
        self._energy = None
        self._time_of_day = None
        self._consumption = None
        self._used_in_run_plan = None
        self.discriminator = None

        self.id = id
        self.number = number
        self.absolute_number = absolute_number
        self.order = order
        self.run_id = run_id
        self.lap_date = lap_date
        self.lap_time = lap_time
        if is_valid is not None:
            self.is_valid = is_valid
        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 distance_real is not None:
            self.distance_real = distance_real
        if tire_fl_sliding_energy is not None:
            self.tire_fl_sliding_energy = tire_fl_sliding_energy
        if tire_fr_sliding_energy is not None:
            self.tire_fr_sliding_energy = tire_fr_sliding_energy
        if tire_rl_sliding_energy is not None:
            self.tire_rl_sliding_energy = tire_rl_sliding_energy
        if tire_rr_sliding_energy is not None:
            self.tire_rr_sliding_energy = tire_rr_sliding_energy
        if distance_power is not None:
            self.distance_power = distance_power
        if lap_time_power is not None:
            self.lap_time_power = lap_time_power
        if energy is not None:
            self.energy = energy
        if time_of_day is not None:
            self.time_of_day = time_of_day
        if consumption is not None:
            self.consumption = consumption
        if used_in_run_plan is not None:
            self.used_in_run_plan = used_in_run_plan

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

        The lap id.  # noqa: E501

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

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

        The lap id.  # noqa: E501

        :param id: The id of this Lap.  # 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 number(self):
        """Gets the number of this Lap.  # noqa: E501

        The lap number.  # noqa: E501

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

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

        The lap number.  # noqa: E501

        :param number: The number of this Lap.  # 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 absolute_number(self):
        """Gets the absolute_number of this Lap.  # noqa: E501

        The lap absolute number.  # noqa: E501

        :return: The absolute_number of this Lap.  # noqa: E501
        :rtype: int
        """
        return self._absolute_number

    @absolute_number.setter
    def absolute_number(self, absolute_number):
        """Sets the absolute_number of this Lap.

        The lap absolute number.  # noqa: E501

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

        self._absolute_number = absolute_number

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

        The lap order.  # noqa: E501

        :return: The order of this Lap.  # noqa: E501
        :rtype: int
        """
        return self._order

    @order.setter
    def order(self, order):
        """Sets the order of this Lap.

        The lap order.  # noqa: E501

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

        self._order = order

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

        The run unique id to which the lap is linked.  # noqa: E501

        :return: The run_id of this Lap.  # noqa: E501
        :rtype: str
        """
        return self._run_id

    @run_id.setter
    def run_id(self, run_id):
        """Sets the run_id of this Lap.

        The run unique id to which the lap is linked.  # noqa: E501

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

        self._run_id = run_id

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

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

        :return: The lap_date of this Lap.  # noqa: E501
        :rtype: datetime
        """
        return self._lap_date

    @lap_date.setter
    def lap_date(self, lap_date):
        """Sets the lap_date of this Lap.

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

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

        self._lap_date = lap_date

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

        The lap time in seconds.  # noqa: E501

        :return: The lap_time of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._lap_time

    @lap_time.setter
    def lap_time(self, lap_time):
        """Sets the lap_time of this Lap.

        The lap time in seconds.  # noqa: E501

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

        self._lap_time = lap_time

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

        The lap \"valid\" status.  # noqa: E501

        :return: The is_valid of this Lap.  # noqa: E501
        :rtype: bool
        """
        return self._is_valid

    @is_valid.setter
    def is_valid(self, is_valid):
        """Sets the is_valid of this Lap.

        The lap \"valid\" status.  # noqa: E501

        :param is_valid: The is_valid of this Lap.  # noqa: E501
        :type: bool
        """

        self._is_valid = is_valid

    @property
    def last_update_date_utc(self):
        """Gets the last_update_date_utc of this Lap.  # 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 Lap.  # 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 Lap.

        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 Lap.  # 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 Lap.  # 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 Lap.  # 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 Lap.

        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 Lap.  # noqa: E501
        :type: str
        """

        self._last_update_user = last_update_user

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

        The revision number of the object.  # noqa: E501

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

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

        The revision number of the object.  # noqa: E501

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

        self._revision = revision

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

        Real distance performed  # noqa: E501

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

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

        Real distance performed  # noqa: E501

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

        self._distance_real = distance_real

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

        énergie obtenue pour le pneu FL durant le lap  # noqa: E501

        :return: The tire_fl_sliding_energy of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._tire_fl_sliding_energy

    @tire_fl_sliding_energy.setter
    def tire_fl_sliding_energy(self, tire_fl_sliding_energy):
        """Sets the tire_fl_sliding_energy of this Lap.

        énergie obtenue pour le pneu FL durant le lap  # noqa: E501

        :param tire_fl_sliding_energy: The tire_fl_sliding_energy of this Lap.  # noqa: E501
        :type: float
        """

        self._tire_fl_sliding_energy = tire_fl_sliding_energy

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

        énergie obtenue pour le pneu FR durant le lap  # noqa: E501

        :return: The tire_fr_sliding_energy of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._tire_fr_sliding_energy

    @tire_fr_sliding_energy.setter
    def tire_fr_sliding_energy(self, tire_fr_sliding_energy):
        """Sets the tire_fr_sliding_energy of this Lap.

        énergie obtenue pour le pneu FR durant le lap  # noqa: E501

        :param tire_fr_sliding_energy: The tire_fr_sliding_energy of this Lap.  # noqa: E501
        :type: float
        """

        self._tire_fr_sliding_energy = tire_fr_sliding_energy

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

        énergie obtenue pour le pneu RL durant le lap  # noqa: E501

        :return: The tire_rl_sliding_energy of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._tire_rl_sliding_energy

    @tire_rl_sliding_energy.setter
    def tire_rl_sliding_energy(self, tire_rl_sliding_energy):
        """Sets the tire_rl_sliding_energy of this Lap.

        énergie obtenue pour le pneu RL durant le lap  # noqa: E501

        :param tire_rl_sliding_energy: The tire_rl_sliding_energy of this Lap.  # noqa: E501
        :type: float
        """

        self._tire_rl_sliding_energy = tire_rl_sliding_energy

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

        énergie obtenue pour le pneu RR durant le lap  # noqa: E501

        :return: The tire_rr_sliding_energy of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._tire_rr_sliding_energy

    @tire_rr_sliding_energy.setter
    def tire_rr_sliding_energy(self, tire_rr_sliding_energy):
        """Sets the tire_rr_sliding_energy of this Lap.

        énergie obtenue pour le pneu RR durant le lap  # noqa: E501

        :param tire_rr_sliding_energy: The tire_rr_sliding_energy of this Lap.  # noqa: E501
        :type: float
        """

        self._tire_rr_sliding_energy = tire_rr_sliding_energy

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

        Distance covered in power  # noqa: E501

        :return: The distance_power of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._distance_power

    @distance_power.setter
    def distance_power(self, distance_power):
        """Sets the distance_power of this Lap.

        Distance covered in power  # noqa: E501

        :param distance_power: The distance_power of this Lap.  # noqa: E501
        :type: float
        """

        self._distance_power = distance_power

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

        Time elpased in power  # noqa: E501

        :return: The lap_time_power of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._lap_time_power

    @lap_time_power.setter
    def lap_time_power(self, lap_time_power):
        """Sets the lap_time_power of this Lap.

        Time elpased in power  # noqa: E501

        :param lap_time_power: The lap_time_power of this Lap.  # noqa: E501
        :type: float
        """

        self._lap_time_power = lap_time_power

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

        Lap energy  # noqa: E501

        :return: The energy of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._energy

    @energy.setter
    def energy(self, energy):
        """Sets the energy of this Lap.

        Lap energy  # noqa: E501

        :param energy: The energy of this Lap.  # noqa: E501
        :type: float
        """

        self._energy = energy

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

        Le time of the day de la télémétrie  # noqa: E501

        :return: The time_of_day of this Lap.  # noqa: E501
        :rtype: str
        """
        return self._time_of_day

    @time_of_day.setter
    def time_of_day(self, time_of_day):
        """Sets the time_of_day of this Lap.

        Le time of the day de la télémétrie  # noqa: E501

        :param time_of_day: The time_of_day of this Lap.  # noqa: E501
        :type: str
        """

        self._time_of_day = time_of_day

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

        Le niveau de consommation d'énergie  # noqa: E501

        :return: The consumption of this Lap.  # noqa: E501
        :rtype: float
        """
        return self._consumption

    @consumption.setter
    def consumption(self, consumption):
        """Sets the consumption of this Lap.

        Le niveau de consommation d'énergie  # noqa: E501

        :param consumption: The consumption of this Lap.  # noqa: E501
        :type: float
        """

        self._consumption = consumption

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

        Indique si le lap peut être utilisé par le run plan  # noqa: E501

        :return: The used_in_run_plan of this Lap.  # noqa: E501
        :rtype: bool
        """
        return self._used_in_run_plan

    @used_in_run_plan.setter
    def used_in_run_plan(self, used_in_run_plan):
        """Sets the used_in_run_plan of this Lap.

        Indique si le lap peut être utilisé par le run plan  # noqa: E501

        :param used_in_run_plan: The used_in_run_plan of this Lap.  # noqa: E501
        :type: bool
        """

        self._used_in_run_plan = used_in_run_plan

    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(Lap, 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, Lap):
            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, Lap):
            return True

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