late 0.0.1026

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).
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).
 *
 * The version of the OpenAPI document: 1.68.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 AnalyticsListResponsePostsInner {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub _id: Option<String>,
    /// Original Zernio post ID if scheduled via Zernio
    #[serde(
        rename = "latePostId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub late_post_id: Option<Option<String>>,
    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
    #[serde(rename = "scheduledFor", skip_serializing_if = "Option::is_none")]
    pub scheduled_for: Option<String>,
    #[serde(rename = "publishedAt", skip_serializing_if = "Option::is_none")]
    pub published_at: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    #[serde(rename = "analytics", skip_serializing_if = "Option::is_none")]
    pub analytics: Option<Box<models::PostAnalytics>>,
    #[serde(rename = "platforms", skip_serializing_if = "Option::is_none")]
    pub platforms: Option<Vec<models::PlatformAnalytics>>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(rename = "platformPostUrl", skip_serializing_if = "Option::is_none")]
    pub platform_post_url: Option<String>,
    #[serde(rename = "isExternal", skip_serializing_if = "Option::is_none")]
    pub is_external: Option<bool>,
    /// True when this post's metrics include paid delivery, so organic reporting should exclude it. Set for LinkedIn dark posts and for TikTok posts that one of your TikTok ads promotes (Spark / boosted). TikTok exposes no ad flag of its own, so a video created by an uploaded-asset (non-Spark) TikTok ad is posted to the profile with a fresh organic id and cannot be detected: those still report as false.
    #[serde(rename = "isAd", skip_serializing_if = "Option::is_none")]
    pub is_ad: Option<bool>,
    #[serde(
        rename = "profileId",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub profile_id: Option<Option<String>>,
    #[serde(rename = "thumbnailUrl", skip_serializing_if = "Option::is_none")]
    pub thumbnail_url: Option<String>,
    #[serde(rename = "mediaType", skip_serializing_if = "Option::is_none")]
    pub media_type: Option<MediaType>,
    /// All media items for this post. Carousel posts contain one entry per slide.
    #[serde(rename = "mediaItems", skip_serializing_if = "Option::is_none")]
    pub media_items: Option<Vec<models::AnalyticsListResponsePostsInnerMediaItemsInner>>,
    /// Instagram only: the platform media product type (e.g. FEED, REELS, STORY, AD). Absent when the platform did not report it.
    #[serde(rename = "mediaProductType", skip_serializing_if = "Option::is_none")]
    pub media_product_type: Option<String>,
    /// Instagram only: whether Instagram labeled the media as AI-generated. Absent when the platform did not report it.
    #[serde(rename = "isAiGenerated", skip_serializing_if = "Option::is_none")]
    pub is_ai_generated: Option<bool>,
    /// Instagram reels only: whether the reel is also shared to the main feed. Absent when the platform did not report it.
    #[serde(rename = "isSharedToFeed", skip_serializing_if = "Option::is_none")]
    pub is_shared_to_feed: Option<bool>,
    /// Instagram only: audio type of the media (MUSIC or ORIGINAL_SOUND). Absent when the platform did not report it.
    #[serde(rename = "mediaAudioType", skip_serializing_if = "Option::is_none")]
    pub media_audio_type: Option<String>,
}

impl AnalyticsListResponsePostsInner {
    pub fn new() -> AnalyticsListResponsePostsInner {
        AnalyticsListResponsePostsInner {
            _id: None,
            late_post_id: None,
            content: None,
            scheduled_for: None,
            published_at: None,
            status: None,
            analytics: None,
            platforms: None,
            platform: None,
            platform_post_url: None,
            is_external: None,
            is_ad: None,
            profile_id: None,
            thumbnail_url: None,
            media_type: None,
            media_items: None,
            media_product_type: None,
            is_ai_generated: None,
            is_shared_to_feed: None,
            media_audio_type: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MediaType {
    #[serde(rename = "image")]
    Image,
    #[serde(rename = "video")]
    Video,
    #[serde(rename = "gif")]
    Gif,
    #[serde(rename = "document")]
    Document,
    #[serde(rename = "carousel")]
    Carousel,
    #[serde(rename = "text")]
    Text,
}

impl Default for MediaType {
    fn default() -> MediaType {
        Self::Image
    }
}