from . import TelegramEndpoint


class SerializableToInlineQueryResult(object):
    pass


class AnswerInlineQuery(TelegramEndpoint):
    def __init__(self, inline_query_id, results):
        super().__init__()
        self.args = {
            'inline_query_id': inline_query_id,
            'results': [x.to_inline_query_result() for x in results]
        }

    def cache_time(self, cache_time):
        self.args = {
            **self.args,
            'cache_time': cache_time
        }
        return self

    def is_personal(self, is_personal):
        self.args = {
            **self.args,
            'is_personal': is_personal
        }
        return self

    def next_offset(self, next_offset):
        self.args = {
            **self.args,
            'is_personal': next_offset
        }
        return self

    def switch_pm_text(self, switch_pm_text):
        self.args = {
            **self.args,
            'switch_pm_text': switch_pm_text
        }
        return self

    def switch_pm_parameter(self, switch_pm_parameter):
        self.args = {
            **self.args,
            'switch_pm_parameter': switch_pm_parameter
        }
        return self
