# 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 ValueField(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',
        'model_field_id': 'str',
        'value': 'object',
        'is_valid': 'bool',
        'parent_item_id': 'str',
        'last_update_date_utc': 'datetime',
        'last_update_user': 'str'
    }

    attribute_map = {
        'id': 'Id',
        'model_field_id': 'ModelFieldId',
        'value': 'Value',
        'is_valid': 'IsValid',
        'parent_item_id': 'ParentItemId',
        'last_update_date_utc': 'LastUpdateDateUtc',
        'last_update_user': 'LastUpdateUser'
    }

    def __init__(self, id=None, model_field_id=None, value=None, is_valid=True, parent_item_id=None, last_update_date_utc=None, last_update_user=None, _configuration=None):  # noqa: E501
        """ValueField - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._model_field_id = None
        self._value = None
        self._is_valid = None
        self._parent_item_id = None
        self._last_update_date_utc = None
        self._last_update_user = None
        self.discriminator = None

        self.id = id
        self.model_field_id = model_field_id
        if value is not None:
            self.value = value
        if is_valid is not None:
            self.is_valid = is_valid
        self.parent_item_id = parent_item_id
        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

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

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

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

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

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

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

        The model field id to which the value is linked  # noqa: E501

        :return: The model_field_id of this ValueField.  # noqa: E501
        :rtype: str
        """
        return self._model_field_id

    @model_field_id.setter
    def model_field_id(self, model_field_id):
        """Sets the model_field_id of this ValueField.

        The model field id to which the value is linked  # noqa: E501

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

        self._model_field_id = model_field_id

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

        The value object.  # noqa: E501

        :return: The value of this ValueField.  # noqa: E501
        :rtype: object
        """
        return self._value

    @value.setter
    def value(self, value):
        """Sets the value of this ValueField.

        The value object.  # noqa: E501

        :param value: The value of this ValueField.  # noqa: E501
        :type: object
        """

        self._value = value

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

        Set to True when the value is valid.  # noqa: E501

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

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

        Set to True when the value is valid.  # noqa: E501

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

        self._is_valid = is_valid

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

        The id of the parent entity (event, car, session, run, lap) which owns the value.  # noqa: E501

        :return: The parent_item_id of this ValueField.  # noqa: E501
        :rtype: str
        """
        return self._parent_item_id

    @parent_item_id.setter
    def parent_item_id(self, parent_item_id):
        """Sets the parent_item_id of this ValueField.

        The id of the parent entity (event, car, session, run, lap) which owns the value.  # noqa: E501

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

        self._parent_item_id = parent_item_id

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

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

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

        self._last_update_user = last_update_user

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

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