asana/model/
project_response.rs

1use serde::{Serialize, Deserialize};
2use super::{CustomFieldCompact, ProjectBase, UserCompact};
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct ProjectResponse {
5    #[serde(flatten)]
6    pub project_base: ProjectBase,
7    ///True if the project is currently marked complete, false if not.
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub completed: Option<bool>,
10    ///The time at which this project was completed, or null if the project is not completed.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub completed_by: Option<serde_json::Value>,
15    #[serde(skip_serializing_if = "Option::is_none")]
16    pub created_from_template: Option<serde_json::Value>,
17    ///Array of Custom Fields.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub custom_fields: Option<Vec<CustomFieldCompact>>,
20    ///Array of users following this project. Followers are a subset of members who have opted in to receive "tasks added" notifications for a project.
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub followers: Option<Vec<UserCompact>>,
23    ///The icon for a project.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub icon: Option<String>,
26    ///The current owner of the project, may be null.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub owner: Option<serde_json::Value>,
29    ///A url that points directly to the object within Asana.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub permalink_url: Option<String>,
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub project_brief: Option<serde_json::Value>,
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub team: Option<serde_json::Value>,
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub workspace: Option<serde_json::Value>,
38}
39impl std::fmt::Display for ProjectResponse {
40    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
41        write!(f, "{}", serde_json::to_string(self).unwrap())
42    }
43}
44impl std::ops::Deref for ProjectResponse {
45    type Target = ProjectBase;
46    fn deref(&self) -> &Self::Target {
47        &self.project_base
48    }
49}
50impl std::ops::DerefMut for ProjectResponse {
51    fn deref_mut(&mut self) -> &mut Self::Target {
52        &mut self.project_base
53    }
54}