from telethon.tl.mtproto_request import MTProtoRequest


class RecoverPasswordRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    auth.recoverPassword#4ea56e92 code:string = auth.Authorization"""

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

    def __init__(self, code):
        """
        :param code: Telegram type: «string».
        """
        super().__init__()
        self.result = None
        self.confirmed = True  # Confirmed by default

        self.code = code

    def on_send(self, writer):
        writer.write_int(RecoverPasswordRequest.constructor_id, signed=False)
        writer.tgwrite_string(self.code)

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

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

    def __repr__(self):
        return 'auth.recoverPassword#4ea56e92 code:string = auth.Authorization'

    def __str__(self):
        return '(auth.recoverPassword (ID: 0x4ea56e92) = (code={}))'.format(str(self.code))
