# coding: utf-8

"""
    teralytic

    Teralytic-API allows customers and partners to view their probes, sensor readings for each, as well as analytics and calculations from Teralytic algorithms.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from teralytic.models.depth_reading import DepthReading  # noqa: F401,E501
from teralytic.models.micro_climate_data import MicroClimateData  # noqa: F401,E501
from teralytic.models.reading_location import ReadingLocation  # noqa: F401,E501
from teralytic.models.weather_data import WeatherData  # 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',
        'probe': 'list[DepthReading]',
        'micro_climate': 'MicroClimateData',
        'macro_climate': 'WeatherData'
    }

    attribute_map = {
        'id': 'id',
        'probe_id': 'probe_id',
        'probe_name': 'probe_name',
        'field_id': 'field_id',
        'timestamp': 'timestamp',
        'location': 'location',
        'probe': 'probe',
        'micro_climate': 'micro_climate',
        'macro_climate': 'macro_climate'
    }

    def __init__(self, id=None, probe_id=None, probe_name=None, field_id=None, timestamp=None, location=None, probe=None, micro_climate=None, macro_climate=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._probe = None
        self._micro_climate = None
        self._macro_climate = None
        self.discriminator = None

        self.id = id
        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 probe is not None:
            self.probe = probe
        if micro_climate is not None:
            self.micro_climate = micro_climate
        if macro_climate is not None:
            self.macro_climate = macro_climate

    @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
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        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
        """
        if probe_id is None:
            raise ValueError("Invalid value for `probe_id`, must not be `None`")  # noqa: E501

        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 probe(self):
        """Gets the probe of this Reading.  # noqa: E501

        Probe readings  # noqa: E501

        :return: The probe of this Reading.  # noqa: E501
        :rtype: list[DepthReading]
        """
        return self._probe

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

        Probe readings  # noqa: E501

        :param probe: The probe of this Reading.  # noqa: E501
        :type: list[DepthReading]
        """

        self._probe = probe

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


        :return: The micro_climate of this Reading.  # noqa: E501
        :rtype: MicroClimateData
        """
        return self._micro_climate

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


        :param micro_climate: The micro_climate of this Reading.  # noqa: E501
        :type: MicroClimateData
        """

        self._micro_climate = micro_climate

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


        :return: The macro_climate of this Reading.  # noqa: E501
        :rtype: WeatherData
        """
        return self._macro_climate

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


        :param macro_climate: The macro_climate of this Reading.  # noqa: E501
        :type: WeatherData
        """

        self._macro_climate = macro_climate

    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

        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
