from telethon.tl.mtproto_request import MTProtoRequest


class InputMediaContact(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia"""

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

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

        self.phone_number = phone_number
        self.first_name = first_name
        self.last_name = last_name

    def on_send(self, writer):
        writer.write_int(InputMediaContact.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)
        writer.tgwrite_string(self.first_name)
        writer.tgwrite_string(self.last_name)

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

    def on_response(self, reader):
        self.phone_number = reader.tgread_string()
        self.first_name = reader.tgread_string()
        self.last_name = reader.tgread_string()

    def __repr__(self):
        return 'inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia'

    def __str__(self):
        return '(inputMediaContact (ID: 0xa6e45987) = (phone_number={}, first_name={}, last_name={}))'.format(str(self.phone_number), str(self.first_name), str(self.last_name))
