# 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 ItemValueKey(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 = {
        'model_field_id': 'str',
        'parent_item_id': 'str'
    }

    attribute_map = {
        'model_field_id': 'ModelFieldId',
        'parent_item_id': 'ParentItemId'
    }

    def __init__(self, model_field_id=None, parent_item_id=None, _configuration=None):  # noqa: E501
        """ItemValueKey - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._model_field_id = None
        self._parent_item_id = None
        self.discriminator = None

        self.model_field_id = model_field_id
        self.parent_item_id = parent_item_id

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

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

        :return: The model_field_id of this ItemValueKey.  # 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 ItemValueKey.

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

        :param model_field_id: The model_field_id of this ItemValueKey.  # 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 parent_item_id(self):
        """Gets the parent_item_id of this ItemValueKey.  # 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 ItemValueKey.  # 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 ItemValueKey.

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

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

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