zernio 0.0.132

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * 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.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 AccountWithFollowerStats {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub _id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<Platform>,
    #[serde(rename = "profileId", skip_serializing_if = "Option::is_none")]
    pub profile_id: Option<Box<models::SocialAccountProfileId>>,
    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
    #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// Full profile URL for the connected account on its platform.
    #[serde(rename = "profileUrl", skip_serializing_if = "Option::is_none")]
    pub profile_url: Option<String>,
    #[serde(rename = "isActive", skip_serializing_if = "Option::is_none")]
    pub is_active: Option<bool>,
    /// Follower count (only included if user has analytics add-on)
    #[serde(rename = "followersCount", skip_serializing_if = "Option::is_none")]
    pub followers_count: Option<f64>,
    /// Last time follower count was updated (only included if user has analytics add-on)
    #[serde(
        rename = "followersLastUpdated",
        skip_serializing_if = "Option::is_none"
    )]
    pub followers_last_updated: Option<String>,
    /// Reference to the parent posting SocialAccount. Set for ads accounts that share or derive from a posting account's OAuth token. null for standalone ads (Google Ads) and all posting accounts.
    #[serde(rename = "parentAccountId", skip_serializing_if = "Option::is_none")]
    pub parent_account_id: Option<String>,
    /// Whether the user explicitly activated this account. false means the account was created as a side effect (e.g., posting account auto-created when user connected ads first). Posting UI and scheduler ignore accounts with enabled: false.
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// **Deprecated.** With the new ads account model, ads accounts are separate SocialAccount documents. Check for accounts with ads platform values (metaads, linkedinads, pinterestads, tiktokads, xads, googleads) instead.  Legacy behavior: - `connected`: Ads are ready to use (same-token platforms like Meta/LinkedIn, or separate ads token is present). - `not_connected`: Platform supports ads but requires a separate ads OAuth. Use `GET /v1/connect/{platform}/ads` to connect. - `not_available`: Platform does not support ads (e.g., YouTube, Reddit, Bluesky).
    #[serde(rename = "adsStatus", skip_serializing_if = "Option::is_none")]
    pub ads_status: Option<AdsStatus>,
    /// Platform-specific metadata. Fields vary by platform. For WhatsApp accounts, includes: - `qualityRating`: Phone number quality rating from Meta (`GREEN`, `YELLOW`, `RED`, or `UNKNOWN`) - `nameStatus`: Display name review status (`APPROVED`, `PENDING_REVIEW`, `DECLINED`, or `NONE`). Messages cannot be sent until the display name is approved by Meta. - `messagingLimitTier`: Maximum unique business-initiated conversations per 24h rolling window (`TIER_250`, `TIER_1K`, `TIER_10K`, `TIER_100K`, or `TIER_UNLIMITED`). Scales automatically as quality rating improves. - `verifiedName`: Meta-verified business display name - `displayPhoneNumber`: Formatted phone number (e.g., \"+1 555-123-4567\") - `wabaId`: WhatsApp Business Account ID - `phoneNumberId`: Meta phone number ID
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
    #[serde(rename = "profilePicture", skip_serializing_if = "Option::is_none")]
    pub profile_picture: Option<String>,
    /// Current follower count
    #[serde(rename = "currentFollowers", skip_serializing_if = "Option::is_none")]
    pub current_followers: Option<f64>,
    #[serde(rename = "lastUpdated", skip_serializing_if = "Option::is_none")]
    pub last_updated: Option<String>,
    /// Follower change over period
    #[serde(rename = "growth", skip_serializing_if = "Option::is_none")]
    pub growth: Option<f64>,
    /// Percentage growth
    #[serde(rename = "growthPercentage", skip_serializing_if = "Option::is_none")]
    pub growth_percentage: Option<f64>,
    /// Number of historical snapshots
    #[serde(rename = "dataPoints", skip_serializing_if = "Option::is_none")]
    pub data_points: Option<f64>,
    #[serde(rename = "accountStats", skip_serializing_if = "Option::is_none")]
    pub account_stats: Option<Box<models::AccountWithFollowerStatsAllOfAccountStats>>,
}

impl AccountWithFollowerStats {
    pub fn new() -> AccountWithFollowerStats {
        AccountWithFollowerStats {
            _id: None,
            platform: None,
            profile_id: None,
            username: None,
            display_name: None,
            profile_url: None,
            is_active: None,
            followers_count: None,
            followers_last_updated: None,
            parent_account_id: None,
            enabled: None,
            ads_status: None,
            metadata: None,
            profile_picture: None,
            current_followers: None,
            last_updated: None,
            growth: None,
            growth_percentage: None,
            data_points: None,
            account_stats: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
    #[serde(rename = "tiktok")]
    Tiktok,
    #[serde(rename = "instagram")]
    Instagram,
    #[serde(rename = "facebook")]
    Facebook,
    #[serde(rename = "youtube")]
    Youtube,
    #[serde(rename = "linkedin")]
    Linkedin,
    #[serde(rename = "twitter")]
    Twitter,
    #[serde(rename = "threads")]
    Threads,
    #[serde(rename = "pinterest")]
    Pinterest,
    #[serde(rename = "reddit")]
    Reddit,
    #[serde(rename = "bluesky")]
    Bluesky,
    #[serde(rename = "googlebusiness")]
    Googlebusiness,
    #[serde(rename = "telegram")]
    Telegram,
    #[serde(rename = "snapchat")]
    Snapchat,
    #[serde(rename = "whatsapp")]
    Whatsapp,
    #[serde(rename = "linkedinads")]
    Linkedinads,
    #[serde(rename = "metaads")]
    Metaads,
    #[serde(rename = "pinterestads")]
    Pinterestads,
    #[serde(rename = "tiktokads")]
    Tiktokads,
    #[serde(rename = "xads")]
    Xads,
    #[serde(rename = "googleads")]
    Googleads,
}

impl Default for Platform {
    fn default() -> Platform {
        Self::Tiktok
    }
}
/// **Deprecated.** With the new ads account model, ads accounts are separate SocialAccount documents. Check for accounts with ads platform values (metaads, linkedinads, pinterestads, tiktokads, xads, googleads) instead.  Legacy behavior: - `connected`: Ads are ready to use (same-token platforms like Meta/LinkedIn, or separate ads token is present). - `not_connected`: Platform supports ads but requires a separate ads OAuth. Use `GET /v1/connect/{platform}/ads` to connect. - `not_available`: Platform does not support ads (e.g., YouTube, Reddit, Bluesky).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AdsStatus {
    #[serde(rename = "connected")]
    Connected,
    #[serde(rename = "not_connected")]
    NotConnected,
    #[serde(rename = "not_available")]
    NotAvailable,
}

impl Default for AdsStatus {
    fn default() -> AdsStatus {
        Self::Connected
    }
}