from telethon.tl.mtproto_request import MTProtoRequest


class GetWebPagePreviewRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messages.getWebPagePreview#25223e24 message:string = MessageMedia"""

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

    def __init__(self, message):
        """
        :param message: Telegram type: «string».
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.message = message

    def on_send(self, writer):
        writer.write_int(GetWebPagePreviewRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.message)

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

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

    def __repr__(self):
        return 'messages.getWebPagePreview#25223e24 message:string = MessageMedia'

    def __str__(self):
        return '(messages.getWebPagePreview (ID: 0x25223e24) = (message={}))'.format(str(self.message))
