from telethon.tl.mtproto_request import MTProtoRequest


class PasswordSettings(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings"""

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

    def __init__(self, email):
        """
        :param email: Telegram type: «string».
        """
        super().__init__()

        self.email = email

    def on_send(self, writer):
        writer.write_int(PasswordSettings.constructor_id, signed=False)
        writer.tgwrite_string(self.email)

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

    def on_response(self, reader):
        self.email = reader.tgread_string()

    def __repr__(self):
        return 'account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings'

    def __str__(self):
        return '(account.passwordSettings (ID: 0xb7b72ab3) = (email={}))'.format(str(self.email))
