def _respond_do_something_successfully(account): process_id = _save_do_something_to_db(account) response = { "status": "processing", "process_id": process_id, } json_response = json.dumps(response) return app.response_class(response=json_response, status=202)
def _respond_get_found(db_do_something): json_response = _prepare_do_something_details_json(db_do_something) return app.response_class(response=json_response, status=200)
def _respond_get_not_found(): response = {"message": "Process Not Found"} json_response = json.dumps(response) return app.response_class(response=json_response, status=404)
def _respond_parameter_not_found(): json_body = json.dumps({"message": "'by_name' parameter not found"}) return app.response_class(response=json_body, status=400)
def _respond_account_not_found(): json_body = json.dumps({"message": "Account Not Found"}) return app.response_class(response=json_body, status=404)
def _respond_not_enough_permissions(): json_body = json.dumps({"message": "Not enough permissions"}) return app.response_class(response=json_body, status=403)
def _get_delay(): result_delay = calculate_current_delay() json_body = json.dumps(result_delay) return app.response_class(response=json_body, status=200)
def _put_delay(): delay_dict = _make_default_delay_dict() _update_default_delay_based_on_request(delay_dict) _save_delay_to_db(delay_dict) return app.response_class(status=204)