# coding: utf-8

"""
Copyright 2016 SmartBear Software

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    Ref: https://github.com/swagger-api/swagger-codegen
"""

from pprint import pformat
from six import iteritems


class Topic(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        Topic - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'name': 'str',
            'msg_type': 'str',
            'msg_type_hash': 'str',
            'msg_definition': 'str',
            'msg_count': 'int',
            'avg_frequency': 'float'
        }

        self.attribute_map = {
            'name': 'name',
            'msg_type': 'msg_type',
            'msg_type_hash': 'msg_type_hash',
            'msg_definition': 'msg_definition',
            'msg_count': 'msg_count',
            'avg_frequency': 'avg_frequency'
        }

        self._name = None
        self._msg_type = None
        self._msg_type_hash = None
        self._msg_definition = None
        self._msg_count = None
        self._avg_frequency = None

    @property
    def name(self):
        """
        Gets the name of this Topic.
        Name of the topic

        :return: The name of this Topic.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this Topic.
        Name of the topic

        :param name: The name of this Topic.
        :type: str
        """
        self._name = name

    @property
    def msg_type(self):
        """
        Gets the msg_type of this Topic.
        Message type of the topic

        :return: The msg_type of this Topic.
        :rtype: str
        """
        return self._msg_type

    @msg_type.setter
    def msg_type(self, msg_type):
        """
        Sets the msg_type of this Topic.
        Message type of the topic

        :param msg_type: The msg_type of this Topic.
        :type: str
        """
        self._msg_type = msg_type

    @property
    def msg_type_hash(self):
        """
        Gets the msg_type_hash of this Topic.
        Hash identifier of the message type

        :return: The msg_type_hash of this Topic.
        :rtype: str
        """
        return self._msg_type_hash

    @msg_type_hash.setter
    def msg_type_hash(self, msg_type_hash):
        """
        Sets the msg_type_hash of this Topic.
        Hash identifier of the message type

        :param msg_type_hash: The msg_type_hash of this Topic.
        :type: str
        """
        self._msg_type_hash = msg_type_hash

    @property
    def msg_definition(self):
        """
        Gets the msg_definition of this Topic.
        Definition of custom messages.

        :return: The msg_definition of this Topic.
        :rtype: str
        """
        return self._msg_definition

    @msg_definition.setter
    def msg_definition(self, msg_definition):
        """
        Sets the msg_definition of this Topic.
        Definition of custom messages.

        :param msg_definition: The msg_definition of this Topic.
        :type: str
        """
        self._msg_definition = msg_definition

    @property
    def msg_count(self):
        """
        Gets the msg_count of this Topic.
        Number of messages in this topic.

        :return: The msg_count of this Topic.
        :rtype: int
        """
        return self._msg_count

    @msg_count.setter
    def msg_count(self, msg_count):
        """
        Sets the msg_count of this Topic.
        Number of messages in this topic.

        :param msg_count: The msg_count of this Topic.
        :type: int
        """
        self._msg_count = msg_count

    @property
    def avg_frequency(self):
        """
        Gets the avg_frequency of this Topic.
        Average publishing frequency

        :return: The avg_frequency of this Topic.
        :rtype: float
        """
        return self._avg_frequency

    @avg_frequency.setter
    def avg_frequency(self, avg_frequency):
        """
        Sets the avg_frequency of this Topic.
        Average publishing frequency

        :param avg_frequency: The avg_frequency of this Topic.
        :type: float
        """
        self._avg_frequency = avg_frequency

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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 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
        """
        return self.__dict__ == other.__dict__

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

