Skip to main content

asana/model/
organization_export_compact.rs

1use serde::{Serialize, Deserialize};
2use super::{AsanaResource, WorkspaceCompact};
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct OrganizationExportCompact {
5    ///A generic Asana Resource, containing a globally unique identifier.
6    #[serde(flatten)]
7    pub asana_resource: AsanaResource,
8    ///The time at which this resource was created.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub created_at: Option<chrono::DateTime<chrono::Utc>>,
11    /**Download this URL to retreive the full export of the organization
12in JSON format. It will be compressed in a gzip (.gz) container.
13
14*Note: May be null if the export is still in progress or
15failed.  If present, this URL may only be valid for 1 hour from
16the time of retrieval. You should avoid persisting this URL
17somewhere and rather refresh on demand to ensure you do not keep
18stale URLs.**/
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub download_url: Option<String>,
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub organization: Option<WorkspaceCompact>,
23    ///The current state of the export.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub state: Option<String>,
26}
27impl std::fmt::Display for OrganizationExportCompact {
28    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
29        write!(f, "{}", serde_json::to_string(self).unwrap())
30    }
31}
32impl std::ops::Deref for OrganizationExportCompact {
33    type Target = AsanaResource;
34    fn deref(&self) -> &Self::Target {
35        &self.asana_resource
36    }
37}
38impl std::ops::DerefMut for OrganizationExportCompact {
39    fn deref_mut(&mut self) -> &mut Self::Target {
40        &mut self.asana_resource
41    }
42}