from ...tl.mtproto_request import MTProtoRequest


class Pong(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    pong#347773c5 msg_id:long ping_id:long = Pong"""

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

    def __init__(self, msg_id, ping_id):
        """
        :param msg_id: Telegram type: «long».
        :param ping_id: Telegram type: «long».

        Constructor for Pong: Instance of Pong.
        """
        super().__init__()

        self.msg_id = msg_id
        self.ping_id = ping_id

    def on_send(self, writer):
        writer.write_int(Pong.constructor_id, signed=False)
        writer.write_long(self.msg_id)
        writer.write_long(self.ping_id)

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

    def on_response(self, reader):
        self.msg_id = reader.read_long()
        self.ping_id = reader.read_long()

    def __repr__(self):
        return 'pong#347773c5 msg_id:long ping_id:long = Pong'

    def __str__(self):
        return '(pong (ID: 0x347773c5) = (msg_id={}, ping_id={}))'.format(str(self.msg_id), str(self.ping_id))
