Skip to main content

asana/model/
task_compact.rs

1use serde::{Serialize, Deserialize};
2use super::AsanaResource;
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct TaskCompact {
5    ///A generic Asana Resource, containing a globally unique identifier.
6    #[serde(flatten)]
7    pub asana_resource: AsanaResource,
8    ///[Opt In](/docs/inputoutput-options). A *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub created_by: Option<serde_json::Value>,
11    ///The name of the task.
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub name: Option<String>,
14    /**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.
15The resource_subtype `milestone` represent a single moment in time. This means tasks with this subtype cannot have a start_date.*/
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub resource_subtype: Option<String>,
18}
19impl std::fmt::Display for TaskCompact {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21        write!(f, "{}", serde_json::to_string(self).unwrap())
22    }
23}
24impl std::ops::Deref for TaskCompact {
25    type Target = AsanaResource;
26    fn deref(&self) -> &Self::Target {
27        &self.asana_resource
28    }
29}
30impl std::ops::DerefMut for TaskCompact {
31    fn deref_mut(&mut self) -> &mut Self::Target {
32        &mut self.asana_resource
33    }
34}