Skip to main content

asana/model/
goal_update_request.rs

1use serde::{Serialize, Deserialize};
2use super::GoalRequestBase;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct GoalUpdateRequest {
5    #[serde(flatten)]
6    pub goal_request_base: GoalRequestBase,
7    /**The current status of this goal. When the goal is open, its status can be `green`, `yellow`, and `red` to reflect "On Track", "At Risk", and "Off Track", respectively. When the goal is closed, the value can be `missed`, `achieved`, `partial`, or `dropped`.
8*Note* you can only write to this property if `metric` is set.*/
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub status: Option<String>,
11}
12impl std::fmt::Display for GoalUpdateRequest {
13    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14        write!(f, "{}", serde_json::to_string(self).unwrap())
15    }
16}
17impl std::ops::Deref for GoalUpdateRequest {
18    type Target = GoalRequestBase;
19    fn deref(&self) -> &Self::Target {
20        &self.goal_request_base
21    }
22}
23impl std::ops::DerefMut for GoalUpdateRequest {
24    fn deref_mut(&mut self) -> &mut Self::Target {
25        &mut self.goal_request_base
26    }
27}