# coding: utf-8

"""
    teralytic

    The Teralytic API allows clients to manage their organization, view their fields and and probes, and query sensor readings and analytics.  For sandbox testing you may use the api key: `swagger.teralytic.io`   # noqa: E501

    OpenAPI spec version: 1.0.6
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from teralytic.models.reading_data import ReadingData  # noqa: F401,E501
from teralytic.models.reading_location import ReadingLocation  # noqa: F401,E501


class Reading(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',
        'probe_id': 'str',
        'probe_name': 'str',
        'field_id': 'str',
        'timestamp': 'str',
        'location': 'ReadingLocation',
        'operation': 'str',
        'readings': 'list[ReadingData]'
    }

    attribute_map = {
        'id': 'id',
        'probe_id': 'probe_id',
        'probe_name': 'probe_name',
        'field_id': 'field_id',
        'timestamp': 'timestamp',
        'location': 'location',
        'operation': 'operation',
        'readings': 'readings'
    }

    def __init__(self, id=None, probe_id=None, probe_name=None, field_id=None, timestamp=None, location=None, operation=None, readings=None):  # noqa: E501
        """Reading - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._probe_id = None
        self._probe_name = None
        self._field_id = None
        self._timestamp = None
        self._location = None
        self._operation = None
        self._readings = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if probe_id is not None:
            self.probe_id = probe_id
        if probe_name is not None:
            self.probe_name = probe_name
        if field_id is not None:
            self.field_id = field_id
        if timestamp is not None:
            self.timestamp = timestamp
        if location is not None:
            self.location = location
        if operation is not None:
            self.operation = operation
        if readings is not None:
            self.readings = readings

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

        Base58 encoded identifier for this reading. Corresponds with a single Probe and single timestamp.  # noqa: E501

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

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

        Base58 encoded identifier for this reading. Corresponds with a single Probe and single timestamp.  # noqa: E501

        :param id: The id of this Reading.  # noqa: E501
        :type: str
        """

        self._id = id

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

        id of probe from which Reading was made  # noqa: E501

        :return: The probe_id of this Reading.  # noqa: E501
        :rtype: str
        """
        return self._probe_id

    @probe_id.setter
    def probe_id(self, probe_id):
        """Sets the probe_id of this Reading.

        id of probe from which Reading was made  # noqa: E501

        :param probe_id: The probe_id of this Reading.  # noqa: E501
        :type: str
        """

        self._probe_id = probe_id

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

        Name of probe from which Reading was made  # noqa: E501

        :return: The probe_name of this Reading.  # noqa: E501
        :rtype: str
        """
        return self._probe_name

    @probe_name.setter
    def probe_name(self, probe_name):
        """Sets the probe_name of this Reading.

        Name of probe from which Reading was made  # noqa: E501

        :param probe_name: The probe_name of this Reading.  # noqa: E501
        :type: str
        """

        self._probe_name = probe_name

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

        The field id of the probe  # noqa: E501

        :return: The field_id of this Reading.  # noqa: E501
        :rtype: str
        """
        return self._field_id

    @field_id.setter
    def field_id(self, field_id):
        """Sets the field_id of this Reading.

        The field id of the probe  # noqa: E501

        :param field_id: The field_id of this Reading.  # noqa: E501
        :type: str
        """

        self._field_id = field_id

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

        Time when Reading was measured  # noqa: E501

        :return: The timestamp of this Reading.  # noqa: E501
        :rtype: str
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this Reading.

        Time when Reading was measured  # noqa: E501

        :param timestamp: The timestamp of this Reading.  # noqa: E501
        :type: str
        """

        self._timestamp = timestamp

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


        :return: The location of this Reading.  # noqa: E501
        :rtype: ReadingLocation
        """
        return self._location

    @location.setter
    def location(self, location):
        """Sets the location of this Reading.


        :param location: The location of this Reading.  # noqa: E501
        :type: ReadingLocation
        """

        self._location = location

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

        The analytics operation  # noqa: E501

        :return: The operation of this Reading.  # noqa: E501
        :rtype: str
        """
        return self._operation

    @operation.setter
    def operation(self, operation):
        """Sets the operation of this Reading.

        The analytics operation  # noqa: E501

        :param operation: The operation of this Reading.  # noqa: E501
        :type: str
        """

        self._operation = operation

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

        Probe readings  # noqa: E501

        :return: The readings of this Reading.  # noqa: E501
        :rtype: list[ReadingData]
        """
        return self._readings

    @readings.setter
    def readings(self, readings):
        """Sets the readings of this Reading.

        Probe readings  # noqa: E501

        :param readings: The readings of this Reading.  # noqa: E501
        :type: list[ReadingData]
        """

        self._readings = readings

    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(Reading, 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, Reading):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
