Skip to main content

asana/model/
goal_compact.rs

1use serde::{Serialize, Deserialize};
2use super::AsanaResource;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct GoalCompact {
5    ///A generic Asana Resource, containing a globally unique identifier.
6    #[serde(flatten)]
7    pub asana_resource: AsanaResource,
8    ///The name of the goal.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub name: Option<String>,
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub owner: Option<serde_json::Value>,
13}
14impl std::fmt::Display for GoalCompact {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16        write!(f, "{}", serde_json::to_string(self).unwrap())
17    }
18}
19impl std::ops::Deref for GoalCompact {
20    type Target = AsanaResource;
21    fn deref(&self) -> &Self::Target {
22        &self.asana_resource
23    }
24}
25impl std::ops::DerefMut for GoalCompact {
26    fn deref_mut(&mut self) -> &mut Self::Target {
27        &mut self.asana_resource
28    }
29}