Skip to main content

asana/model/
goal_relationship_compact.rs

1use serde::{Serialize, Deserialize};
2use super::AsanaResource;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct GoalRelationshipCompact {
5    ///A generic Asana Resource, containing a globally unique identifier.
6    #[serde(flatten)]
7    pub asana_resource: AsanaResource,
8    ///The weight that the supporting resource's progress contributes to the supported goal's progress. This can only be 0 or 1.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub contribution_weight: Option<f64>,
11    ///The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning.
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub resource_subtype: Option<String>,
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub supporting_resource: Option<serde_json::Value>,
16}
17impl std::fmt::Display for GoalRelationshipCompact {
18    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19        write!(f, "{}", serde_json::to_string(self).unwrap())
20    }
21}
22impl std::ops::Deref for GoalRelationshipCompact {
23    type Target = AsanaResource;
24    fn deref(&self) -> &Self::Target {
25        &self.asana_resource
26    }
27}
28impl std::ops::DerefMut for GoalRelationshipCompact {
29    fn deref_mut(&mut self) -> &mut Self::Target {
30        &mut self.asana_resource
31    }
32}