from ...tl.mtproto_request import MTProtoRequest


class MessageActionChatEditPhoto(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction"""

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

    def __init__(self, photo):
        """
        :param photo: Telegram type: «Photo».

        Constructor for MessageAction: Instance of either MessageActionEmpty, MessageActionChatCreate, MessageActionChatEditTitle, MessageActionChatEditPhoto, MessageActionChatDeletePhoto, MessageActionChatAddUser, MessageActionChatDeleteUser, MessageActionChatJoinedByLink, MessageActionChannelCreate, MessageActionChatMigrateTo, MessageActionChannelMigrateFrom, MessageActionPinMessage, MessageActionHistoryClear, MessageActionGameScore, MessageActionPaymentSentMe, MessageActionPaymentSent, MessageActionPhoneCall.
        """
        super().__init__()

        self.photo = photo

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

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

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

    def __repr__(self):
        return 'messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction'

    def __str__(self):
        return '(messageActionChatEditPhoto (ID: 0x7fcb13a8) = (photo={}))'.format(str(self.photo))
