late 0.0.1127

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.217.1
 * 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 GetPostTimeline200ResponseTimelineInner {
    /// Date in YYYY-MM-DD format
    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
    pub date: Option<String>,
    /// Platform name (e.g. instagram, tiktok)
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    /// Platform-specific post ID
    #[serde(rename = "platformPostId", skip_serializing_if = "Option::is_none")]
    pub platform_post_id: Option<String>,
    /// Total impressions on this date
    #[serde(rename = "impressions", skip_serializing_if = "Option::is_none")]
    pub impressions: Option<i32>,
    /// Total reach on this date
    #[serde(rename = "reach", skip_serializing_if = "Option::is_none")]
    pub reach: Option<i32>,
    /// Total likes on this date
    #[serde(rename = "likes", skip_serializing_if = "Option::is_none")]
    pub likes: Option<i32>,
    /// Total comments on this date
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<i32>,
    /// Total shares on this date
    #[serde(rename = "shares", skip_serializing_if = "Option::is_none")]
    pub shares: Option<i32>,
    /// Total saves on this date
    #[serde(rename = "saves", skip_serializing_if = "Option::is_none")]
    pub saves: Option<i32>,
    /// Total clicks on this date
    #[serde(rename = "clicks", skip_serializing_if = "Option::is_none")]
    pub clicks: Option<i32>,
    /// Total views on this date
    #[serde(rename = "views", skip_serializing_if = "Option::is_none")]
    pub views: Option<i32>,
    /// Follows attributed to the post on this date (Instagram feed and stories, Facebook Reels, TikTok business lane). Null on Instagram Reels and video and on Facebook posts that are not Reels, where Meta has no follows metric; 0 on other platforms.
    #[serde(
        rename = "follows",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub follows: Option<Option<i32>>,
    /// TikTok business lane: share of viewers who watched to the end on this date, 0 to 1; 0 elsewhere
    #[serde(rename = "completionRate", skip_serializing_if = "Option::is_none")]
    pub completion_rate: Option<f64>,
    /// TikTok business lane: profile views attributed to the post on this date; 0 elsewhere
    #[serde(rename = "profileViews", skip_serializing_if = "Option::is_none")]
    pub profile_views: Option<i32>,
    /// TikTok business lane: website-link clicks attributed to the post on this date (also inside clicks); 0 elsewhere
    #[serde(rename = "websiteClicks", skip_serializing_if = "Option::is_none")]
    pub website_clicks: Option<i32>,
    /// TikTok business lane: share of views by surface on this date (forYou, follow, search, personalProfile, sound, directMessage, other), fractions 0 to 1; empty object elsewhere
    #[serde(rename = "impressionSources", skip_serializing_if = "Option::is_none")]
    pub impression_sources: Option<std::collections::HashMap<String, f64>>,
    /// TikTok business lane: follower / nonFollower and newViewer / returnViewer shares on this date, fractions 0 to 1; empty object elsewhere
    #[serde(rename = "audienceTypes", skip_serializing_if = "Option::is_none")]
    pub audience_types: Option<std::collections::HashMap<String, f64>>,
    /// TikTok business lane: viewer-country shares on this date keyed by ISO-3166 alpha-2, fractions 0 to 1, top 20 with the tail in `other`; empty object elsewhere
    #[serde(rename = "audienceCountries", skip_serializing_if = "Option::is_none")]
    pub audience_countries: Option<std::collections::HashMap<String, f64>>,
    /// Facebook Reels only: plays that were replays, as of this date; 0 elsewhere
    #[serde(rename = "replays", skip_serializing_if = "Option::is_none")]
    pub replays: Option<i32>,
    /// Facebook Reels only: share still watching at each second of playback, fractions 0 to 1 (Meta post_video_retention_graph). The base is a subset of plays that Meta selects and does not expose: on small Reels it can be far below views (6 of 51 measured), so a value is a share of that subset, not of all plays. Keys are whole seconds from the start of a play (\"3\" is the share still watching at 3 s). Loops count as continued playback, so a short Reels curve runs past its length (an 8 s Reel has keys \"0\" to \"12\"); Meta returns at most 41 points, so a long Reel covers only its first 40 s. Values are as of this date; empty object elsewhere.
    #[serde(rename = "retentionCurve", skip_serializing_if = "Option::is_none")]
    pub retention_curve: Option<std::collections::HashMap<String, f64>>,
}

impl GetPostTimeline200ResponseTimelineInner {
    pub fn new() -> GetPostTimeline200ResponseTimelineInner {
        GetPostTimeline200ResponseTimelineInner {
            date: None,
            platform: None,
            platform_post_id: None,
            impressions: None,
            reach: None,
            likes: None,
            comments: None,
            shares: None,
            saves: None,
            clicks: None,
            views: None,
            follows: None,
            completion_rate: None,
            profile_views: None,
            website_clicks: None,
            impression_sources: None,
            audience_types: None,
            audience_countries: None,
            replays: None,
            retention_curve: None,
        }
    }
}