from telethon.tl.mtproto_request import MTProtoRequest


class MessageMediaWebPage(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia"""

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

    def __init__(self, webpage):
        """
        :param webpage: Telegram type: «WebPage».
        """
        super().__init__()

        self.webpage = webpage

    def on_send(self, writer):
        writer.write_int(MessageMediaWebPage.constructor_id, signed=False)
        self.webpage.on_send(writer)

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

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

    def __repr__(self):
        return 'messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia'

    def __str__(self):
        return '(messageMediaWebPage (ID: 0xa32dd600) = (webpage={}))'.format(str(self.webpage))
