from ....tl.tlobject import TLObject


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

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

    def __init__(self, code):
        """
        :param code: Telegram type: "string".

        :returns auth.Authorization: Instance of Authorization.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.code = code

    def to_dict(self):
        return {
            'code': self.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 (attributes=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 TLObject.pretty_format(self)

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