2020-04-03 18:41:53 +02:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
#[serde(deny_unknown_fields)]
|
2020-04-24 01:28:26 +02:00
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
2020-04-29 22:05:57 +02:00
|
|
|
pub(in super::super) struct Card {
|
|
|
|
pub(super) url: String,
|
|
|
|
pub(super) title: String,
|
|
|
|
pub(super) description: String,
|
|
|
|
pub(super) r#type: CardType,
|
|
|
|
pub(super) author_name: Option<String>,
|
|
|
|
pub(super) author_url: Option<String>,
|
|
|
|
pub(super) provider_name: Option<String>,
|
|
|
|
pub(super) provider_url: Option<String>,
|
|
|
|
pub(super) html: Option<String>,
|
|
|
|
pub(super) width: Option<i64>,
|
|
|
|
pub(super) height: Option<i64>,
|
|
|
|
pub(super) image: Option<String>,
|
|
|
|
pub(super) embed_url: Option<String>,
|
2020-04-03 18:41:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[serde(rename_all = "lowercase", deny_unknown_fields)]
|
2020-04-24 01:28:26 +02:00
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
2020-04-29 22:05:57 +02:00
|
|
|
pub(super) enum CardType {
|
2020-04-03 18:41:53 +02:00
|
|
|
Link,
|
|
|
|
Photo,
|
|
|
|
Video,
|
|
|
|
Rich,
|
|
|
|
}
|