from ....tl.mtproto_request import MTProtoRequest


class GetGameHighScoresRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores"""

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

    def __init__(self, peer, id, user_id):
        """
        :param peer: Telegram type: «InputPeer».
        :param id: Telegram type: «int».
        :param user_id: Telegram type: «InputUser».

        :returns messages.HighScores: Instance of HighScores.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.peer = peer
        self.id = id
        self.user_id = user_id

    def on_send(self, writer):
        writer.write_int(GetGameHighScoresRequest.constructor_id, signed=False)
        self.peer.on_send(writer)
        writer.write_int(self.id)
        self.user_id.on_send(writer)

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

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

    def __repr__(self):
        return 'messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores'

    def __str__(self):
        return '(messages.getGameHighScores (ID: 0xe822649d) = (peer={}, id={}, user_id={}))'.format(str(self.peer), str(self.id), str(self.user_id))
