from ....tl.mtproto_request import MTProtoRequest


class UpdateDeviceLockedRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    account.updateDeviceLocked#38df3532 period:int = Bool"""

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

    def __init__(self, period):
        """
        :param period: Telegram type: «int».

        :returns Bool: This type has no constructors.
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.period = period

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

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

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

    def __repr__(self):
        return 'account.updateDeviceLocked#38df3532 period:int = Bool'

    def __str__(self):
        return '(account.updateDeviceLocked (ID: 0x38df3532) = (period={}))'.format(str(self.period))
