# 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 ModelField(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',
        'description': 'str',
        'type_of_model_field': 'str',
        'type_of_value': 'str',
        'type_of_value_source': 'str',
        'source_path': 'str',
        'source_tag': 'str',
        'followed': 'bool',
        'duplicate': 'bool',
        'is_computed_field': 'bool',
        'calcul_type': 'str',
        'target_model_field_id': 'str',
        'export_value_name': 'str',
        'export_constant_file_name': 'str',
        'list_id': 'str',
        'item_list_can_be_add': 'bool',
        'revision_selector_param': 'list[CoupleGuidText]',
        'revision_selector_show_only_group_rev': 'bool',
        'revision_editor_display_format': 'str',
        'script_content': 'str',
        'use_invalid_lap_for_calculation': 'bool',
        'tags': 'str',
        'default_value': 'object'
    }

    attribute_map = {
        'id': 'Id',
        'name': 'Name',
        'description': 'Description',
        'type_of_model_field': 'TypeOfModelField',
        'type_of_value': 'TypeOfValue',
        'type_of_value_source': 'TypeOfValueSource',
        'source_path': 'SourcePath',
        'source_tag': 'SourceTag',
        'followed': 'Followed',
        'duplicate': 'Duplicate',
        'is_computed_field': 'IsComputedField',
        'calcul_type': 'CalculType',
        'target_model_field_id': 'TargetModelFieldId',
        'export_value_name': 'ExportValueName',
        'export_constant_file_name': 'ExportConstantFileName',
        'list_id': 'ListId',
        'item_list_can_be_add': 'ItemListCanBeAdd',
        'revision_selector_param': 'RevisionSelectorParam',
        'revision_selector_show_only_group_rev': 'RevisionSelectorShowOnlyGroupRev',
        'revision_editor_display_format': 'RevisionEditorDisplayFormat',
        'script_content': 'ScriptContent',
        'use_invalid_lap_for_calculation': 'UseInvalidLapForCalculation',
        'tags': 'Tags',
        'default_value': 'DefaultValue'
    }

    def __init__(self, id=None, name=None, description=None, type_of_model_field=None, type_of_value=None, type_of_value_source=None, source_path=None, source_tag=None, followed=None, duplicate=None, is_computed_field=None, calcul_type=None, target_model_field_id=None, export_value_name=None, export_constant_file_name=None, list_id=None, item_list_can_be_add=None, revision_selector_param=None, revision_selector_show_only_group_rev=None, revision_editor_display_format=None, script_content=None, use_invalid_lap_for_calculation=None, tags=None, default_value=None, _configuration=None):  # noqa: E501
        """ModelField - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._name = None
        self._description = None
        self._type_of_model_field = None
        self._type_of_value = None
        self._type_of_value_source = None
        self._source_path = None
        self._source_tag = None
        self._followed = None
        self._duplicate = None
        self._is_computed_field = None
        self._calcul_type = None
        self._target_model_field_id = None
        self._export_value_name = None
        self._export_constant_file_name = None
        self._list_id = None
        self._item_list_can_be_add = None
        self._revision_selector_param = None
        self._revision_selector_show_only_group_rev = None
        self._revision_editor_display_format = None
        self._script_content = None
        self._use_invalid_lap_for_calculation = None
        self._tags = None
        self._default_value = None
        self.discriminator = None

        self.id = id
        self.name = name
        if description is not None:
            self.description = description
        self.type_of_model_field = type_of_model_field
        self.type_of_value = type_of_value
        if type_of_value_source is not None:
            self.type_of_value_source = type_of_value_source
        if source_path is not None:
            self.source_path = source_path
        if source_tag is not None:
            self.source_tag = source_tag
        if followed is not None:
            self.followed = followed
        if duplicate is not None:
            self.duplicate = duplicate
        if is_computed_field is not None:
            self.is_computed_field = is_computed_field
        if calcul_type is not None:
            self.calcul_type = calcul_type
        if target_model_field_id is not None:
            self.target_model_field_id = target_model_field_id
        if export_value_name is not None:
            self.export_value_name = export_value_name
        if export_constant_file_name is not None:
            self.export_constant_file_name = export_constant_file_name
        if list_id is not None:
            self.list_id = list_id
        if item_list_can_be_add is not None:
            self.item_list_can_be_add = item_list_can_be_add
        if revision_selector_param is not None:
            self.revision_selector_param = revision_selector_param
        if revision_selector_show_only_group_rev is not None:
            self.revision_selector_show_only_group_rev = revision_selector_show_only_group_rev
        if revision_editor_display_format is not None:
            self.revision_editor_display_format = revision_editor_display_format
        if script_content is not None:
            self.script_content = script_content
        if use_invalid_lap_for_calculation is not None:
            self.use_invalid_lap_for_calculation = use_invalid_lap_for_calculation
        if tags is not None:
            self.tags = tags
        if default_value is not None:
            self.default_value = default_value

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

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

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

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

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

        :param id: The id of this ModelField.  # 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 ModelField.  # noqa: E501

        The model field name  # noqa: E501

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

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

        The model field name  # noqa: E501

        :param name: The name of this ModelField.  # 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 description(self):
        """Gets the description of this ModelField.  # noqa: E501

        The model field description  # noqa: E501

        :return: The description of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this ModelField.

        The model field description  # noqa: E501

        :param description: The description of this ModelField.  # noqa: E501
        :type: str
        """

        self._description = description

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

        The model field type.  # noqa: E501

        :return: The type_of_model_field of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._type_of_model_field

    @type_of_model_field.setter
    def type_of_model_field(self, type_of_model_field):
        """Sets the type_of_model_field of this ModelField.

        The model field type.  # noqa: E501

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

        self._type_of_model_field = type_of_model_field

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

        The model field value type.  # noqa: E501

        :return: The type_of_value of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._type_of_value

    @type_of_value.setter
    def type_of_value(self, type_of_value):
        """Sets the type_of_value of this ModelField.

        The model field value type.  # noqa: E501

        :param type_of_value: The type_of_value of this ModelField.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and type_of_value is None:
            raise ValueError("Invalid value for `type_of_value`, 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
                type_of_value not in allowed_values):
            raise ValueError(
                "Invalid value for `type_of_value` ({0}), must be one of {1}"  # noqa: E501
                .format(type_of_value, allowed_values)
            )

        self._type_of_value = type_of_value

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

        The model field value source.  # noqa: E501

        :return: The type_of_value_source of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._type_of_value_source

    @type_of_value_source.setter
    def type_of_value_source(self, type_of_value_source):
        """Sets the type_of_value_source of this ModelField.

        The model field value source.  # noqa: E501

        :param type_of_value_source: The type_of_value_source of this ModelField.  # noqa: E501
        :type: str
        """
        allowed_values = ["Manual", "LapReport", "Excel", "Spc", "Server"]  # noqa: E501
        if (self._configuration.client_side_validation and
                type_of_value_source not in allowed_values):
            raise ValueError(
                "Invalid value for `type_of_value_source` ({0}), must be one of {1}"  # noqa: E501
                .format(type_of_value_source, allowed_values)
            )

        self._type_of_value_source = type_of_value_source

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

        The model field value source path.  # noqa: E501

        :return: The source_path of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._source_path

    @source_path.setter
    def source_path(self, source_path):
        """Sets the source_path of this ModelField.

        The model field value source path.  # noqa: E501

        :param source_path: The source_path of this ModelField.  # noqa: E501
        :type: str
        """

        self._source_path = source_path

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

        The location of informations into the value source.  # noqa: E501

        :return: The source_tag of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._source_tag

    @source_tag.setter
    def source_tag(self, source_tag):
        """Sets the source_tag of this ModelField.

        The location of informations into the value source.  # noqa: E501

        :param source_tag: The source_tag of this ModelField.  # noqa: E501
        :type: str
        """

        self._source_tag = source_tag

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

        Set to True to automatically use a value when the field is created.  # noqa: E501

        :return: The followed of this ModelField.  # noqa: E501
        :rtype: bool
        """
        return self._followed

    @followed.setter
    def followed(self, followed):
        """Sets the followed of this ModelField.

        Set to True to automatically use a value when the field is created.  # noqa: E501

        :param followed: The followed of this ModelField.  # noqa: E501
        :type: bool
        """

        self._followed = followed

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

        Set to True to use previous value when the field is created.  # noqa: E501

        :return: The duplicate of this ModelField.  # noqa: E501
        :rtype: bool
        """
        return self._duplicate

    @duplicate.setter
    def duplicate(self, duplicate):
        """Sets the duplicate of this ModelField.

        Set to True to use previous value when the field is created.  # noqa: E501

        :param duplicate: The duplicate of this ModelField.  # noqa: E501
        :type: bool
        """

        self._duplicate = duplicate

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

        Set to True for a computed field.  WARNING: Computed fields may be computed for all events.   This could take a long time depending on your database size (from few minutes to several hours) and this will overload the server.  # noqa: E501

        :return: The is_computed_field of this ModelField.  # noqa: E501
        :rtype: bool
        """
        return self._is_computed_field

    @is_computed_field.setter
    def is_computed_field(self, is_computed_field):
        """Sets the is_computed_field of this ModelField.

        Set to True for a computed field.  WARNING: Computed fields may be computed for all events.   This could take a long time depending on your database size (from few minutes to several hours) and this will overload the server.  # noqa: E501

        :param is_computed_field: The is_computed_field of this ModelField.  # noqa: E501
        :type: bool
        """

        self._is_computed_field = is_computed_field

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

        The calculation type for a computed field.  # noqa: E501

        :return: The calcul_type of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._calcul_type

    @calcul_type.setter
    def calcul_type(self, calcul_type):
        """Sets the calcul_type of this ModelField.

        The calculation type for a computed field.  # noqa: E501

        :param calcul_type: The calcul_type of this ModelField.  # noqa: E501
        :type: str
        """
        allowed_values = ["Min", "Max", "Avg", "Sum", "UseScript", "First", "Last", "FollowingDifferenceByTag"]  # noqa: E501
        if (self._configuration.client_side_validation and
                calcul_type not in allowed_values):
            raise ValueError(
                "Invalid value for `calcul_type` ({0}), must be one of {1}"  # noqa: E501
                .format(calcul_type, allowed_values)
            )

        self._calcul_type = calcul_type

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

        The model field id used for calculation of a computed field.  # noqa: E501

        :return: The target_model_field_id of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._target_model_field_id

    @target_model_field_id.setter
    def target_model_field_id(self, target_model_field_id):
        """Sets the target_model_field_id of this ModelField.

        The model field id used for calculation of a computed field.  # noqa: E501

        :param target_model_field_id: The target_model_field_id of this ModelField.  # noqa: E501
        :type: str
        """

        self._target_model_field_id = target_model_field_id

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

        Name of the value for the file export.  # noqa: E501

        :return: The export_value_name of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._export_value_name

    @export_value_name.setter
    def export_value_name(self, export_value_name):
        """Sets the export_value_name of this ModelField.

        Name of the value for the file export.  # noqa: E501

        :param export_value_name: The export_value_name of this ModelField.  # noqa: E501
        :type: str
        """

        self._export_value_name = export_value_name

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

        Name of the value for the file export.  # noqa: E501

        :return: The export_constant_file_name of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._export_constant_file_name

    @export_constant_file_name.setter
    def export_constant_file_name(self, export_constant_file_name):
        """Sets the export_constant_file_name of this ModelField.

        Name of the value for the file export.  # noqa: E501

        :param export_constant_file_name: The export_constant_file_name of this ModelField.  # noqa: E501
        :type: str
        """

        self._export_constant_file_name = export_constant_file_name

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

        The id of the list which is used for a List Selector field.  # noqa: E501

        :return: The list_id of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._list_id

    @list_id.setter
    def list_id(self, list_id):
        """Sets the list_id of this ModelField.

        The id of the list which is used for a List Selector field.  # noqa: E501

        :param list_id: The list_id of this ModelField.  # noqa: E501
        :type: str
        """

        self._list_id = list_id

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

        True if an item can be added locally.  # noqa: E501

        :return: The item_list_can_be_add of this ModelField.  # noqa: E501
        :rtype: bool
        """
        return self._item_list_can_be_add

    @item_list_can_be_add.setter
    def item_list_can_be_add(self, item_list_can_be_add):
        """Sets the item_list_can_be_add of this ModelField.

        True if an item can be added locally.  # noqa: E501

        :param item_list_can_be_add: The item_list_can_be_add of this ModelField.  # noqa: E501
        :type: bool
        """

        self._item_list_can_be_add = item_list_can_be_add

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

        List of Target/Group for revisions selection in the views.  # noqa: E501

        :return: The revision_selector_param of this ModelField.  # noqa: E501
        :rtype: list[CoupleGuidText]
        """
        return self._revision_selector_param

    @revision_selector_param.setter
    def revision_selector_param(self, revision_selector_param):
        """Sets the revision_selector_param of this ModelField.

        List of Target/Group for revisions selection in the views.  # noqa: E501

        :param revision_selector_param: The revision_selector_param of this ModelField.  # noqa: E501
        :type: list[CoupleGuidText]
        """

        self._revision_selector_param = revision_selector_param

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

        Set to True to show only group revisions in revisions list.  # noqa: E501

        :return: The revision_selector_show_only_group_rev of this ModelField.  # noqa: E501
        :rtype: bool
        """
        return self._revision_selector_show_only_group_rev

    @revision_selector_show_only_group_rev.setter
    def revision_selector_show_only_group_rev(self, revision_selector_show_only_group_rev):
        """Sets the revision_selector_show_only_group_rev of this ModelField.

        Set to True to show only group revisions in revisions list.  # noqa: E501

        :param revision_selector_show_only_group_rev: The revision_selector_show_only_group_rev of this ModelField.  # noqa: E501
        :type: bool
        """

        self._revision_selector_show_only_group_rev = revision_selector_show_only_group_rev

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

        The revision editor display format.  # noqa: E501

        :return: The revision_editor_display_format of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._revision_editor_display_format

    @revision_editor_display_format.setter
    def revision_editor_display_format(self, revision_editor_display_format):
        """Sets the revision_editor_display_format of this ModelField.

        The revision editor display format.  # noqa: E501

        :param revision_editor_display_format: The revision_editor_display_format of this ModelField.  # noqa: E501
        :type: str
        """
        allowed_values = ["NumericBox", "TextBox", "NumericMultiDim", "TextMultiDim"]  # noqa: E501
        if (self._configuration.client_side_validation and
                revision_editor_display_format not in allowed_values):
            raise ValueError(
                "Invalid value for `revision_editor_display_format` ({0}), must be one of {1}"  # noqa: E501
                .format(revision_editor_display_format, allowed_values)
            )

        self._revision_editor_display_format = revision_editor_display_format

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

        The Python script content.  # noqa: E501

        :return: The script_content of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._script_content

    @script_content.setter
    def script_content(self, script_content):
        """Sets the script_content of this ModelField.

        The Python script content.  # noqa: E501

        :param script_content: The script_content of this ModelField.  # noqa: E501
        :type: str
        """

        self._script_content = script_content

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

        Set to True to allow invalid laps in calculations.  # noqa: E501

        :return: The use_invalid_lap_for_calculation of this ModelField.  # noqa: E501
        :rtype: bool
        """
        return self._use_invalid_lap_for_calculation

    @use_invalid_lap_for_calculation.setter
    def use_invalid_lap_for_calculation(self, use_invalid_lap_for_calculation):
        """Sets the use_invalid_lap_for_calculation of this ModelField.

        Set to True to allow invalid laps in calculations.  # noqa: E501

        :param use_invalid_lap_for_calculation: The use_invalid_lap_for_calculation of this ModelField.  # noqa: E501
        :type: bool
        """

        self._use_invalid_lap_for_calculation = use_invalid_lap_for_calculation

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

        Tags associated with the model field.  # noqa: E501

        :return: The tags of this ModelField.  # noqa: E501
        :rtype: str
        """
        return self._tags

    @tags.setter
    def tags(self, tags):
        """Sets the tags of this ModelField.

        Tags associated with the model field.  # noqa: E501

        :param tags: The tags of this ModelField.  # noqa: E501
        :type: str
        """

        self._tags = tags

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

        The default value.  # noqa: E501

        :return: The default_value of this ModelField.  # noqa: E501
        :rtype: object
        """
        return self._default_value

    @default_value.setter
    def default_value(self, default_value):
        """Sets the default_value of this ModelField.

        The default value.  # noqa: E501

        :param default_value: The default_value of this ModelField.  # noqa: E501
        :type: object
        """

        self._default_value = default_value

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

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