from ...tl.mtproto_request import MTProtoRequest


class FutureSalt(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt"""

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

    def __init__(self, valid_since, valid_until, salt):
        """
        :param valid_since: Telegram type: «int».
        :param valid_until: Telegram type: «int».
        :param salt: Telegram type: «long».

        Constructor for FutureSalt: Instance of FutureSalt.
        """
        super().__init__()

        self.valid_since = valid_since
        self.valid_until = valid_until
        self.salt = salt

    def on_send(self, writer):
        writer.write_int(FutureSalt.constructor_id, signed=False)
        writer.write_int(self.valid_since)
        writer.write_int(self.valid_until)
        writer.write_long(self.salt)

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

    def on_response(self, reader):
        self.valid_since = reader.read_int()
        self.valid_until = reader.read_int()
        self.salt = reader.read_long()

    def __repr__(self):
        return 'future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt'

    def __str__(self):
        return '(future_salt (ID: 0x949d9dc) = (valid_since={}, valid_until={}, salt={}))'.format(str(self.valid_since), str(self.valid_until), str(self.salt))
