use actix_web::HttpResponse;
use serde_json::{Value, json};
use super::conditions::RequestCondition;
pub(super) use athena_gateway::build_fetch_hashed_cache_key_legacy8;
pub use athena_gateway::{build_fetch_hashed_cache_key, parse_sort_options_from_body};
pub fn parse_gateway_fetch_conditions(
json_body: &Value,
force_camel_case_to_snake_case: bool,
) -> Result<Vec<RequestCondition>, HttpResponse> {
athena_gateway::parse_gateway_fetch_conditions(json_body, force_camel_case_to_snake_case)
.map_err(|err| HttpResponse::BadRequest().json(json!({ "error": err.message() })))
}