late 0.0.661

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.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// FacebookPostEarningsResponse : Lifetime monetization earnings for one Facebook post. Same \"unit\" / \"currency\" contract and same unavailable-vs-zero contract as the Page-level response; there is no date range, no metricType, and no daily \"values\", because the single lifetime bucket IS the total.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FacebookPostEarningsResponse {
    #[serde(rename = "success", skip_serializing_if = "Option::is_none")]
    pub success: Option<bool>,
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// The platform post ID that was queried, echoed back.
    #[serde(rename = "postId", skip_serializing_if = "Option::is_none")]
    pub post_id: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    /// Always \"lifetime\": the total is cumulative since publication and must not be summed across dates or across posts.
    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
    pub period: Option<Period>,
    /// One entry per served metric. A metric reported here with \"total\": 0 genuinely earned nothing (or its Page is not enrolled, which Meta reports identically).
    #[serde(rename = "metrics", skip_serializing_if = "Option::is_none")]
    pub metrics:
        Option<std::collections::HashMap<String, models::FacebookPostEarningsResponseMetricsValue>>,
    /// Requested metrics Meta could not serve. Present only when at least one metric is unavailable, and absent otherwise. Each listed metric is OMITTED from \"metrics\" rather than reported as 0. The request itself still succeeds with HTTP 200.
    #[serde(rename = "unavailableMetrics", skip_serializing_if = "Option::is_none")]
    pub unavailable_metrics:
        Option<Vec<models::FacebookPostEarningsResponseUnavailableMetricsInner>>,
    #[serde(rename = "dataDelay", skip_serializing_if = "Option::is_none")]
    pub data_delay: Option<String>,
}

impl FacebookPostEarningsResponse {
    /// Lifetime monetization earnings for one Facebook post. Same \"unit\" / \"currency\" contract and same unavailable-vs-zero contract as the Page-level response; there is no date range, no metricType, and no daily \"values\", because the single lifetime bucket IS the total.
    pub fn new() -> FacebookPostEarningsResponse {
        FacebookPostEarningsResponse {
            success: None,
            account_id: None,
            post_id: None,
            platform: None,
            period: None,
            metrics: None,
            unavailable_metrics: None,
            data_delay: None,
        }
    }
}
/// Always \"lifetime\": the total is cumulative since publication and must not be summed across dates or across posts.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Period {
    #[serde(rename = "lifetime")]
    Lifetime,
}

impl Default for Period {
    fn default() -> Period {
        Self::Lifetime
    }
}