Skip to main content

asana/model/
project_template_base.rs

1use serde::{Serialize, Deserialize};
2use super::{DateVariableCompact, ProjectTemplateCompact, TeamCompact, TemplateRole};
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct ProjectTemplateBase {
5    #[serde(flatten)]
6    pub project_template_compact: ProjectTemplateCompact,
7    ///Color of the project template.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub color: Option<serde_json::Value>,
10    ///Free-form textual information associated with the project template
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub description: Option<String>,
13    ///The description of the project template with formatting as HTML.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub html_description: Option<String>,
16    ///The current owner of the project template, may be null.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub owner: Option<serde_json::Value>,
19    ///True if the project template is public to its team.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub public: Option<bool>,
22    ///Array of date variables in this project template. Calendar dates must be provided for these variables when instantiating a project.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub requested_dates: Option<Vec<DateVariableCompact>>,
25    ///Array of template roles in this project template. User Ids can be provided for these variables when instantiating a project to assign template tasks to the user.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub requested_roles: Option<Vec<TemplateRole>>,
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub team: Option<TeamCompact>,
30}
31impl std::fmt::Display for ProjectTemplateBase {
32    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
33        write!(f, "{}", serde_json::to_string(self).unwrap())
34    }
35}
36impl std::ops::Deref for ProjectTemplateBase {
37    type Target = ProjectTemplateCompact;
38    fn deref(&self) -> &Self::Target {
39        &self.project_template_compact
40    }
41}
42impl std::ops::DerefMut for ProjectTemplateBase {
43    fn deref_mut(&mut self) -> &mut Self::Target {
44        &mut self.project_template_compact
45    }
46}