from ...tl.tlobject import TLObject


class DocumentAttributeFilename(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    documentAttributeFilename#15590068 file_name:string = DocumentAttribute"""

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

    def __init__(self, file_name):
        """
        :param file_name: Telegram type: "string".

        Constructor for DocumentAttribute: Instance of either DocumentAttributeImageSize, DocumentAttributeAnimated, DocumentAttributeSticker, DocumentAttributeVideo, DocumentAttributeAudio, DocumentAttributeFilename, DocumentAttributeHasStickers.
        """
        super().__init__()

        self.file_name = file_name

    def to_dict(self):
        return {
            'file_name': self.file_name,
        }

    def on_send(self, writer):
        writer.write_int(DocumentAttributeFilename.constructor_id, signed=False)
        writer.tgwrite_string(self.file_name)

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

    def on_response(self, reader):
        self.file_name = reader.tgread_string()

    def __repr__(self):
        return 'documentAttributeFilename#15590068 file_name:string = DocumentAttribute'

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

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