from ....tl.mtproto_request import MTProtoRequest


class ReportPeerRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    account.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool"""

    # Telegram's constructor ID (and unique identifier) for this class
    constructor_id = 0xae189d5f

    def __init__(self, peer, reason):
        """
        :param peer: Telegram type: «InputPeer».
        :param reason: Telegram type: «ReportReason».

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.peer = peer
        self.reason = reason

    def on_send(self, writer):
        writer.write_int(ReportPeerRequest.constructor_id, signed=False)
        self.peer.on_send(writer)
        self.reason.on_send(writer)

    @staticmethod
    def empty():
        """Returns an "empty" instance (all attributes are None)"""
        return ReportPeerRequest(None, None)

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

    def __repr__(self):
        return 'account.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool'

    def __str__(self):
        return '(account.reportPeer (ID: 0xae189d5f) = (peer={}, reason={}))'.format(str(self.peer), str(self.reason))
