from telethon.tl.mtproto_request import MTProtoRequest


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

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

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

        self.file_name = 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 (all attributes are 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 '(documentAttributeFilename (ID: 0x15590068) = (file_name={}))'.format(str(self.file_name))
