1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use chrono::offset::FixedOffset;
use chrono::DateTime;
use serde::Deserialize;
use std::string::String;
#[derive(Debug, Deserialize)]
pub struct Root {
pub data: Vec<Video>,
}
#[derive(Debug, Deserialize)]
pub struct Video {
#[serde(rename = "_index")]
pub index: String,
#[serde(rename = "_score")]
pub score: f32,
pub id: u32,
#[serde(rename = "type")]
pub kind: String,
pub uuid: String,
pub attributes: Attributes,
pub links: Links,
}
#[derive(Debug, Deserialize)]
pub struct Attributes {
pub url: String,
pub content_id: u32,
pub content_slug: String,
pub content_uuid: String,
pub public_golive_at: DateTime<FixedOffset>,
pub sponsor_golive_at: DateTime<FixedOffset>,
pub member_golive_at: DateTime<FixedOffset>,
pub media_type: String,
pub member_tier: String,
pub embed: bool,
pub is_sponsors_only: bool,
pub image_pattern_url: Option<String>,
pub bif_url: Option<String>,
pub ad_config: Option<AdConfig>,
}
#[derive(Debug, Deserialize)]
pub struct AdConfig {
pub nw: String,
pub caid: String,
pub afid: String,
pub prof: String,
pub ad_timestamps: Option<Vec<u32>>,
pub preroll: Vec<String>,
pub midroll: Vec<String>,
}
#[derive(Debug, Deserialize)]
pub struct Links {
#[serde(rename = "self")]
pub reference: String,
pub content: String,
pub download: String,
}