from ...tl.tlobject import TLObject


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

    # Telegram's constructor (U)ID for this class
    constructor_id = 0x949d9dc
    # Also the ID of its resulting type for fast checks
    subclass_of_id = 0x45e53dcf

    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 to_dict(self):
        return {
            'valid_since': self.valid_since,
            'valid_until': self.valid_until,
            'salt': self.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 (attributes=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 TLObject.pretty_format(self)

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