from ....tl.mtproto_request import MTProtoRequest


class UploadProfilePhotoRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    photos.uploadProfilePhoto#4f32c098 file:InputFile = photos.Photo"""

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

    def __init__(self, file):
        """
        :param file: Telegram type: «InputFile».

        :returns photos.Photo: Instance of Photo.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.file = file

    def on_send(self, writer):
        writer.write_int(UploadProfilePhotoRequest.constructor_id, signed=False)
        self.file.on_send(writer)

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

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

    def __repr__(self):
        return 'photos.uploadProfilePhoto#4f32c098 file:InputFile = photos.Photo'

    def __str__(self):
        return '(photos.uploadProfilePhoto (ID: 0x4f32c098) = (file={}))'.format(str(self.file))
