use crate::structs::common::*;
use chrono::offset::FixedOffset;
use chrono::DateTime;
use serde::Deserialize;
use std::string::String;
#[derive(Debug, Deserialize)]
pub struct Root {
pub data: Vec<Episode>,
pub page: Option<u16>,
pub per_page: Option<u16>,
pub total_pages: Option<u16>,
pub total_results: Option<u32>,
}
#[derive(Debug, Deserialize)]
pub struct Episode {
#[serde(rename = "_index")]
pub index: String,
pub sort: Option<Vec<u64>>,
pub id: u32,
#[serde(rename = "type")]
pub kind: String,
pub uuid: String,
pub attributes: Attributes,
pub links: Links,
pub canonical_links: CanonicalLinks,
pub included: Included,
}
#[derive(Debug, Deserialize)]
pub struct Attributes {
pub title: String,
pub slug: String,
pub caption: String,
pub number: u16,
pub description: String,
pub display_title: String,
pub length: u32,
pub advert_config: String,
pub advertising: bool,
pub ad_timestamps: Option<String>,
pub public_golive_at: DateTime<FixedOffset>,
pub sponsor_golive_at: DateTime<FixedOffset>,
pub member_golive_at: DateTime<FixedOffset>,
pub original_air_date: DateTime<FixedOffset>,
pub channel_id: String,
pub channel_slug: String,
pub season_id: String,
pub season_slug: String,
pub season_number: u16,
pub show_title: String,
pub show_id: String,
pub show_slug: String,
pub is_sponsors_only: bool,
pub member_tier_i: i8,
pub sort_number: u32,
pub genres: Vec<String>,
pub is_live: bool,
pub is_schedulable: bool,
pub season_order: String,
pub episode_order: String,
pub downloadable: bool,
pub blacklisted_countries: Vec<String>,
pub upsell_next: bool,
}
#[derive(Debug, Deserialize)]
pub struct Links {
#[serde(rename = "self")]
pub reference: String,
pub show: String,
pub related_shows: String,
pub channel: String,
pub season: String,
pub next: String,
pub videos: String,
pub products: String,
}
#[derive(Debug, Deserialize)]
pub struct CanonicalLinks {
#[serde(rename = "self")]
pub reference: String,
pub show: String,
}
#[derive(Debug, Deserialize)]
pub struct Included {
pub images: Vec<Image>,
pub tags: Vec<Tag>,
pub cast_members: Vec<CastMember>,
}
#[derive(Debug, Deserialize)]
pub struct Tag {
pub id: String,
pub uuid: String,
#[serde(rename = "type")]
pub kind: String,
pub attributes: TagAttribute,
}
#[derive(Debug, Deserialize)]
pub struct TagAttribute {
pub tag: String,
pub slug: String,
}
#[derive(Debug, Deserialize)]
pub struct CastMember {
pub id: String,
pub uuid: String,
#[serde(rename = "type")]
pub kind: String,
pub attributes: CastMemberAttributes,
}
#[derive(Debug, Deserialize)]
pub struct CastMemberAttributes {
pub name: String,
}