use crate::model::subscription_level::Promo;
use serde::Deserialize;
use std::collections::HashMap;
#[derive(Deserialize, Debug)]
pub struct SubscriptionsResponse {
pub data: Vec<Subscription>,
pub total: u64,
pub limit: u64,
pub offset: u64,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Subscription {
pub id: u64,
pub level_id: u64,
pub parent_id: Option<u64>,
pub name: String,
pub price: u64,
pub custom_price: u64,
pub period: u8,
pub on_time: i64,
pub off_time: Option<i64>,
pub next_pay_time: Option<i64>,
pub is_pause: bool,
pub is_suspended: bool,
pub is_archived: bool,
pub is_apple_payed: bool,
pub is_fee_paid: bool,
pub owner_id: u64,
pub subscription_level: SubscriptionLevelInfo,
pub blog: BlogInfo,
pub recommended_promo: Option<Promo>,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SubscriptionLevelInfo {
pub id: u64,
pub name: String,
pub price: u64,
pub currency_prices: HashMap<String, f64>,
pub is_limited: bool,
pub is_archived: bool,
pub is_hidden: bool,
pub deleted: bool,
pub owner_id: u64,
pub created_at: i64,
pub data: Vec<serde_json::Value>,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct BlogInfo {
pub blog_url: String,
pub title: String,
pub cover_url: String,
pub has_adult_content: bool,
pub owner: BlogOwner,
pub flags: BlogFlags,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct BlogOwner {
pub id: u64,
pub name: String,
pub has_avatar: bool,
pub avatar_url: String,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct BlogFlags {
pub show_post_donations: bool,
pub has_adult_content: bool,
pub has_subscription_levels: bool,
pub forbidden_change_has_adult_content: bool,
pub has_targets: bool,
pub is_alien: bool,
pub allow_index: bool,
pub allow_google_index: bool,
pub accept_donation_messages: bool,
pub is_rss_feed_enabled: bool,
}