/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PostAnalytics {
    #[serde(rename = "impressions", skip_serializing_if = "Option::is_none")]
    pub impressions: Option<i32>,
    #[serde(rename = "reach", skip_serializing_if = "Option::is_none")]
    pub reach: Option<i32>,
    #[serde(rename = "likes", skip_serializing_if = "Option::is_none")]
    pub likes: Option<i32>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<i32>,
    #[serde(rename = "shares", skip_serializing_if = "Option::is_none")]
    pub shares: Option<i32>,
    /// Number of saves/bookmarks (Instagram, Pinterest)
    #[serde(rename = "saves", skip_serializing_if = "Option::is_none")]
    pub saves: Option<i32>,
    #[serde(rename = "clicks", skip_serializing_if = "Option::is_none")]
    pub clicks: Option<i32>,
    #[serde(rename = "views", skip_serializing_if = "Option::is_none")]
    pub views: Option<i32>,
    /// Instagram feed posts and stories only: organic accounts that started following from this post. 0 for reels and other platforms.
    #[serde(rename = "follows", skip_serializing_if = "Option::is_none")]
    pub follows: Option<i32>,
    /// Instagram Reels only: average watch time per play, in milliseconds. 0 for non-Reels media and other platforms.
    #[serde(
        rename = "igReelsAvgWatchTime",
        skip_serializing_if = "Option::is_none"
    )]
    pub ig_reels_avg_watch_time: Option<i32>,
    /// Instagram Reels only: total watch time including replays, in milliseconds. 0 for non-Reels media and other platforms.
    #[serde(
        rename = "igReelsVideoViewTotalTime",
        skip_serializing_if = "Option::is_none"
    )]
    pub ig_reels_video_view_total_time: Option<i32>,
    #[serde(rename = "engagementRate", skip_serializing_if = "Option::is_none")]
    pub engagement_rate: Option<f64>,
    #[serde(rename = "lastUpdated", skip_serializing_if = "Option::is_none")]
    pub last_updated: Option<String>,
}

impl PostAnalytics {
    pub fn new() -> PostAnalytics {
        PostAnalytics {
            impressions: None,
            reach: None,
            likes: None,
            comments: None,
            shares: None,
            saves: None,
            clicks: None,
            views: None,
            follows: None,
            ig_reels_avg_watch_time: None,
            ig_reels_video_view_total_time: None,
            engagement_rate: None,
            last_updated: None,
        }
    }
}
