from telethon.tl.mtproto_request import MTProtoRequest


class DocumentAttributeVideo(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute"""

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

    def __init__(self, duration, w, h):
        """
        :param duration: Telegram type: «int».
        :param w: Telegram type: «int».
        :param h: Telegram type: «int».
        """
        super().__init__()

        self.duration = duration
        self.w = w
        self.h = h

    def on_send(self, writer):
        writer.write_int(DocumentAttributeVideo.constructor_id, signed=False)
        writer.write_int(self.duration)
        writer.write_int(self.w)
        writer.write_int(self.h)

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

    def on_response(self, reader):
        self.duration = reader.read_int()
        self.w = reader.read_int()
        self.h = reader.read_int()

    def __repr__(self):
        return 'documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute'

    def __str__(self):
        return '(documentAttributeVideo (ID: 0x5910cccb) = (duration={}, w={}, h={}))'.format(str(self.duration), str(self.w), str(self.h))
