from ....tl.mtproto_request import MTProtoRequest


class Support(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    help.support#17c6b5f6 phone_number:string user:User = help.Support"""

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

    def __init__(self, phone_number, user):
        """
        :param phone_number: Telegram type: «string».
        :param user: Telegram type: «User».

        Constructor for help.Support: Instance of Support.
        """
        super().__init__()

        self.phone_number = phone_number
        self.user = user

    def on_send(self, writer):
        writer.write_int(Support.constructor_id, signed=False)
        writer.tgwrite_string(self.phone_number)
        self.user.on_send(writer)

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

    def on_response(self, reader):
        self.phone_number = reader.tgread_string()
        self.user = reader.tgread_object()

    def __repr__(self):
        return 'help.support#17c6b5f6 phone_number:string user:User = help.Support'

    def __str__(self):
        return '(help.support (ID: 0x17c6b5f6) = (phone_number={}, user={}))'.format(str(self.phone_number), str(self.user))
