def create_search(self, query_expression): respObj = Response() if (self.get_token()): self.query = query_expression response = self.build_searchId() if (response != None): respObj.code = "200" respObj.error_type = "" respObj.status_code = 200 content = '{"search_id": "' + \ str(response) + \ '", "data": {"message": "Search id generated."}}' respObj._content = bytes(content, 'utf-8') else: respObj.code = "404" respObj.error_type = "Not found" respObj.status_code = 404 respObj.message = "Could not generate search id." else: respObj.error_type = "Unauthorized: Access token could not be generated." respObj.message = "Unauthorized: Access token could not be generated." return ResponseWrapper(respObj)