# 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 Parameter(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',
        'value_type': 'str',
        'target_id': 'str',
        'created_in_version': 'str',
        'last_update_date_utc': 'datetime',
        'last_update_user': 'str',
        'version_id': 'str',
        'group_id': 'str',
        'parameter_definition': 'Calibration',
        'responsible': 'str'
    }

    attribute_map = {
        'id': 'Id',
        'name': 'Name',
        'value_type': 'ValueType',
        'target_id': 'TargetId',
        'created_in_version': 'CreatedInVersion',
        'last_update_date_utc': 'LastUpdateDateUtc',
        'last_update_user': 'LastUpdateUser',
        'version_id': 'VersionId',
        'group_id': 'GroupId',
        'parameter_definition': 'ParameterDefinition',
        'responsible': 'Responsible'
    }

    def __init__(self, id=None, name=None, value_type=None, target_id=None, created_in_version=None, last_update_date_utc=None, last_update_user=None, version_id=None, group_id=None, parameter_definition=None, responsible=None, _configuration=None):  # noqa: E501
        """Parameter - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._name = None
        self._value_type = None
        self._target_id = None
        self._created_in_version = None
        self._last_update_date_utc = None
        self._last_update_user = None
        self._version_id = None
        self._group_id = None
        self._parameter_definition = None
        self._responsible = None
        self.discriminator = None

        self.id = id
        self.name = name
        self.value_type = value_type
        self.target_id = target_id
        if created_in_version is not None:
            self.created_in_version = created_in_version
        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
        self.version_id = version_id
        if group_id is not None:
            self.group_id = group_id
        if parameter_definition is not None:
            self.parameter_definition = parameter_definition
        if responsible is not None:
            self.responsible = responsible

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

        The unique parameter id  # noqa: E501

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

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

        The unique parameter id  # noqa: E501

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

        The parameter name  # noqa: E501

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

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

        The parameter name  # noqa: E501

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

        The parameter value type   None = 0, String = 1, Double = 2, Integer = 3  # noqa: E501

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

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

        The parameter value type   None = 0, String = 1, Double = 2, Integer = 3  # noqa: E501

        :param value_type: The value_type of this Parameter.  # 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 = ["None", "String", "Double", "Integer"]  # 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 target_id(self):
        """Gets the target_id of this Parameter.  # noqa: E501

        The target id to which the parameter belongs to.  Parameters are linked to the version through the VersionParam object.  But you don't have to care about this. Just call th parameters Api function and provide a version id to which you want to get the parameters.  # noqa: E501

        :return: The target_id of this Parameter.  # noqa: E501
        :rtype: str
        """
        return self._target_id

    @target_id.setter
    def target_id(self, target_id):
        """Sets the target_id of this Parameter.

        The target id to which the parameter belongs to.  Parameters are linked to the version through the VersionParam object.  But you don't have to care about this. Just call th parameters Api function and provide a version id to which you want to get the parameters.  # noqa: E501

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

        self._target_id = target_id

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

        The first version to which the parameter has been created for.  # noqa: E501

        :return: The created_in_version of this Parameter.  # noqa: E501
        :rtype: str
        """
        return self._created_in_version

    @created_in_version.setter
    def created_in_version(self, created_in_version):
        """Sets the created_in_version of this Parameter.

        The first version to which the parameter has been created for.  # noqa: E501

        :param created_in_version: The created_in_version of this Parameter.  # noqa: E501
        :type: str
        """

        self._created_in_version = created_in_version

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

        The last utc date time when the properties of the paremeter 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 Parameter.  # 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 Parameter.

        The last utc date time when the properties of the paremeter 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 Parameter.  # 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 Parameter.  # noqa: E501

        The name of the last user having updated the parameter.  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 Parameter.  # 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 Parameter.

        The name of the last user having updated the parameter.  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 Parameter.  # noqa: E501
        :type: str
        """

        self._last_update_user = last_update_user

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

        The version Id to which the parameter is linked  # noqa: E501

        :return: The version_id of this Parameter.  # noqa: E501
        :rtype: str
        """
        return self._version_id

    @version_id.setter
    def version_id(self, version_id):
        """Sets the version_id of this Parameter.

        The version Id to which the parameter is linked  # noqa: E501

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

        self._version_id = version_id

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

        The group id to which the parameter is located.   Or Guid.Empty (00000000-0000-0000-0000-000000000000) if the paramater is located on the root.  # noqa: E501

        :return: The group_id of this Parameter.  # noqa: E501
        :rtype: str
        """
        return self._group_id

    @group_id.setter
    def group_id(self, group_id):
        """Sets the group_id of this Parameter.

        The group id to which the parameter is located.   Or Guid.Empty (00000000-0000-0000-0000-000000000000) if the paramater is located on the root.  # noqa: E501

        :param group_id: The group_id of this Parameter.  # noqa: E501
        :type: str
        """

        self._group_id = group_id

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


        :return: The parameter_definition of this Parameter.  # noqa: E501
        :rtype: Calibration
        """
        return self._parameter_definition

    @parameter_definition.setter
    def parameter_definition(self, parameter_definition):
        """Sets the parameter_definition of this Parameter.


        :param parameter_definition: The parameter_definition of this Parameter.  # noqa: E501
        :type: Calibration
        """

        self._parameter_definition = parameter_definition

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

        The parameter's responsible name for the specified version  # noqa: E501

        :return: The responsible of this Parameter.  # noqa: E501
        :rtype: str
        """
        return self._responsible

    @responsible.setter
    def responsible(self, responsible):
        """Sets the responsible of this Parameter.

        The parameter's responsible name for the specified version  # noqa: E501

        :param responsible: The responsible of this Parameter.  # noqa: E501
        :type: str
        """

        self._responsible = responsible

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

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