from telethon.tl.mtproto_request import MTProtoRequest


class InputMediaGifExternal(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputMediaGifExternal#4843b0fd url:string q:string = InputMedia"""

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

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

        self.url = url
        self.q = q

    def on_send(self, writer):
        writer.write_int(InputMediaGifExternal.constructor_id, signed=False)
        writer.tgwrite_string(self.url)
        writer.tgwrite_string(self.q)

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

    def on_response(self, reader):
        self.url = reader.tgread_string()
        self.q = reader.tgread_string()

    def __repr__(self):
        return 'inputMediaGifExternal#4843b0fd url:string q:string = InputMedia'

    def __str__(self):
        return '(inputMediaGifExternal (ID: 0x4843b0fd) = (url={}, q={}))'.format(str(self.url), str(self.q))
