# coding: utf-8

"""
    identity-service

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from dhicn_identity_service.configuration import Configuration


class ControlItem(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'item_name': 'str',
        'suggested_value': 'float',
        'ts_data': 'list[TsPair1]',
        'unit': 'str'
    }

    attribute_map = {
        'item_name': 'itemName',
        'suggested_value': 'suggestedValue',
        'ts_data': 'tsData',
        'unit': 'unit'
    }

    def __init__(self, item_name=None, suggested_value=None, ts_data=None, unit=None, local_vars_configuration=None):  # noqa: E501
        """ControlItem - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._item_name = None
        self._suggested_value = None
        self._ts_data = None
        self._unit = None
        self.discriminator = None

        self.item_name = item_name
        if suggested_value is not None:
            self.suggested_value = suggested_value
        self.ts_data = ts_data
        self.unit = unit

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

        控制项 control item name  # noqa: E501

        :return: The item_name of this ControlItem.  # noqa: E501
        :rtype: str
        """
        return self._item_name

    @item_name.setter
    def item_name(self, item_name):
        """Sets the item_name of this ControlItem.

        控制项 control item name  # noqa: E501

        :param item_name: The item_name of this ControlItem.  # noqa: E501
        :type: str
        """

        self._item_name = item_name

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

        建议值 suggested value  # noqa: E501

        :return: The suggested_value of this ControlItem.  # noqa: E501
        :rtype: float
        """
        return self._suggested_value

    @suggested_value.setter
    def suggested_value(self, suggested_value):
        """Sets the suggested_value of this ControlItem.

        建议值 suggested value  # noqa: E501

        :param suggested_value: The suggested_value of this ControlItem.  # noqa: E501
        :type: float
        """

        self._suggested_value = suggested_value

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

        时间序列值-图表显示 suggested time-series data  # noqa: E501

        :return: The ts_data of this ControlItem.  # noqa: E501
        :rtype: list[TsPair1]
        """
        return self._ts_data

    @ts_data.setter
    def ts_data(self, ts_data):
        """Sets the ts_data of this ControlItem.

        时间序列值-图表显示 suggested time-series data  # noqa: E501

        :param ts_data: The ts_data of this ControlItem.  # noqa: E501
        :type: list[TsPair1]
        """

        self._ts_data = ts_data

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

        单位 unit  # noqa: E501

        :return: The unit of this ControlItem.  # noqa: E501
        :rtype: str
        """
        return self._unit

    @unit.setter
    def unit(self, unit):
        """Sets the unit of this ControlItem.

        单位 unit  # noqa: E501

        :param unit: The unit of this ControlItem.  # noqa: E501
        :type: str
        """

        self._unit = unit

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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

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

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