from ...tl.mtproto_request import MTProtoRequest


class InputMediaVenue(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia"""

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

    def __init__(self, geo_point, title, address, provider, venue_id):
        """
        :param geo_point: Telegram type: «InputGeoPoint».
        :param title: Telegram type: «string».
        :param address: Telegram type: «string».
        :param provider: Telegram type: «string».
        :param venue_id: Telegram type: «string».

        Constructor for InputMedia: Instance of either InputMediaEmpty, InputMediaUploadedPhoto, InputMediaPhoto, InputMediaGeoPoint, InputMediaContact, InputMediaUploadedDocument, InputMediaUploadedThumbDocument, InputMediaDocument, InputMediaVenue, InputMediaGifExternal, InputMediaPhotoExternal, InputMediaDocumentExternal, InputMediaGame, InputMediaInvoice.
        """
        super().__init__()

        self.geo_point = geo_point
        self.title = title
        self.address = address
        self.provider = provider
        self.venue_id = venue_id

    def on_send(self, writer):
        writer.write_int(InputMediaVenue.constructor_id, signed=False)
        self.geo_point.on_send(writer)
        writer.tgwrite_string(self.title)
        writer.tgwrite_string(self.address)
        writer.tgwrite_string(self.provider)
        writer.tgwrite_string(self.venue_id)

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

    def on_response(self, reader):
        self.geo_point = reader.tgread_object()
        self.title = reader.tgread_string()
        self.address = reader.tgread_string()
        self.provider = reader.tgread_string()
        self.venue_id = reader.tgread_string()

    def __repr__(self):
        return 'inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia'

    def __str__(self):
        return '(inputMediaVenue (ID: 0x2827a81a) = (geo_point={}, title={}, address={}, provider={}, venue_id={}))'.format(str(self.geo_point), str(self.title), str(self.address), str(self.provider), str(self.venue_id))
