# coding: utf-8

"""
    IoT服务

    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_iot_service.configuration import Configuration


class SaveTelemetryDataInput(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 = {
        'device_id': 'str',
        'telemetry_data_json': 'str',
        'use_rule': 'bool'
    }

    attribute_map = {
        'device_id': 'deviceId',
        'telemetry_data_json': 'telemetryDataJson',
        'use_rule': 'useRule'
    }

    def __init__(self, device_id=None, telemetry_data_json=None, use_rule=None, local_vars_configuration=None):  # noqa: E501
        """SaveTelemetryDataInput - 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._device_id = None
        self._telemetry_data_json = None
        self._use_rule = None
        self.discriminator = None

        self.device_id = device_id
        self.telemetry_data_json = telemetry_data_json
        if use_rule is not None:
            self.use_rule = use_rule

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

        设备ID device Id  # noqa: E501

        :return: The device_id of this SaveTelemetryDataInput.  # noqa: E501
        :rtype: str
        """
        return self._device_id

    @device_id.setter
    def device_id(self, device_id):
        """Sets the device_id of this SaveTelemetryDataInput.

        设备ID device Id  # noqa: E501

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

        self._device_id = device_id

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

        时间序列数据，JSON格式 time-series data in json format  Json:  {\"temperature\": 26}  {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}  [{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}}]  # noqa: E501

        :return: The telemetry_data_json of this SaveTelemetryDataInput.  # noqa: E501
        :rtype: str
        """
        return self._telemetry_data_json

    @telemetry_data_json.setter
    def telemetry_data_json(self, telemetry_data_json):
        """Sets the telemetry_data_json of this SaveTelemetryDataInput.

        时间序列数据，JSON格式 time-series data in json format  Json:  {\"temperature\": 26}  {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}  [{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}}]  # noqa: E501

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

        self._telemetry_data_json = telemetry_data_json

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

        是否启用规则，默认不启用  use rule engine or not, default false  # noqa: E501

        :return: The use_rule of this SaveTelemetryDataInput.  # noqa: E501
        :rtype: bool
        """
        return self._use_rule

    @use_rule.setter
    def use_rule(self, use_rule):
        """Sets the use_rule of this SaveTelemetryDataInput.

        是否启用规则，默认不启用  use rule engine or not, default false  # noqa: E501

        :param use_rule: The use_rule of this SaveTelemetryDataInput.  # noqa: E501
        :type: bool
        """

        self._use_rule = use_rule

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

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