"""File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject


class DeletePhotosRequest(TLObject):
    constructor_id = 0x87cf7f2f
    subclass_of_id = 0x8918e168

    def __init__(self, id):
        """
        :param id: Telegram type: "InputPhoto". Must be a list.

        :returns Vector<long>: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = id

    def to_dict(self):
        return {
            'id': [] if self.id is None else [None if x is None else x.to_dict() for x in self.id],
        }

    def on_send(self, writer):
        writer.write_int(DeletePhotosRequest.constructor_id, signed=False)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.id))
        for _x in self.id:
            _x.on_send(writer)

    @staticmethod
    def empty():
        return DeletePhotosRequest(None)

    def on_response(self, reader):
        reader.read_int()  # Vector id
        count = reader.read_long()
        self.result = [reader.read_long() for _ in range(count)]

    def __repr__(self):
        return 'photos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)

from ...utils import get_input_user


class GetUserPhotosRequest(TLObject):
    constructor_id = 0x91cd32a8
    subclass_of_id = 0x27cfb967

    def __init__(self, user_id, offset, max_id, limit):
        """
        :param user_id: Telegram type: "InputUser".
        :param offset: Telegram type: "int".
        :param max_id: Telegram type: "long".
        :param limit: Telegram type: "int".

        :returns photos.Photos: Instance of either Photos, PhotosSlice.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.user_id = get_input_user(user_id)
        self.offset = offset
        self.max_id = max_id
        self.limit = limit

    def to_dict(self):
        return {
            'user_id': None if self.user_id is None else self.user_id.to_dict(),
            'offset': self.offset,
            'max_id': self.max_id,
            'limit': self.limit,
        }

    def on_send(self, writer):
        writer.write_int(GetUserPhotosRequest.constructor_id, signed=False)
        self.user_id.on_send(writer)
        writer.write_int(self.offset)
        writer.write_long(self.max_id)
        writer.write_int(self.limit)

    @staticmethod
    def empty():
        return GetUserPhotosRequest(None, None, None, None)

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

    def __repr__(self):
        return 'photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos'

    def __str__(self):
        return TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class UpdateProfilePhotoRequest(TLObject):
    constructor_id = 0xf0bb5152
    subclass_of_id = 0xc6338f7d

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

        :returns UserProfilePhoto: Instance of either UserProfilePhotoEmpty, UserProfilePhoto.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = id

    def to_dict(self):
        return {
            'id': None if self.id is None else self.id.to_dict(),
        }

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

    @staticmethod
    def empty():
        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 TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)



class UploadProfilePhotoRequest(TLObject):
    constructor_id = 0x4f32c098
    subclass_of_id = 0xc292bd24

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

        :returns photos.Photo: Instance of Photo.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.file = file

    def to_dict(self):
        return {
            'file': None if self.file is None else self.file.to_dict(),
        }

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

    @staticmethod
    def empty():
        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 TLObject.pretty_format(self)

    def stringify(self):
        return TLObject.pretty_format(self, indent=0)

