use chrono::NaiveDateTime;
use serde::Deserialize;
#[derive(Debug, Deserialize, PartialEq, Clone)]
#[serde(rename_all = "camelCase")]
pub struct DeviceProperties {
#[serde(rename = "teamNameDisplay")]
pub displayed_team_name: String,
pub body_background_skin_wired_url: String,
pub body_background_skin_total: usize,
pub favicon: Asset,
pub body_background_skin1: Asset,
pub header_masthead_tagline: Asset,
pub header_masthead_tagline_2x: Asset,
pub navigation_masthead_sponsor_image: Asset,
pub navigation_masthead_sponsor_image_2x: Asset,
pub organism_headline_font: Asset,
pub style: Style,
}
id!(AssetId { id: u32 });
#[derive(Debug, Deserialize, PartialEq, Clone)]
#[serde(tag = "type", rename_all = "camelCase", rename_all_fields = "camelCase")]
pub enum Asset {
ShortContent {
id: AssetId,
timestamp: NaiveDateTime,
title: String,
description: String,
url: String,
image: ImageData,
},
BinaryAsset {
id: AssetId,
timestamp: NaiveDateTime,
#[serde(rename = "binaryFile")]
binary_file_url: String,
},
}
#[derive(Debug, Deserialize, PartialEq, Clone)]
#[serde(rename_all = "camelCase")]
pub struct ImageData {
pub title: Option<String>,
pub alt_text: Option<String>,
pub cuts: Option<Cuts>,
}
impl Asset {
#[must_use]
pub fn id(&self) -> AssetId {
match self {
Asset::ShortContent { id, .. } => *id,
Asset::BinaryAsset { id, .. } => *id,
}
}
}
#[derive(Debug, Deserialize, PartialEq, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Style {
}