# coding: utf-8

"""
    Paragon Insights APIs

    API interface for PI application  # noqa: E501

    OpenAPI spec version: 4.0.0
    Contact: healthbot-feedback@juniper.net
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class NotificationSchemaKafkapublish(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 = {
        'bootstrap_servers': 'list[str]',
        'sasl': 'NotificationSchemaKafkapublishSasl',
        'topic': 'str',
        'use_hash_partitioner': 'bool'
    }

    attribute_map = {
        'bootstrap_servers': 'bootstrap-servers',
        'sasl': 'sasl',
        'topic': 'topic',
        'use_hash_partitioner': 'use-hash-partitioner'
    }

    def __init__(self, bootstrap_servers=None, sasl=None, topic=None, use_hash_partitioner=None):  # noqa: E501
        """NotificationSchemaKafkapublish - a model defined in Swagger"""  # noqa: E501

        self._bootstrap_servers = None
        self._sasl = None
        self._topic = None
        self._use_hash_partitioner = None
        self.discriminator = None

        self.bootstrap_servers = bootstrap_servers
        if sasl is not None:
            self.sasl = sasl
        if topic is not None:
            self.topic = topic
        if use_hash_partitioner is not None:
            self.use_hash_partitioner = use_hash_partitioner

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


        :return: The bootstrap_servers of this NotificationSchemaKafkapublish.  # noqa: E501
        :rtype: list[str]
        """
        return self._bootstrap_servers

    @bootstrap_servers.setter
    def bootstrap_servers(self, bootstrap_servers):
        """Sets the bootstrap_servers of this NotificationSchemaKafkapublish.


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

        self._bootstrap_servers = bootstrap_servers

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


        :return: The sasl of this NotificationSchemaKafkapublish.  # noqa: E501
        :rtype: NotificationSchemaKafkapublishSasl
        """
        return self._sasl

    @sasl.setter
    def sasl(self, sasl):
        """Sets the sasl of this NotificationSchemaKafkapublish.


        :param sasl: The sasl of this NotificationSchemaKafkapublish.  # noqa: E501
        :type: NotificationSchemaKafkapublishSasl
        """

        self._sasl = sasl

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

        Kafka topic to which Healthbot should publish. Should be of pattern \\.*[a-zA-Z0-9_-]+[a-zA-Z0-9\\._-]* , Default value is derived from <device/network-group>.<device-id>.<topic>.<rule>.<trigger>  # noqa: E501

        :return: The topic of this NotificationSchemaKafkapublish.  # noqa: E501
        :rtype: str
        """
        return self._topic

    @topic.setter
    def topic(self, topic):
        """Sets the topic of this NotificationSchemaKafkapublish.

        Kafka topic to which Healthbot should publish. Should be of pattern \\.*[a-zA-Z0-9_-]+[a-zA-Z0-9\\._-]* , Default value is derived from <device/network-group>.<device-id>.<topic>.<rule>.<trigger>  # noqa: E501

        :param topic: The topic of this NotificationSchemaKafkapublish.  # noqa: E501
        :type: str
        """
        if topic is not None and len(topic) > 249:
            raise ValueError("Invalid value for `topic`, length must be less than or equal to `249`")  # noqa: E501
        if topic is not None and not re.search(r'^\\.*[a-zA-Z0-9_-]+[a-zA-Z0-9\\._-]*$', topic):  # noqa: E501
            raise ValueError(r"Invalid value for `topic`, must be a follow pattern or equal to `/^\\.*[a-zA-Z0-9_-]+[a-zA-Z0-9\\._-]*$/`")  # noqa: E501

        self._topic = topic

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

        If true, key will be generated which will be hashed to provide a consistent partition number for the given kafka topic  # noqa: E501

        :return: The use_hash_partitioner of this NotificationSchemaKafkapublish.  # noqa: E501
        :rtype: bool
        """
        return self._use_hash_partitioner

    @use_hash_partitioner.setter
    def use_hash_partitioner(self, use_hash_partitioner):
        """Sets the use_hash_partitioner of this NotificationSchemaKafkapublish.

        If true, key will be generated which will be hashed to provide a consistent partition number for the given kafka topic  # noqa: E501

        :param use_hash_partitioner: The use_hash_partitioner of this NotificationSchemaKafkapublish.  # noqa: E501
        :type: bool
        """

        self._use_hash_partitioner = use_hash_partitioner

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

        return self.__dict__ == other.__dict__

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