from telethon.tl.mtproto_request import MTProtoRequest


class GetPrivacyRequest(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules"""

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

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

        self.key = key

    def on_send(self, writer):
        writer.write_int(GetPrivacyRequest.constructor_id, signed=False)
        self.key.on_send(writer)

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

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

    def __repr__(self):
        return 'account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules'

    def __str__(self):
        return '(account.getPrivacy (ID: 0xdadbc950) = (key={}))'.format(str(self.key))
