Skip to main content

asana/model/
user_task_list_compact.rs

1use serde::{Serialize, Deserialize};
2use super::{AsanaResource, UserCompact, WorkspaceCompact};
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct UserTaskListCompact {
5    ///A generic Asana Resource, containing a globally unique identifier.
6    #[serde(flatten)]
7    pub asana_resource: AsanaResource,
8    ///The name of the user task list.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub name: Option<String>,
11    ///The owner of the user task list, i.e. the person whose My Tasks is represented by this resource.
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub owner: Option<UserCompact>,
14    ///The workspace in which the user task list is located.
15    #[serde(skip_serializing_if = "Option::is_none")]
16    pub workspace: Option<WorkspaceCompact>,
17}
18impl std::fmt::Display for UserTaskListCompact {
19    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20        write!(f, "{}", serde_json::to_string(self).unwrap())
21    }
22}
23impl std::ops::Deref for UserTaskListCompact {
24    type Target = AsanaResource;
25    fn deref(&self) -> &Self::Target {
26        &self.asana_resource
27    }
28}
29impl std::ops::DerefMut for UserTaskListCompact {
30    fn deref_mut(&mut self) -> &mut Self::Target {
31        &mut self.asana_resource
32    }
33}