Skip to main content

asana/model/
goal_request_base.rs

1use serde::{Serialize, Deserialize};
2use super::GoalBase;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct GoalRequestBase {
5    #[serde(flatten)]
6    pub goal_base: GoalBase,
7    ///The `gid` of a user.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub owner: Option<String>,
10    ///*Conditional*. This property is only present when the `workspace` provided is an organization.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub team: Option<String>,
13    ///The `gid` of a time period.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub time_period: Option<String>,
16    ///The `gid` of a workspace.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub workspace: Option<String>,
19}
20impl std::fmt::Display for GoalRequestBase {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
22        write!(f, "{}", serde_json::to_string(self).unwrap())
23    }
24}
25impl std::ops::Deref for GoalRequestBase {
26    type Target = GoalBase;
27    fn deref(&self) -> &Self::Target {
28        &self.goal_base
29    }
30}
31impl std::ops::DerefMut for GoalRequestBase {
32    fn deref_mut(&mut self) -> &mut Self::Target {
33        &mut self.goal_base
34    }
35}