def get_state(request, user_profile, keys=REQ(validator=check_list(check_string), default=None)): # type: (HttpRequest, UserProfile, Optional[List[str]]) -> HttpResponse keys = keys or get_keys_in_bot_state(user_profile) try: state = {key: get_bot_state(user_profile, key) for key in keys} except StateError as e: return json_error(str(e)) return json_success({'state': state})
def get(self, key: Text) -> Text: return self.demarshal(get_bot_state(self.user_profile, key))
def get(self, key): # type: (Text) -> Text return self.demarshal(get_bot_state(self.user_profile, key))