melvin_ob/http_handler/http_response/
objective_list.rs

1use crate::http_handler::{
2    common::{BeaconObjective, ImageObjective},
3    http_response::response_common::SerdeJSONBodyHTTPResponseType,
4};
5
6/// Response type for the /objective endpoint -> GET
7#[derive(serde::Deserialize, Debug)]
8pub(crate) struct ObjectiveListResponse {
9    /// `Vec` of zoned objectives, or here `ImageObjectives`
10    #[serde(rename = "zoned_objectives")]
11    img_objectives: Vec<ImageObjective>,
12    /// `Vec` of `BeaconObjectives`
13    beacon_objectives: Vec<BeaconObjective>,
14}
15
16impl SerdeJSONBodyHTTPResponseType for ObjectiveListResponse {}
17
18impl ObjectiveListResponse {
19    /// Returns the list of imaging objectives
20    pub(crate) fn img_objectives(&self) -> &Vec<ImageObjective> { &self.img_objectives }
21    /// Returns the list of beacon objectives
22    pub(crate) fn beacon_objectives(&self) -> &Vec<BeaconObjective> { &self.beacon_objectives }
23}