#pragma once
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <unordered_map>
#include "action_mapper.hpp"
#include "utils.hpp"
namespace ddwaf {
class action_mapper_builder {
public:
action_mapper_builder() = default;
~action_mapper_builder() = default;
action_mapper_builder(const action_mapper_builder &) = delete;
action_mapper_builder(action_mapper_builder &&) = delete;
action_mapper_builder &operator=(const action_mapper_builder &) = delete;
action_mapper_builder &operator=(action_mapper_builder &&) = delete;
void set_action(const std::string &id, std::string type,
std::unordered_map<std::string, scalar_type> parameters);
[[nodiscard]] static const action_parameters &get_default_action(std::string_view id);
std::shared_ptr<const action_mapper> build_shared();
action_mapper build();
protected:
std::map<std::string, action_parameters, std::less<>> action_by_id_;
static const std::map<std::string, action_parameters, std::less<>> default_actions_;
};
}