from ...tl.mtproto_request import MTProtoRequest


class PageBlockCover(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    pageBlockCover#39f23300 cover:PageBlock = PageBlock"""

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

    def __init__(self, cover):
        """
        :param cover: Telegram type: «PageBlock».

        Constructor for PageBlock: Instance of either PageBlockUnsupported, PageBlockTitle, PageBlockSubtitle, PageBlockAuthorDate, PageBlockHeader, PageBlockSubheader, PageBlockParagraph, PageBlockPreformatted, PageBlockFooter, PageBlockDivider, PageBlockAnchor, PageBlockList, PageBlockBlockquote, PageBlockPullquote, PageBlockPhoto, PageBlockVideo, PageBlockCover, PageBlockEmbed, PageBlockEmbedPost, PageBlockCollage, PageBlockSlideshow, PageBlockChannel.
        """
        super().__init__()

        self.cover = cover

    def on_send(self, writer):
        writer.write_int(PageBlockCover.constructor_id, signed=False)
        self.cover.on_send(writer)

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

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

    def __repr__(self):
        return 'pageBlockCover#39f23300 cover:PageBlock = PageBlock'

    def __str__(self):
        return '(pageBlockCover (ID: 0x39f23300) = (cover={}))'.format(str(self.cover))
