from ...tl.mtproto_request import MTProtoRequest


class MessageMediaGeo(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia"""

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

    def __init__(self, geo):
        """
        :param geo: Telegram type: «GeoPoint».

        Constructor for MessageMedia: Instance of either MessageMediaEmpty, MessageMediaPhoto, MessageMediaGeo, MessageMediaContact, MessageMediaUnsupported, MessageMediaDocument, MessageMediaWebPage, MessageMediaVenue, MessageMediaGame, MessageMediaInvoice.
        """
        super().__init__()

        self.geo = geo

    def on_send(self, writer):
        writer.write_int(MessageMediaGeo.constructor_id, signed=False)
        self.geo.on_send(writer)

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

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

    def __repr__(self):
        return 'messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia'

    def __str__(self):
        return '(messageMediaGeo (ID: 0x56e0d474) = (geo={}))'.format(str(self.geo))
