melvin_ob/http_handler/http_request/
configure_simulation_put.rs1use super::configure_simulation;
2use super::request_common::{
3 HTTPRequestMethod, HTTPRequestType, NoBodyHTTPRequestType, bool_to_string,
4};
5use std::collections::HashMap;
6
7#[derive(Debug)]
9#[cfg(debug_assertions)]
10pub(crate) struct ConfigureSimulationRequest {
11 pub(crate) is_network_simulation: bool,
13 pub(crate) user_speed_multiplier: u32,
15}
16
17impl NoBodyHTTPRequestType for ConfigureSimulationRequest {}
18
19impl HTTPRequestType for ConfigureSimulationRequest {
20 type Response = configure_simulation::ConfigureSimulationResponse;
22 fn endpoint(&self) -> &'static str { "/simulation" }
24 fn request_method(&self) -> HTTPRequestMethod { HTTPRequestMethod::Put }
26 fn query_params(&self) -> HashMap<&str, String> {
28 let mut query = HashMap::new();
29 query.insert(
30 "is_network_simulation",
31 bool_to_string(self.is_network_simulation).to_string(),
32 );
33 query.insert(
34 "user_speed_multiplier",
35 self.user_speed_multiplier.to_string(),
36 );
37 query
38 }
39}