from ...tl.tlobject import TLObject


class PopularContact(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    popularContact#5ce14175 client_id:long importers:int = PopularContact"""

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

    def __init__(self, client_id, importers):
        """
        :param client_id: Telegram type: "long".
        :param importers: Telegram type: "int".

        Constructor for PopularContact: Instance of PopularContact.
        """
        super().__init__()

        self.client_id = client_id
        self.importers = importers

    def to_dict(self):
        return {
            'client_id': self.client_id,
            'importers': self.importers,
        }

    def on_send(self, writer):
        writer.write_int(PopularContact.constructor_id, signed=False)
        writer.write_long(self.client_id)
        writer.write_int(self.importers)

    @staticmethod
    def empty():
        """Returns an "empty" instance (attributes=None)"""
        return PopularContact(None, None)

    def on_response(self, reader):
        self.client_id = reader.read_long()
        self.importers = reader.read_int()

    def __repr__(self):
        return 'popularContact#5ce14175 client_id:long importers:int = PopularContact'

    def __str__(self):
        return TLObject.pretty_format(self)

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