# 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
from kps_api.models.data_source_field_info_v2 import DataSourceFieldInfoV2  # noqa: F401,E501
from kps_api.models.data_source_field_selector import DataSourceFieldSelector  # noqa: F401,E501
from kps_api.models.data_source_ifc_info import DataSourceIfcInfo  # noqa: F401,E501


class DataSourceV2(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 = {
        'auth_type': 'str',
        'edge_id': 'str',
        'fields': 'list[DataSourceFieldInfoV2]',
        'id': 'str',
        'ifc_info': 'DataSourceIfcInfo',
        'name': 'str',
        'protocol': 'str',
        'selectors': 'list[DataSourceFieldSelector]',
        'type': 'str'
    }

    attribute_map = {
        'auth_type': 'authType',
        'edge_id': 'edgeId',
        'fields': 'fields',
        'id': 'id',
        'ifc_info': 'ifcInfo',
        'name': 'name',
        'protocol': 'protocol',
        'selectors': 'selectors',
        'type': 'type'
    }

    def __init__(self, auth_type=None, edge_id=None, fields=None, id=None, ifc_info=None, name=None, protocol=None, selectors=None, type=None):  # noqa: E501
        """DataSourceV2 - a model defined in Swagger"""  # noqa: E501
        self._auth_type = None
        self._edge_id = None
        self._fields = None
        self._id = None
        self._ifc_info = None
        self._name = None
        self._protocol = None
        self._selectors = None
        self._type = None
        self.discriminator = None
        self.auth_type = auth_type
        self.edge_id = edge_id
        self.fields = fields
        if id is not None:
            self.id = id
        if ifc_info is not None:
            self.ifc_info = ifc_info
        self.name = name
        self.protocol = protocol
        self.selectors = selectors
        self.type = type

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

        Type of authentication used by sensor  # noqa: E501

        :return: The auth_type of this DataSourceV2.  # noqa: E501
        :rtype: str
        """
        return self._auth_type

    @auth_type.setter
    def auth_type(self, auth_type):
        """Sets the auth_type of this DataSourceV2.

        Type of authentication used by sensor  # noqa: E501

        :param auth_type: The auth_type of this DataSourceV2.  # noqa: E501
        :type: str
        """
        if auth_type is None:
            raise ValueError("Invalid value for `auth_type`, must not be `None`")  # noqa: E501
        allowed_values = ["CERTIFICATE", "PASSWORD", "TOKEN"]  # noqa: E501
        if auth_type not in allowed_values:
            raise ValueError(
                "Invalid value for `auth_type` ({0}), must be one of {1}"  # noqa: E501
                .format(auth_type, allowed_values)
            )

        self._auth_type = auth_type

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

        ID of the edge this entity belongs to  # noqa: E501

        :return: The edge_id of this DataSourceV2.  # noqa: E501
        :rtype: str
        """
        return self._edge_id

    @edge_id.setter
    def edge_id(self, edge_id):
        """Sets the edge_id of this DataSourceV2.

        ID of the edge this entity belongs to  # noqa: E501

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

        self._edge_id = edge_id

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

        User defined fields to extract data from the topic payload.  # noqa: E501

        :return: The fields of this DataSourceV2.  # noqa: E501
        :rtype: list[DataSourceFieldInfoV2]
        """
        return self._fields

    @fields.setter
    def fields(self, fields):
        """Sets the fields of this DataSourceV2.

        User defined fields to extract data from the topic payload.  # noqa: E501

        :param fields: The fields of this DataSourceV2.  # noqa: E501
        :type: list[DataSourceFieldInfoV2]
        """
        if fields is None:
            raise ValueError("Invalid value for `fields`, must not be `None`")  # noqa: E501

        self._fields = fields

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

        ID of the entity Maximum character length is 64 for project, category, and runtime environment, 36 for other entity types.  # noqa: E501

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

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

        ID of the entity Maximum character length is 64 for project, category, and runtime environment, 36 for other entity types.  # noqa: E501

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

        self._id = id

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


        :return: The ifc_info of this DataSourceV2.  # noqa: E501
        :rtype: DataSourceIfcInfo
        """
        return self._ifc_info

    @ifc_info.setter
    def ifc_info(self, ifc_info):
        """Sets the ifc_info of this DataSourceV2.


        :param ifc_info: The ifc_info of this DataSourceV2.  # noqa: E501
        :type: DataSourceIfcInfo
        """

        self._ifc_info = ifc_info

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


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

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


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

        self._name = name

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

        Sensor protocol  # noqa: E501

        :return: The protocol of this DataSourceV2.  # noqa: E501
        :rtype: str
        """
        return self._protocol

    @protocol.setter
    def protocol(self, protocol):
        """Sets the protocol of this DataSourceV2.

        Sensor protocol  # noqa: E501

        :param protocol: The protocol of this DataSourceV2.  # noqa: E501
        :type: str
        """
        if protocol is None:
            raise ValueError("Invalid value for `protocol`, must not be `None`")  # noqa: E501
        allowed_values = ["MQTT", "RTSP", "GIGEVISION", "OTHER", "DATAINTERFACE"]  # noqa: E501
        if protocol not in allowed_values:
            raise ValueError(
                "Invalid value for `protocol` ({0}), must be one of {1}"  # noqa: E501
                .format(protocol, allowed_values)
            )

        self._protocol = protocol

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

        A list of DataSourceFieldSelector users assigned to the data source. Allows a user to use Category selectors to identify the data pipeline source. Selectors with different category IDs are combined with the AND operator, while selectors with the same category ID are combined with the OR operator.  # noqa: E501

        :return: The selectors of this DataSourceV2.  # noqa: E501
        :rtype: list[DataSourceFieldSelector]
        """
        return self._selectors

    @selectors.setter
    def selectors(self, selectors):
        """Sets the selectors of this DataSourceV2.

        A list of DataSourceFieldSelector users assigned to the data source. Allows a user to use Category selectors to identify the data pipeline source. Selectors with different category IDs are combined with the AND operator, while selectors with the same category ID are combined with the OR operator.  # noqa: E501

        :param selectors: The selectors of this DataSourceV2.  # noqa: E501
        :type: list[DataSourceFieldSelector]
        """
        if selectors is None:
            raise ValueError("Invalid value for `selectors`, must not be `None`")  # noqa: E501

        self._selectors = selectors

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

        Type of data source. Sensor or Gateway  # noqa: E501

        :return: The type of this DataSourceV2.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this DataSourceV2.

        Type of data source. Sensor or Gateway  # noqa: E501

        :param type: The type of this DataSourceV2.  # noqa: E501
        :type: str
        """
        if type is None:
            raise ValueError("Invalid value for `type`, must not be `None`")  # noqa: E501
        allowed_values = ["Sensor", "Gateway"]  # noqa: E501
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

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

        return self.__dict__ == other.__dict__

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