from ...tl.mtproto_request import MTProtoRequest


class InlineBotSwitchPM(MTProtoRequest):
    """Class generated by TLObjects' generator. All changes will be ERASED. Original .tl definition below.
    inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM"""

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

    def __init__(self, text, start_param):
        """
        :param text: Telegram type: «string».
        :param start_param: Telegram type: «string».

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

        self.text = text
        self.start_param = start_param

    def on_send(self, writer):
        writer.write_int(InlineBotSwitchPM.constructor_id, signed=False)
        writer.tgwrite_string(self.text)
        writer.tgwrite_string(self.start_param)

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

    def on_response(self, reader):
        self.text = reader.tgread_string()
        self.start_param = reader.tgread_string()

    def __repr__(self):
        return 'inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM'

    def __str__(self):
        return '(inlineBotSwitchPM (ID: 0x3c20629f) = (text={}, start_param={}))'.format(str(self.text), str(self.start_param))
