from ....tl.mtproto_request import MTProtoRequest


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

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

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

        Constructor for account.PasswordSettings: Instance of PasswordSettings.
        """
        super().__init__()

        self.email = email

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