# coding: utf-8

"""
    Karbon Platform Services API reference.

    OpenAPI documentation for public facing Karbon Platform Services API  This API documentation is generated from source code using go-swagger. Do not edit the generated kps_api.json directly!  # noqa: E501

    OpenAPI spec version: 1.0
    Contact: karbon-platform-services-api@nutanix.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class DataSourceFieldInfo(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 = {
        'field_type': 'str',
        'mqtt_topic': 'str',
        'name': 'str'
    }

    attribute_map = {
        'field_type': 'fieldType',
        'mqtt_topic': 'mqttTopic',
        'name': 'name'
    }

    def __init__(self, field_type=None, mqtt_topic=None, name=None):  # noqa: E501
        """DataSourceFieldInfo - a model defined in Swagger"""  # noqa: E501
        self._field_type = None
        self._mqtt_topic = None
        self._name = None
        self.discriminator = None
        self.field_type = field_type
        self.mqtt_topic = mqtt_topic
        self.name = name

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

        Data type for the field. For example, Temperature, Pressure, Custom, and so on. Specify Custom for the entire topic payload. No special extraction is performed. When you specify Custom, Karbon Platform Services might not perform intelligent operations automatically when you specify other fields like Temperature. In the future custom extraction functions for each field might be allowed. DataSource dataType is derived from fieldType of all fields in the data source.  # noqa: E501

        :return: The field_type of this DataSourceFieldInfo.  # noqa: E501
        :rtype: str
        """
        return self._field_type

    @field_type.setter
    def field_type(self, field_type):
        """Sets the field_type of this DataSourceFieldInfo.

        Data type for the field. For example, Temperature, Pressure, Custom, and so on. Specify Custom for the entire topic payload. No special extraction is performed. When you specify Custom, Karbon Platform Services might not perform intelligent operations automatically when you specify other fields like Temperature. In the future custom extraction functions for each field might be allowed. DataSource dataType is derived from fieldType of all fields in the data source.  # noqa: E501

        :param field_type: The field_type of this DataSourceFieldInfo.  # noqa: E501
        :type: str
        """
        if field_type is None:
            raise ValueError("Invalid value for `field_type`, must not be `None`")  # noqa: E501

        self._field_type = field_type

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

        Topic for the field. The topic specified depends on the protocol in the data source. Specify the mqqtTopic for the MQTT protocol. For the RTSP protocol, the topic is the server endpoint or named protocol stream in the RSTP URL.  # noqa: E501

        :return: The mqtt_topic of this DataSourceFieldInfo.  # noqa: E501
        :rtype: str
        """
        return self._mqtt_topic

    @mqtt_topic.setter
    def mqtt_topic(self, mqtt_topic):
        """Sets the mqtt_topic of this DataSourceFieldInfo.

        Topic for the field. The topic specified depends on the protocol in the data source. Specify the mqqtTopic for the MQTT protocol. For the RTSP protocol, the topic is the server endpoint or named protocol stream in the RSTP URL.  # noqa: E501

        :param mqtt_topic: The mqtt_topic of this DataSourceFieldInfo.  # noqa: E501
        :type: str
        """
        if mqtt_topic is None:
            raise ValueError("Invalid value for `mqtt_topic`, must not be `None`")  # noqa: E501

        self._mqtt_topic = mqtt_topic

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

        A unique name within the the data source.  # noqa: E501

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

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

        A unique name within the the data source.  # noqa: E501

        :param name: The name of this DataSourceFieldInfo.  # noqa: E501
        :type: str
        """
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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

        return self.__dict__ == other.__dict__

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