# coding: utf-8

"""
    Zarban API

    API for Zarban services.  # noqa: E501

    The version of the OpenAPI document: 2.0.0
    Contact: info@zarban.io
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from zarban.service.openapi_client.configuration import Configuration


class Log(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'name': 'str',
        'contract': 'str',
        'timestamp': 'Timestamp',
        'address': 'str',
        'block_number': 'int',
        'tx_hash': 'str',
        'block_hash': 'str',
        'index': 'int',
        'topics': 'list[str]',
        'data': 'str',
        'decoded': 'dict(str, str)'
    }

    attribute_map = {
        'name': 'name',
        'contract': 'contract',
        'timestamp': 'timestamp',
        'address': 'address',
        'block_number': 'blockNumber',
        'tx_hash': 'txHash',
        'block_hash': 'blockHash',
        'index': 'index',
        'topics': 'topics',
        'data': 'data',
        'decoded': 'decoded'
    }

    def __init__(self, name=None, contract=None, timestamp=None, address=None, block_number=None, tx_hash=None, block_hash=None, index=None, topics=None, data=None, decoded=None, local_vars_configuration=None):  # noqa: E501
        """Log - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._name = None
        self._contract = None
        self._timestamp = None
        self._address = None
        self._block_number = None
        self._tx_hash = None
        self._block_hash = None
        self._index = None
        self._topics = None
        self._data = None
        self._decoded = None
        self.discriminator = None

        self.name = name
        self.contract = contract
        self.timestamp = timestamp
        self.address = address
        self.block_number = block_number
        self.tx_hash = tx_hash
        self.block_hash = block_hash
        self.index = index
        self.topics = topics
        self.data = data
        if decoded is not None:
            self.decoded = decoded

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

        The name of the log  # noqa: E501

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

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

        The name of the log  # noqa: E501

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

        self._name = name

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

        The contract address  # noqa: E501

        :return: The contract of this Log.  # noqa: E501
        :rtype: str
        """
        return self._contract

    @contract.setter
    def contract(self, contract):
        """Sets the contract of this Log.

        The contract address  # noqa: E501

        :param contract: The contract of this Log.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and contract is None:  # noqa: E501
            raise ValueError("Invalid value for `contract`, must not be `None`")  # noqa: E501

        self._contract = contract

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


        :return: The timestamp of this Log.  # noqa: E501
        :rtype: Timestamp
        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, timestamp):
        """Sets the timestamp of this Log.


        :param timestamp: The timestamp of this Log.  # noqa: E501
        :type: Timestamp
        """
        if self.local_vars_configuration.client_side_validation and timestamp is None:  # noqa: E501
            raise ValueError("Invalid value for `timestamp`, must not be `None`")  # noqa: E501

        self._timestamp = timestamp

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

        The Ethereum address  # noqa: E501

        :return: The address of this Log.  # noqa: E501
        :rtype: str
        """
        return self._address

    @address.setter
    def address(self, address):
        """Sets the address of this Log.

        The Ethereum address  # noqa: E501

        :param address: The address of this Log.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and address is None:  # noqa: E501
            raise ValueError("Invalid value for `address`, must not be `None`")  # noqa: E501

        self._address = address

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

        The block number  # noqa: E501

        :return: The block_number of this Log.  # noqa: E501
        :rtype: int
        """
        return self._block_number

    @block_number.setter
    def block_number(self, block_number):
        """Sets the block_number of this Log.

        The block number  # noqa: E501

        :param block_number: The block_number of this Log.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and block_number is None:  # noqa: E501
            raise ValueError("Invalid value for `block_number`, must not be `None`")  # noqa: E501

        self._block_number = block_number

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

        The transaction hash  # noqa: E501

        :return: The tx_hash of this Log.  # noqa: E501
        :rtype: str
        """
        return self._tx_hash

    @tx_hash.setter
    def tx_hash(self, tx_hash):
        """Sets the tx_hash of this Log.

        The transaction hash  # noqa: E501

        :param tx_hash: The tx_hash of this Log.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and tx_hash is None:  # noqa: E501
            raise ValueError("Invalid value for `tx_hash`, must not be `None`")  # noqa: E501

        self._tx_hash = tx_hash

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

        The block hash  # noqa: E501

        :return: The block_hash of this Log.  # noqa: E501
        :rtype: str
        """
        return self._block_hash

    @block_hash.setter
    def block_hash(self, block_hash):
        """Sets the block_hash of this Log.

        The block hash  # noqa: E501

        :param block_hash: The block_hash of this Log.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and block_hash is None:  # noqa: E501
            raise ValueError("Invalid value for `block_hash`, must not be `None`")  # noqa: E501

        self._block_hash = block_hash

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

        The index  # noqa: E501

        :return: The index of this Log.  # noqa: E501
        :rtype: int
        """
        return self._index

    @index.setter
    def index(self, index):
        """Sets the index of this Log.

        The index  # noqa: E501

        :param index: The index of this Log.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and index is None:  # noqa: E501
            raise ValueError("Invalid value for `index`, must not be `None`")  # noqa: E501

        self._index = index

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


        :return: The topics of this Log.  # noqa: E501
        :rtype: list[str]
        """
        return self._topics

    @topics.setter
    def topics(self, topics):
        """Sets the topics of this Log.


        :param topics: The topics of this Log.  # noqa: E501
        :type: list[str]
        """
        if self.local_vars_configuration.client_side_validation and topics is None:  # noqa: E501
            raise ValueError("Invalid value for `topics`, must not be `None`")  # noqa: E501

        self._topics = topics

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

        The data of the log  # noqa: E501

        :return: The data of this Log.  # noqa: E501
        :rtype: str
        """
        return self._data

    @data.setter
    def data(self, data):
        """Sets the data of this Log.

        The data of the log  # noqa: E501

        :param data: The data of this Log.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and data is None:  # noqa: E501
            raise ValueError("Invalid value for `data`, must not be `None`")  # noqa: E501

        self._data = data

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

        The decoded log, if available  # noqa: E501

        :return: The decoded of this Log.  # noqa: E501
        :rtype: dict(str, str)
        """
        return self._decoded

    @decoded.setter
    def decoded(self, decoded):
        """Sets the decoded of this Log.

        The decoded log, if available  # noqa: E501

        :param decoded: The decoded of this Log.  # noqa: E501
        :type: dict(str, str)
        """

        self._decoded = decoded

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

        for attr, _ in six.iteritems(self.openapi_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 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, Log):
            return False

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
