megamind/models/
webpage.rs

1//! Data models for web pages.
2//!
3//! Visit the [Genius documentation](https://docs.genius.com/#web_pages-h2) for more context.
4#[cfg(feature = "catchall")]
5use std::collections::HashMap;
6
7use serde::{Deserialize, Serialize};
8
9#[cfg(feature = "catchall")]
10use serde_json::Value;
11
12/// A web page response.
13#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
14pub struct WebPageResponse {
15    /// Web page data.
16    pub web_page: WebPage,
17}
18
19/// Web page data.
20#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
21pub struct WebPage {
22    /// API path to the web page.
23    pub api_path: Option<String>,
24    /// Domain of the web page.
25    pub domain: String,
26    /// ID of the web page.
27    pub id: Option<u32>,
28    /// Normalized URL.
29    pub normalized_url: String,
30    /// Full URL.
31    pub share_url: String,
32    /// Page title.
33    pub title: String,
34    /// Full URL.
35    pub url: String,
36    /// Total number of annotations on this page.
37    pub annotation_count: u32,
38    /// Extra data.
39    #[cfg(feature = "catchall")]
40    #[serde(flatten)]
41    pub extra: HashMap<String, Value>,
42}