from ...tl.mtproto_request import MTProtoRequest


class DestroySessionNone(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    destroy_session_none#62d350c9 session_id:long = DestroySessionRes"""

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

    def __init__(self, session_id):
        """
        :param session_id: Telegram type: «long».

        Constructor for DestroySessionRes: Instance of either DestroySessionOk, DestroySessionNone.
        """
        super().__init__()

        self.session_id = session_id

    def on_send(self, writer):
        writer.write_int(DestroySessionNone.constructor_id, signed=False)
        writer.write_long(self.session_id)

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

    def on_response(self, reader):
        self.session_id = reader.read_long()

    def __repr__(self):
        return 'destroy_session_none#62d350c9 session_id:long = DestroySessionRes'

    def __str__(self):
        return '(destroy_session_none (ID: 0x62d350c9) = (session_id={}))'.format(str(self.session_id))
