from telethon.tl.mtproto_request import MTProtoRequest


class EditPhotoRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates"""

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

    def __init__(self, channel, photo):
        """
        :param channel: Telegram type: «InputChannel».
        :param photo: Telegram type: «InputChatPhoto».
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.channel = channel
        self.photo = photo

    def on_send(self, writer):
        writer.write_int(EditPhotoRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.photo.on_send(writer)

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

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

    def __repr__(self):
        return 'channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates'

    def __str__(self):
        return '(channels.editPhoto (ID: 0xf12e57c9) = (channel={}, photo={}))'.format(str(self.channel), str(self.photo))
