# 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 FixedField(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',
        'display_name': 'str',
        'property_name': 'str',
        'entity_type': 'str',
        'value_type': 'str',
        'read_only': 'bool',
        'table_reference': 'str',
        'is_computable': 'bool'
    }

    attribute_map = {
        'id': 'Id',
        'display_name': 'DisplayName',
        'property_name': 'PropertyName',
        'entity_type': 'EntityType',
        'value_type': 'ValueType',
        'read_only': 'ReadOnly',
        'table_reference': 'TableReference',
        'is_computable': 'IsComputable'
    }

    def __init__(self, id=None, display_name=None, property_name=None, entity_type=None, value_type=None, read_only=None, table_reference=None, is_computable=None, _configuration=None):  # noqa: E501
        """FixedField - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._display_name = None
        self._property_name = None
        self._entity_type = None
        self._value_type = None
        self._read_only = None
        self._table_reference = None
        self._is_computable = None
        self.discriminator = None

        self.id = id
        self.display_name = display_name
        self.property_name = property_name
        self.entity_type = entity_type
        self.value_type = value_type
        if read_only is not None:
            self.read_only = read_only
        if table_reference is not None:
            self.table_reference = table_reference
        if is_computable is not None:
            self.is_computable = is_computable

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

        The unique fixed field Id.  # noqa: E501

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

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

        The unique fixed field Id.  # noqa: E501

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

        The fixed field display name.  # noqa: E501

        :return: The display_name of this FixedField.  # noqa: E501
        :rtype: str
        """
        return self._display_name

    @display_name.setter
    def display_name(self, display_name):
        """Sets the display_name of this FixedField.

        The fixed field display name.  # noqa: E501

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

        self._display_name = display_name

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

        The name of the property associated with the fixed field.  # noqa: E501

        :return: The property_name of this FixedField.  # noqa: E501
        :rtype: str
        """
        return self._property_name

    @property_name.setter
    def property_name(self, property_name):
        """Sets the property_name of this FixedField.

        The name of the property associated with the fixed field.  # noqa: E501

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

        self._property_name = property_name

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

        The entity type which contains the fixed field.  # noqa: E501

        :return: The entity_type of this FixedField.  # noqa: E501
        :rtype: str
        """
        return self._entity_type

    @entity_type.setter
    def entity_type(self, entity_type):
        """Sets the entity_type of this FixedField.

        The entity type which contains the fixed field.  # noqa: E501

        :param entity_type: The entity_type of this FixedField.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and entity_type is None:
            raise ValueError("Invalid value for `entity_type`, must not be `None`")  # noqa: E501
        allowed_values = ["Event", "Session", "Run", "Lap", "Car"]  # noqa: E501
        if (self._configuration.client_side_validation and
                entity_type not in allowed_values):
            raise ValueError(
                "Invalid value for `entity_type` ({0}), must be one of {1}"  # noqa: E501
                .format(entity_type, allowed_values)
            )

        self._entity_type = entity_type

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

        The fixed field value type.  # noqa: E501

        :return: The value_type of this FixedField.  # noqa: E501
        :rtype: str
        """
        return self._value_type

    @value_type.setter
    def value_type(self, value_type):
        """Sets the value_type of this FixedField.

        The fixed field value type.  # noqa: E501

        :param value_type: The value_type of this FixedField.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and value_type is None:
            raise ValueError("Invalid value for `value_type`, must not be `None`")  # noqa: E501
        allowed_values = ["Double", "String", "Bool", "TimeSpan", "DateTime", "TeamDBList", "Int", "Rtf", "StringMultiline", "TeamDBGrid", "Image", "File", "RevisionSelector", "RevisionEditor", "HyperlinkTextBox", "HyperlinkIntTextBox", "LifingRunMountingDiff", "Files", "Text"]  # noqa: E501
        if (self._configuration.client_side_validation and
                value_type not in allowed_values):
            raise ValueError(
                "Invalid value for `value_type` ({0}), must be one of {1}"  # noqa: E501
                .format(value_type, allowed_values)
            )

        self._value_type = value_type

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

        Set to True for a read only fixed field.  # noqa: E501

        :return: The read_only of this FixedField.  # noqa: E501
        :rtype: bool
        """
        return self._read_only

    @read_only.setter
    def read_only(self, read_only):
        """Sets the read_only of this FixedField.

        Set to True for a read only fixed field.  # noqa: E501

        :param read_only: The read_only of this FixedField.  # noqa: E501
        :type: bool
        """

        self._read_only = read_only

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

        The table name if referenced for the data.  # noqa: E501

        :return: The table_reference of this FixedField.  # noqa: E501
        :rtype: str
        """
        return self._table_reference

    @table_reference.setter
    def table_reference(self, table_reference):
        """Sets the table_reference of this FixedField.

        The table name if referenced for the data.  # noqa: E501

        :param table_reference: The table_reference of this FixedField.  # noqa: E501
        :type: str
        """

        self._table_reference = table_reference

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

        Set to True if the fixed field can be used for a computed field.  # noqa: E501

        :return: The is_computable of this FixedField.  # noqa: E501
        :rtype: bool
        """
        return self._is_computable

    @is_computable.setter
    def is_computable(self, is_computable):
        """Sets the is_computable of this FixedField.

        Set to True if the fixed field can be used for a computed field.  # noqa: E501

        :param is_computable: The is_computable of this FixedField.  # noqa: E501
        :type: bool
        """

        self._is_computable = is_computable

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

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