from ....tl.tlobject import TLObject


class ImportCardRequest(TLObject):
    """Class generated by TLObjects' generator. All changes will be ERASED. TL definition below.
    contacts.importCard#4fe196fe export_card:Vector<int> = User"""

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

    def __init__(self, export_card):
        """
        :param export_card: Telegram type: "int". Must be a list.

        :returns User: Instance of either UserEmpty, User.
        """
        super().__init__()
        self.result = None
        self.content_related = True

        self.export_card = export_card

    def to_dict(self):
        return {
            'export_card': [] if self.export_card is None else self.export_card[:],
        }

    def on_send(self, writer):
        writer.write_int(ImportCardRequest.constructor_id, signed=False)
        writer.write_int(0x1cb5c415, signed=False)  # Vector's constructor ID
        writer.write_int(len(self.export_card))
        for _x in self.export_card:
            writer.write_int(_x)

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

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

    def __repr__(self):
        return 'contacts.importCard#4fe196fe export_card:Vector<int> = User'

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

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