atomic_lti/deep_linking/
file.rs

1use super::shared::{Icon, Thumbnail};
2use serde::{Deserialize, Serialize};
3use serde_with::skip_serializing_none;
4
5#[skip_serializing_none]
6#[derive(Debug, Deserialize, Serialize, Clone)]
7pub struct File {
8  #[serde(rename = "type")]
9  #[serde(default = "default_type")]
10  pub type_: String,
11  pub url: String,
12  pub title: Option<String>,
13  pub text: Option<String>,
14  pub icon: Option<Icon>,
15  pub thumbnail: Option<Thumbnail>,
16  pub expires_at: Option<String>,
17}
18
19impl Default for File {
20  fn default() -> Self {
21    Self {
22      type_: "file".to_string(),
23      url: "".to_string(),
24      title: None,
25      text: None,
26      icon: None,
27      thumbnail: None,
28      expires_at: None,
29    }
30  }
31}
32
33fn default_type() -> String {
34  "file".to_string()
35}