asana/model/
story_compact.rs1use serde::{Serialize, Deserialize};
2use super::{AsanaResource, UserCompact};
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct StoryCompact {
5 #[serde(flatten)]
7 pub asana_resource: AsanaResource,
8 #[serde(skip_serializing_if = "Option::is_none")]
10 pub created_at: Option<chrono::DateTime<chrono::Utc>>,
11 #[serde(skip_serializing_if = "Option::is_none")]
12 pub created_by: Option<UserCompact>,
13 #[serde(skip_serializing_if = "Option::is_none")]
15 pub resource_subtype: Option<String>,
16 #[doc = "*Create-only*. Human-readable text for the story or comment.\nThis will not include the name of the creator.\n*Note: This is not guaranteed to be stable for a given type of story. For example, text for a reassignment may not always say “assigned to …” as the text for a story can both be edited and change based on the language settings of the user making the request.*\nUse the `resource_subtype` property to discover the action that created the story."]
17 #[serde(skip_serializing_if = "Option::is_none")]
18 pub text: Option<String>,
19}
20impl std::fmt::Display for StoryCompact {
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 StoryCompact {
26 type Target = AsanaResource;
27 fn deref(&self) -> &Self::Target {
28 &self.asana_resource
29 }
30}
31impl std::ops::DerefMut for StoryCompact {
32 fn deref_mut(&mut self) -> &mut Self::Target {
33 &mut self.asana_resource
34 }
35}