# 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 NotificationSchemaAmqppublish(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 = {
        'exchange': 'str',
        'host': 'str',
        'port': 'int',
        'routing_key': 'str',
        'sasl': 'NotificationSchemaAmqppublishSasl',
        'vhost': 'str'
    }

    attribute_map = {
        'exchange': 'exchange',
        'host': 'host',
        'port': 'port',
        'routing_key': 'routing-key',
        'sasl': 'sasl',
        'vhost': 'vhost'
    }

    def __init__(self, exchange=None, host=None, port=None, routing_key=None, sasl=None, vhost=None):  # noqa: E501
        """NotificationSchemaAmqppublish - a model defined in Swagger"""  # noqa: E501

        self._exchange = None
        self._host = None
        self._port = None
        self._routing_key = None
        self._sasl = None
        self._vhost = None
        self.discriminator = None

        self.exchange = exchange
        self.host = host
        self.port = port
        if routing_key is not None:
            self.routing_key = routing_key
        if sasl is not None:
            self.sasl = sasl
        if vhost is not None:
            self.vhost = vhost

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

        Name of exchange/routing agent of amqp on which connection has to be instantiated  # noqa: E501

        :return: The exchange of this NotificationSchemaAmqppublish.  # noqa: E501
        :rtype: str
        """
        return self._exchange

    @exchange.setter
    def exchange(self, exchange):
        """Sets the exchange of this NotificationSchemaAmqppublish.

        Name of exchange/routing agent of amqp on which connection has to be instantiated  # noqa: E501

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

        self._exchange = exchange

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

        Host is amqp server/broker valid hostname or IP address  # noqa: E501

        :return: The host of this NotificationSchemaAmqppublish.  # noqa: E501
        :rtype: str
        """
        return self._host

    @host.setter
    def host(self, host):
        """Sets the host of this NotificationSchemaAmqppublish.

        Host is amqp server/broker valid hostname or IP address  # noqa: E501

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

        self._host = host

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

        Port is amqp server/broker listner port  # noqa: E501

        :return: The port of this NotificationSchemaAmqppublish.  # noqa: E501
        :rtype: int
        """
        return self._port

    @port.setter
    def port(self, port):
        """Sets the port of this NotificationSchemaAmqppublish.

        Port is amqp server/broker listner port  # noqa: E501

        :param port: The port of this NotificationSchemaAmqppublish.  # noqa: E501
        :type: int
        """
        if port is None:
            raise ValueError("Invalid value for `port`, must not be `None`")  # noqa: E501
        if port is not None and port > 65535:  # noqa: E501
            raise ValueError("Invalid value for `port`, must be a value less than or equal to `65535`")  # noqa: E501
        if port is not None and port < 1:  # noqa: E501
            raise ValueError("Invalid value for `port`, must be a value greater than or equal to `1`")  # noqa: E501

        self._port = port

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

        Routing key is a message attribute the exchange looks at when deciding how to route the message to queues. 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 routing_key of this NotificationSchemaAmqppublish.  # noqa: E501
        :rtype: str
        """
        return self._routing_key

    @routing_key.setter
    def routing_key(self, routing_key):
        """Sets the routing_key of this NotificationSchemaAmqppublish.

        Routing key is a message attribute the exchange looks at when deciding how to route the message to queues. 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 routing_key: The routing_key of this NotificationSchemaAmqppublish.  # noqa: E501
        :type: str
        """
        if routing_key is not None and len(routing_key) > 255:
            raise ValueError("Invalid value for `routing_key`, length must be less than or equal to `255`")  # noqa: E501
        if routing_key is not None and len(routing_key) < 1:
            raise ValueError("Invalid value for `routing_key`, length must be greater than or equal to `1`")  # noqa: E501
        if routing_key is not None and not re.search(r'^\\.*[a-zA-Z0-9_-]+[a-zA-Z0-9\\._-]*$', routing_key):  # noqa: E501
            raise ValueError(r"Invalid value for `routing_key`, must be a follow pattern or equal to `/^\\.*[a-zA-Z0-9_-]+[a-zA-Z0-9\\._-]*$/`")  # noqa: E501

        self._routing_key = routing_key

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


        :return: The sasl of this NotificationSchemaAmqppublish.  # noqa: E501
        :rtype: NotificationSchemaAmqppublishSasl
        """
        return self._sasl

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


        :param sasl: The sasl of this NotificationSchemaAmqppublish.  # noqa: E501
        :type: NotificationSchemaAmqppublishSasl
        """

        self._sasl = sasl

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

        Virtual host of amqp on which connection has to be instantiated  # noqa: E501

        :return: The vhost of this NotificationSchemaAmqppublish.  # noqa: E501
        :rtype: str
        """
        return self._vhost

    @vhost.setter
    def vhost(self, vhost):
        """Sets the vhost of this NotificationSchemaAmqppublish.

        Virtual host of amqp on which connection has to be instantiated  # noqa: E501

        :param vhost: The vhost of this NotificationSchemaAmqppublish.  # noqa: E501
        :type: str
        """

        self._vhost = vhost

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

        return self.__dict__ == other.__dict__

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