use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Story {
pub chat: crate::chat::Chat,
pub id: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StoryAreaPosition {
pub x_percentage: f64,
pub y_percentage: f64,
pub width_percentage: f64,
pub height_percentage: f64,
pub rotation_angle: f64,
pub corner_radius_percentage: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum StoryAreaType {
Location {
location: crate::chat::Location,
address: Option<LocationAddress>,
},
SuggestedReaction {
reaction_type: crate::message::ReactionType,
is_dark: Option<bool>,
is_flipped: Option<bool>,
},
Link {
url: String,
},
Weather {
temperature: f64,
emoji: String,
background_color: i32,
},
UniqueGift {
name: String,
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LocationAddress {
pub country_code: String,
pub state: Option<String>,
pub city: Option<String>,
pub street: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StoryArea {
pub position: StoryAreaPosition,
#[serde(rename = "type")]
pub kind: StoryAreaType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InputStoryContentPhoto {
pub photo: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InputStoryContentVideo {
pub video: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cover_frame_timestamp: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_animation: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum InputStoryContent {
Photo(InputStoryContentPhoto),
Video(InputStoryContentVideo),
}