from ....tl.mtproto_request import MTProtoRequest


class UpdateProfilePhotoRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    photos.updateProfilePhoto#f0bb5152 id:InputPhoto = UserProfilePhoto"""

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

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

        :returns UserProfilePhoto: Instance of either UserProfilePhotoEmpty, UserProfilePhoto.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.id = id

    def on_send(self, writer):
        writer.write_int(UpdateProfilePhotoRequest.constructor_id, signed=False)
        self.id.on_send(writer)

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

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

    def __repr__(self):
        return 'photos.updateProfilePhoto#f0bb5152 id:InputPhoto = UserProfilePhoto'

    def __str__(self):
        return '(photos.updateProfilePhoto (ID: 0xf0bb5152) = (id={}))'.format(str(self.id))
