from ...tl.tlobject import TLObject


class TextBold(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    textBold#6724abc4 text:RichText = RichText"""

    # Telegram's constructor (U)ID for this class
    constructor_id = 0x6724abc4
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0xf1d0b479

    def __init__(self, text):
        """
        :param text: Telegram type: "RichText".

        Constructor for RichText: Instance of either TextEmpty, TextPlain, TextBold, TextItalic, TextUnderline, TextStrike, TextFixed, TextUrl, TextEmail, TextConcat.
        """
        super().__init__()

        self.text = text

    def to_dict(self):
        return {
            'text': None if self.text is None else self.text.to_dict(),
        }

    def on_send(self, writer):
        writer.write_int(TextBold.constructor_id, signed=False)
        self.text.on_send(writer)

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return TextBold(None)

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

    def __repr__(self):
        return 'textBold#6724abc4 text:RichText = RichText'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)
