def delete_prediction(self, prediction): """Deletes a prediction. """ check_resource_type(prediction, PREDICTION_PATH, message="A prediction id is needed.") prediction_id = get_prediction_id(prediction) if prediction_id: return self._delete("%s%s" % (self.url, prediction_id))
def get_prediction(self, prediction): """Retrieves a prediction. """ check_resource_type(prediction, PREDICTION_PATH, message="A prediction id is needed.") prediction_id = get_prediction_id(prediction) if prediction_id: return self._get("%s%s" % (self.url, prediction_id))
def update_prediction(self, prediction, changes): """Updates a prediction. """ check_resource_type(prediction, PREDICTION_PATH, message="A prediction id is needed.") prediction_id = get_prediction_id(prediction) if prediction_id: body = json.dumps(changes) return self._update("%s%s" % (self.url, prediction_id), body)
def get_prediction(self, prediction, query_string=''): """Retrieves a prediction. """ check_resource_type(prediction, PREDICTION_PATH, message="A prediction id is needed.") prediction_id = get_prediction_id(prediction) if prediction_id: return self._get("%s%s" % (self.url, prediction_id), query_string=query_string)