from ....tl.tlobject import TLObject
from ....utils import get_input_peer


class ResetTopPeerRatingRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool"""

    # Telegram's constructor (U)ID for this class
    constructor_id = 0x1ae373ac
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0xf5b399ac

    def __init__(self, category, peer):
        """
        :param category: Telegram type: "TopPeerCategory".
        :param peer: Telegram type: "InputPeer".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.category = category
        self.peer = get_input_peer(peer)

    def to_dict(self):
        return {
            'category': None if self.category is None else self.category.to_dict(),
            'peer': None if self.peer is None else self.peer.to_dict(),
        }

    def on_send(self, writer):
        writer.write_int(ResetTopPeerRatingRequest.constructor_id, signed=False)
        self.category.on_send(writer)
        self.peer.on_send(writer)

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return ResetTopPeerRatingRequest(None, None)

    def on_response(self, reader):
        self.result = reader.tgread_object()

    def __repr__(self):
        return 'contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)
