from ....tl.mtproto_request import MTProtoRequest


class ResetAuthorizationRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    account.resetAuthorization#df77f3bc hash:long = Bool"""

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

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

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

        self.hash = hash

    def on_send(self, writer):
        writer.write_int(ResetAuthorizationRequest.constructor_id, signed=False)
        writer.write_long(self.hash)

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

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

    def __repr__(self):
        return 'account.resetAuthorization#df77f3bc hash:long = Bool'

    def __str__(self):
        return '(account.resetAuthorization (ID: 0xdf77f3bc) = (hash={}))'.format(str(self.hash))
