from ...tl.mtproto_request import MTProtoRequest


class InputBotInlineResultPhoto(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult"""

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

    def __init__(self, id, type, photo, send_message):
        """
        :param id: Telegram type: «string».
        :param type: Telegram type: «string».
        :param photo: Telegram type: «InputPhoto».
        :param send_message: Telegram type: «InputBotInlineMessage».

        Constructor for InputBotInlineResult: Instance of either InputBotInlineResult, InputBotInlineResultPhoto, InputBotInlineResultDocument, InputBotInlineResultGame.
        """
        super().__init__()

        self.id = id
        self.type = type
        self.photo = photo
        self.send_message = send_message

    def on_send(self, writer):
        writer.write_int(InputBotInlineResultPhoto.constructor_id, signed=False)
        writer.tgwrite_string(self.id)
        writer.tgwrite_string(self.type)
        self.photo.on_send(writer)
        self.send_message.on_send(writer)

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

    def on_response(self, reader):
        self.id = reader.tgread_string()
        self.type = reader.tgread_string()
        self.photo = reader.tgread_object()
        self.send_message = reader.tgread_object()

    def __repr__(self):
        return 'inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult'

    def __str__(self):
        return '(inputBotInlineResultPhoto (ID: 0xa8d864a7) = (id={}, type={}, photo={}, send_message={}))'.format(str(self.id), str(self.type), str(self.photo), str(self.send_message))
