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


class CheckUsernameRequest(TLObject):
    constructor_id = 0x10e6bd2c
    subclass_of_id = 0xf5b399ac

    def __init__(self, channel, username):
        """
        :param channel: Telegram type: "InputChannel".
        :param username: Telegram type: "string".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.username = username

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

    def on_send(self, writer):
        writer.write_int(CheckUsernameRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.tgwrite_string(self.username)

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

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

    def __repr__(self):
        return 'channels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool'

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

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



class CreateChannelRequest(TLObject):
    constructor_id = 0xf4893d7f
    subclass_of_id = 0x8af52aac

    def __init__(self, title, about, broadcast=None, megagroup=None):
        """
        :param broadcast: Telegram type: "true".
        :param megagroup: Telegram type: "true".
        :param title: Telegram type: "string".
        :param about: Telegram type: "string".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.broadcast = broadcast
        self.megagroup = megagroup
        self.title = title
        self.about = about

    def to_dict(self):
        return {
            'broadcast': self.broadcast,
            'megagroup': self.megagroup,
            'title': self.title,
            'about': self.about,
        }

    def on_send(self, writer):
        writer.write_int(CreateChannelRequest.constructor_id, signed=False)
        flags = 0
        flags |= (1 << 0) if self.broadcast else 0
        flags |= (1 << 1) if self.megagroup else 0
        writer.write_int(flags)

        writer.tgwrite_string(self.title)
        writer.tgwrite_string(self.about)

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

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

    def __repr__(self):
        return 'channels.createChannel#f4893d7f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string = Updates'

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

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

from ...utils import get_input_channel


class DeleteChannelRequest(TLObject):
    constructor_id = 0xc0111fe3
    subclass_of_id = 0x8af52aac

    def __init__(self, channel):
        """
        :param channel: Telegram type: "InputChannel".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)

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

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

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

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

    def __repr__(self):
        return 'channels.deleteChannel#c0111fe3 channel:InputChannel = Updates'

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

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

from ...utils import get_input_channel


class DeleteMessagesRequest(TLObject):
    constructor_id = 0x84c1fd4e
    subclass_of_id = 0xced3c06e

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

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

        self.channel = get_input_channel(channel)
        self.id = id

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

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

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

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

    def __repr__(self):
        return 'channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages'

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

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

from ...utils import get_input_channel, get_input_user


class DeleteUserHistoryRequest(TLObject):
    constructor_id = 0xd10dd71b
    subclass_of_id = 0x2c49c116

    def __init__(self, channel, user_id):
        """
        :param channel: Telegram type: "InputChannel".
        :param user_id: Telegram type: "InputUser".

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

        self.channel = get_input_channel(channel)
        self.user_id = get_input_user(user_id)

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

    def on_send(self, writer):
        writer.write_int(DeleteUserHistoryRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.user_id.on_send(writer)

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

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

    def __repr__(self):
        return 'channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory'

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

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

from ...utils import get_input_channel


class EditAboutRequest(TLObject):
    constructor_id = 0x13e27f1e
    subclass_of_id = 0xf5b399ac

    def __init__(self, channel, about):
        """
        :param channel: Telegram type: "InputChannel".
        :param about: Telegram type: "string".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.about = about

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

    def on_send(self, writer):
        writer.write_int(EditAboutRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.tgwrite_string(self.about)

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

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

    def __repr__(self):
        return 'channels.editAbout#13e27f1e channel:InputChannel about:string = Bool'

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

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

from ...utils import get_input_channel, get_input_user


class EditAdminRequest(TLObject):
    constructor_id = 0x20b88214
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, user_id, admin_rights):
        """
        :param channel: Telegram type: "InputChannel".
        :param user_id: Telegram type: "InputUser".
        :param admin_rights: Telegram type: "ChannelAdminRights".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.user_id = get_input_user(user_id)
        self.admin_rights = admin_rights

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

    def on_send(self, writer):
        writer.write_int(EditAdminRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.user_id.on_send(writer)
        self.admin_rights.on_send(writer)

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

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

    def __repr__(self):
        return 'channels.editAdmin#20b88214 channel:InputChannel user_id:InputUser admin_rights:ChannelAdminRights = Updates'

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

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

from ...utils import get_input_channel, get_input_user


class EditBannedRequest(TLObject):
    constructor_id = 0xbfd915cd
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, user_id, banned_rights):
        """
        :param channel: Telegram type: "InputChannel".
        :param user_id: Telegram type: "InputUser".
        :param banned_rights: Telegram type: "ChannelBannedRights".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.user_id = get_input_user(user_id)
        self.banned_rights = banned_rights

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

    def on_send(self, writer):
        writer.write_int(EditBannedRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.user_id.on_send(writer)
        self.banned_rights.on_send(writer)

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

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

    def __repr__(self):
        return 'channels.editBanned#bfd915cd channel:InputChannel user_id:InputUser banned_rights:ChannelBannedRights = Updates'

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

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

from ...utils import get_input_channel


class EditPhotoRequest(TLObject):
    constructor_id = 0xf12e57c9
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, photo):
        """
        :param channel: Telegram type: "InputChannel".
        :param photo: Telegram type: "InputChatPhoto".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.photo = photo

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

    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():
        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 TLObject.pretty_format(self)

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

from ...utils import get_input_channel


class EditTitleRequest(TLObject):
    constructor_id = 0x566decd0
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, title):
        """
        :param channel: Telegram type: "InputChannel".
        :param title: Telegram type: "string".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.title = title

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

    def on_send(self, writer):
        writer.write_int(EditTitleRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.tgwrite_string(self.title)

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

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

    def __repr__(self):
        return 'channels.editTitle#566decd0 channel:InputChannel title:string = Updates'

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

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

from ...utils import get_input_channel


class ExportInviteRequest(TLObject):
    constructor_id = 0xc7560885
    subclass_of_id = 0xb4748a58

    def __init__(self, channel):
        """
        :param channel: Telegram type: "InputChannel".

        :returns ExportedChatInvite: Instance of either ChatInviteEmpty, ChatInviteExported.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)

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

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

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

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

    def __repr__(self):
        return 'channels.exportInvite#c7560885 channel:InputChannel = ExportedChatInvite'

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

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

from ...utils import get_input_channel


class ExportMessageLinkRequest(TLObject):
    constructor_id = 0xc846d22d
    subclass_of_id = 0xdee644cc

    def __init__(self, channel, id):
        """
        :param channel: Telegram type: "InputChannel".
        :param id: Telegram type: "int".

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

        self.channel = get_input_channel(channel)
        self.id = id

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

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

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

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

    def __repr__(self):
        return 'channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessageLink'

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

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

from ...utils import get_input_channel, get_input_user


class GetAdminLogRequest(TLObject):
    constructor_id = 0x33ddf480
    subclass_of_id = 0x51f076bc

    def __init__(self, channel, q, max_id, min_id, limit, events_filter=None, admins=None):
        """
        :param channel: Telegram type: "InputChannel".
        :param q: Telegram type: "string".
        :param events_filter: Telegram type: "ChannelAdminLogEventsFilter".
        :param admins: Telegram type: "InputUser". Must be a list.
        :param max_id: Telegram type: "long".
        :param min_id: Telegram type: "long".
        :param limit: Telegram type: "int".

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

        self.channel = get_input_channel(channel)
        self.q = q
        self.events_filter = events_filter
        self.admins = [get_input_user(_x) for _x in admins]
        self.max_id = max_id
        self.min_id = min_id
        self.limit = limit

    def to_dict(self):
        return {
            'channel': None if self.channel is None else self.channel.to_dict(),
            'q': self.q,
            'events_filter': None if self.events_filter is None else self.events_filter.to_dict(),
            'admins': [] if self.admins is None else [None if x is None else x.to_dict() for x in self.admins],
            'max_id': self.max_id,
            'min_id': self.min_id,
            'limit': self.limit,
        }

    def on_send(self, writer):
        writer.write_int(GetAdminLogRequest.constructor_id, signed=False)
        flags = 0
        flags |= (1 << 0) if self.events_filter else 0
        flags |= (1 << 1) if self.admins else 0
        writer.write_int(flags)

        self.channel.on_send(writer)
        writer.tgwrite_string(self.q)
        if self.events_filter:
            self.events_filter.on_send(writer)

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

        writer.write_long(self.max_id)
        writer.write_long(self.min_id)
        writer.write_int(self.limit)

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

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

    def __repr__(self):
        return 'channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults'

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

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



class GetAdminedPublicChannelsRequest(TLObject):
    constructor_id = 0x8d8d82d7
    subclass_of_id = 0x99d5cb14

    def __init__(self):
        super().__init__()
        self.result = None
        self.content_related = True

    @staticmethod
    def to_dict():
        return {}

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

    @staticmethod
    def empty():
        return GetAdminedPublicChannelsRequest()

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

    def __repr__(self):
        return 'channels.getAdminedPublicChannels#8d8d82d7 = messages.Chats'

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

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

from ...utils import get_input_channel


class GetChannelsRequest(TLObject):
    constructor_id = 0xa7f6bbb
    subclass_of_id = 0x99d5cb14

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

        :returns messages.Chats: Instance of either Chats, ChatsSlice.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.id = [get_input_channel(_x) for _x in 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(GetChannelsRequest.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 GetChannelsRequest(None)

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

    def __repr__(self):
        return 'channels.getChannels#0a7f6bbb id:Vector<InputChannel> = messages.Chats'

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

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

from ...utils import get_input_channel


class GetFullChannelRequest(TLObject):
    constructor_id = 0x8736a09
    subclass_of_id = 0x225a5109

    def __init__(self, channel):
        """
        :param channel: Telegram type: "InputChannel".

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

        self.channel = get_input_channel(channel)

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

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

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

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

    def __repr__(self):
        return 'channels.getFullChannel#08736a09 channel:InputChannel = messages.ChatFull'

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

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

from ...utils import get_input_channel


class GetMessagesRequest(TLObject):
    constructor_id = 0x93d7b347
    subclass_of_id = 0xd4b40b5e

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

        :returns messages.Messages: Instance of either Messages, MessagesSlice, ChannelMessages.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.id = id

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

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

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

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

    def __repr__(self):
        return 'channels.getMessages#93d7b347 channel:InputChannel id:Vector<int> = messages.Messages'

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

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

from ...utils import get_input_channel, get_input_user


class GetParticipantRequest(TLObject):
    constructor_id = 0x546dd7a6
    subclass_of_id = 0x6658151a

    def __init__(self, channel, user_id):
        """
        :param channel: Telegram type: "InputChannel".
        :param user_id: Telegram type: "InputUser".

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

        self.channel = get_input_channel(channel)
        self.user_id = get_input_user(user_id)

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

    def on_send(self, writer):
        writer.write_int(GetParticipantRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.user_id.on_send(writer)

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

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

    def __repr__(self):
        return 'channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant'

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

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

from ...utils import get_input_channel


class GetParticipantsRequest(TLObject):
    constructor_id = 0x24d98f92
    subclass_of_id = 0xe60a6e64

    def __init__(self, channel, filter, offset, limit):
        """
        :param channel: Telegram type: "InputChannel".
        :param filter: Telegram type: "ChannelParticipantsFilter".
        :param offset: Telegram type: "int".
        :param limit: Telegram type: "int".

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

        self.channel = get_input_channel(channel)
        self.filter = filter
        self.offset = offset
        self.limit = limit

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

    def on_send(self, writer):
        writer.write_int(GetParticipantsRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.filter.on_send(writer)
        writer.write_int(self.offset)
        writer.write_int(self.limit)

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

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

    def __repr__(self):
        return 'channels.getParticipants#24d98f92 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int = channels.ChannelParticipants'

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

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

from ...utils import get_input_channel, get_input_user


class InviteToChannelRequest(TLObject):
    constructor_id = 0x199f3a6c
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, users):
        """
        :param channel: Telegram type: "InputChannel".
        :param users: Telegram type: "InputUser". Must be a list.

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.users = [get_input_user(_x) for _x in users]

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

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

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

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

    def __repr__(self):
        return 'channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates'

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

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

from ...utils import get_input_channel


class JoinChannelRequest(TLObject):
    constructor_id = 0x24b524c5
    subclass_of_id = 0x8af52aac

    def __init__(self, channel):
        """
        :param channel: Telegram type: "InputChannel".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)

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

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

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

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

    def __repr__(self):
        return 'channels.joinChannel#24b524c5 channel:InputChannel = Updates'

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

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

from ...utils import get_input_channel


class LeaveChannelRequest(TLObject):
    constructor_id = 0xf836aa95
    subclass_of_id = 0x8af52aac

    def __init__(self, channel):
        """
        :param channel: Telegram type: "InputChannel".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)

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

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

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

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

    def __repr__(self):
        return 'channels.leaveChannel#f836aa95 channel:InputChannel = Updates'

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

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

from ...utils import get_input_channel


class ReadHistoryRequest(TLObject):
    constructor_id = 0xcc104937
    subclass_of_id = 0xf5b399ac

    def __init__(self, channel, max_id):
        """
        :param channel: Telegram type: "InputChannel".
        :param max_id: Telegram type: "int".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.max_id = max_id

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

    def on_send(self, writer):
        writer.write_int(ReadHistoryRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.write_int(self.max_id)

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

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

    def __repr__(self):
        return 'channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool'

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

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

from ...utils import get_input_channel


class ReadMessageContentsRequest(TLObject):
    constructor_id = 0xeab5dc38
    subclass_of_id = 0xf5b399ac

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

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.id = id

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

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

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

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

    def __repr__(self):
        return 'channels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool'

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

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

from ...utils import get_input_channel, get_input_user


class ReportSpamRequest(TLObject):
    constructor_id = 0xfe087810
    subclass_of_id = 0xf5b399ac

    def __init__(self, channel, user_id, id):
        """
        :param channel: Telegram type: "InputChannel".
        :param user_id: Telegram type: "InputUser".
        :param id: Telegram type: "int". Must be a list.

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.user_id = get_input_user(user_id)
        self.id = id

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

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

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

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

    def __repr__(self):
        return 'channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector<int> = Bool'

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

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

from ...utils import get_input_channel


class SetStickersRequest(TLObject):
    constructor_id = 0xea8ca4f9
    subclass_of_id = 0xf5b399ac

    def __init__(self, channel, stickerset):
        """
        :param channel: Telegram type: "InputChannel".
        :param stickerset: Telegram type: "InputStickerSet".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.stickerset = stickerset

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

    def on_send(self, writer):
        writer.write_int(SetStickersRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        self.stickerset.on_send(writer)

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

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

    def __repr__(self):
        return 'channels.setStickers#ea8ca4f9 channel:InputChannel stickerset:InputStickerSet = Bool'

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

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

from ...utils import get_input_channel


class ToggleInvitesRequest(TLObject):
    constructor_id = 0x49609307
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, enabled):
        """
        :param channel: Telegram type: "InputChannel".
        :param enabled: Telegram type: "Bool".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.enabled = enabled

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

    def on_send(self, writer):
        writer.write_int(ToggleInvitesRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.tgwrite_bool(self.enabled)

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

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

    def __repr__(self):
        return 'channels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates'

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

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

from ...utils import get_input_channel


class ToggleSignaturesRequest(TLObject):
    constructor_id = 0x1f69b606
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, enabled):
        """
        :param channel: Telegram type: "InputChannel".
        :param enabled: Telegram type: "Bool".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.enabled = enabled

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

    def on_send(self, writer):
        writer.write_int(ToggleSignaturesRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.tgwrite_bool(self.enabled)

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

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

    def __repr__(self):
        return 'channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates'

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

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

from ...utils import get_input_channel


class UpdatePinnedMessageRequest(TLObject):
    constructor_id = 0xa72ded52
    subclass_of_id = 0x8af52aac

    def __init__(self, channel, id, silent=None):
        """
        :param silent: Telegram type: "true".
        :param channel: Telegram type: "InputChannel".
        :param id: Telegram type: "int".

        :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.silent = silent
        self.channel = get_input_channel(channel)
        self.id = id

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

    def on_send(self, writer):
        writer.write_int(UpdatePinnedMessageRequest.constructor_id, signed=False)
        flags = 0
        flags |= (1 << 0) if self.silent else 0
        writer.write_int(flags)

        self.channel.on_send(writer)
        writer.write_int(self.id)

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

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

    def __repr__(self):
        return 'channels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates'

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

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

from ...utils import get_input_channel


class UpdateUsernameRequest(TLObject):
    constructor_id = 0x3514b3de
    subclass_of_id = 0xf5b399ac

    def __init__(self, channel, username):
        """
        :param channel: Telegram type: "InputChannel".
        :param username: Telegram type: "string".

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.channel = get_input_channel(channel)
        self.username = username

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

    def on_send(self, writer):
        writer.write_int(UpdateUsernameRequest.constructor_id, signed=False)
        self.channel.on_send(writer)
        writer.tgwrite_string(self.username)

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

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

    def __repr__(self):
        return 'channels.updateUsername#3514b3de channel:InputChannel username:string = Bool'

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

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

