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-05-07 16:56:11 +02:00
|
|
|
pub(crate) struct Card {
|
|
|
|
pub(crate) url: String,
|
|
|
|
pub(crate) title: String,
|
|
|
|
pub(crate) description: String,
|
|
|
|
pub(crate) r#type: CardType,
|
|
|
|
pub(crate) author_name: Option<String>,
|
|
|
|
pub(crate) author_url: Option<String>,
|
|
|
|
pub(crate) provider_name: Option<String>,
|
|
|
|
pub(crate) provider_url: Option<String>,
|
|
|
|
pub(crate) html: Option<String>,
|
|
|
|
pub(crate) width: Option<i64>,
|
|
|
|
pub(crate) height: Option<i64>,
|
|
|
|
pub(crate) image: Option<String>,
|
|
|
|
pub(crate) 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-05-07 16:56:11 +02:00
|
|
|
pub(crate) enum CardType {
|
2020-04-03 18:41:53 +02:00
|
|
|
Link,
|
|
|
|
Photo,
|
|
|
|
Video,
|
|
|
|
Rich,
|
|
|
|
}
|