from ...tl.mtproto_request import MTProtoRequest


class EncryptedChatWaiting(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    encryptedChatWaiting#3bf703dc id:int access_hash:long date:date admin_id:int participant_id:int = EncryptedChat"""

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

    def __init__(self, id, access_hash, date, admin_id, participant_id):
        """
        :param id: Telegram type: «int».
        :param access_hash: Telegram type: «long».
        :param date: Telegram type: «date».
        :param admin_id: Telegram type: «int».
        :param participant_id: Telegram type: «int».

        Constructor for EncryptedChat: Instance of either EncryptedChatEmpty, EncryptedChatWaiting, EncryptedChatRequested, EncryptedChat, EncryptedChatDiscarded.
        """
        super().__init__()

        self.id = id
        self.access_hash = access_hash
        self.date = date
        self.admin_id = admin_id
        self.participant_id = participant_id

    def on_send(self, writer):
        writer.write_int(EncryptedChatWaiting.constructor_id, signed=False)
        writer.write_int(self.id)
        writer.write_long(self.access_hash)
        writer.tgwrite_date(self.date)
        writer.write_int(self.admin_id)
        writer.write_int(self.participant_id)

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

    def on_response(self, reader):
        self.id = reader.read_int()
        self.access_hash = reader.read_long()
        self.date = reader.tgread_date()
        self.admin_id = reader.read_int()
        self.participant_id = reader.read_int()

    def __repr__(self):
        return 'encryptedChatWaiting#3bf703dc id:int access_hash:long date:date admin_id:int participant_id:int = EncryptedChat'

    def __str__(self):
        return '(encryptedChatWaiting (ID: 0x3bf703dc) = (id={}, access_hash={}, date={}, admin_id={}, participant_id={}))'.format(str(self.id), str(self.access_hash), str(self.date), str(self.admin_id), str(self.participant_id))
