#include <string_view>
#include "action_mapper.hpp"
namespace ddwaf {
action_type action_type_from_string(std::string_view type)
{
if (type == "block_request") {
return action_type::block_request;
}
if (type == "redirect_request") {
return action_type::redirect_request;
}
if (type == "generate_stack") {
return action_type::generate_stack;
}
if (type == "generate_schema") {
return action_type::generate_schema;
}
if (type == "monitor") {
return action_type::monitor;
}
return action_type::unknown;
}
}