melvin_ob/http_handler/http_request/
delete_objective_delete.rs

1use super::delete_objective;
2use super::request_common::{HTTPRequestMethod, HTTPRequestType, NoBodyHTTPRequestType};
3use std::collections::HashMap;
4
5/// Request type for the /objective endpoint -> DELETE.
6#[derive(Debug)]
7#[cfg(debug_assertions)]
8pub(crate) struct DeleteObjectiveRequest {
9    /// The id of the objective to be deleted.
10    id: usize,
11}
12
13impl NoBodyHTTPRequestType for DeleteObjectiveRequest {}
14
15impl HTTPRequestType for DeleteObjectiveRequest {
16    /// Type of the expected response.
17    type Response = delete_objective::DeleteObjectiveResponse;
18    /// `str` object representing the specific endpoint.
19    fn endpoint(&self) -> &'static str { "/objective" }
20    /// The corresponding HTTP Request Method.
21    fn request_method(&self) -> HTTPRequestMethod { HTTPRequestMethod::Delete }
22    /// A `HashMap` containing the queary param key value pairs.
23    fn query_params(&self) -> HashMap<&str, String> {
24        let mut query = HashMap::new();
25        query.insert("id", self.id.to_string());
26        query
27    }
28}