late 0.0.1285

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.404.0
 * 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 AdAnalyticsResponseAnalytics {
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<Box<models::AdMetrics>>,
    #[serde(rename = "daily", skip_serializing_if = "Option::is_none")]
    pub daily: Option<Vec<models::CampaignAnalyticsResponseAnalyticsDailyInner>>,
    /// Requested demographic breakdowns, keyed by dimension. Fetched live from the platform per request and never stored, so these rows can carry fields the stored `summary` and `daily` series do not.  LinkedIn rows carry `value` (the pivot URN), `name` (resolved label where LinkedIn provides one), the usual spend/impressions/clicks/ctr/cpc/cpm/engagement figures, plus two reach fields:  - `reach`: the segment's `approximateMemberReach`. - `audiencePenetration`: LinkedIn's own ratio of members reached to the size of   the targeted audience, passed through verbatim.  LinkedIn withholds both below its audience privacy threshold, in which case the keys are ABSENT rather than 0. `audiencePenetration` is available here only: it is not part of the stored metrics series.  TikTok rows are keyed by TikTok's own dimension name (`country_code` for `country`, `platform` for `publisher_platform`). `placement` rows carry the label TikTok Ads Manager shows (`TikTok`, `TikTok Ad Network`, `News Feed App Series`) in `placement` and TikTok's API value (`PLACEMENT_TIKTOK`, `PLACEMENT_PANGLE`, `PLACEMENT_GLOBAL_APP_BUNDLE`) in `placementRaw`; a value without a known label carries the raw value in both.  A requested dimension with no data in the range is an empty array.
    #[serde(rename = "breakdowns", skip_serializing_if = "Option::is_none")]
    pub breakdowns: Option<std::collections::HashMap<String, Vec<serde_json::Value>>>,
    /// Requested breakdowns this platform cannot break down by (e.g. region on TikTok, any breakdown on Google). Absent when every requested breakdown is supported.
    #[serde(
        rename = "unsupportedBreakdowns",
        skip_serializing_if = "Option::is_none"
    )]
    pub unsupported_breakdowns: Option<Vec<String>>,
    /// Guidance for some names in unsupportedBreakdowns, keyed by that name (e.g. placement on Meta points at publisher_platform and platform_position; platform_position on TikTok points at placement). Absent when no unsupported name has a hint.
    #[serde(rename = "breakdownHints", skip_serializing_if = "Option::is_none")]
    pub breakdown_hints: Option<std::collections::HashMap<String, String>>,
    /// TikTok only: breakdowns the platform failed to return (rate limit, permission, rejected query). Each one is an empty array under breakdowns; summary and daily are unaffected. Absent when every breakdown answered.
    #[serde(rename = "breakdownErrors", skip_serializing_if = "Option::is_none")]
    pub breakdown_errors:
        Option<Vec<models::CampaignAnalyticsResponseAnalyticsBreakdownErrorsInner>>,
    /// TikTok only: TikTok metric names TikTok refused for a breakdown, keyed by the requested breakdown (e.g. total_purchase and total_purchase_value have no relation to platform, ac or language). Every row value derived from a refused metric is null in that breakdown (purchaseValue and roas, or the matching actions and actionValues entries), never a number computed without it. Absent when no metric was refused.
    #[serde(
        rename = "breakdownDroppedMetrics",
        skip_serializing_if = "Option::is_none"
    )]
    pub breakdown_dropped_metrics: Option<std::collections::HashMap<String, Vec<String>>>,
    #[serde(rename = "breakdownsRange", skip_serializing_if = "Option::is_none")]
    pub breakdowns_range: Option<Box<models::CampaignAnalyticsResponseAnalyticsBreakdownsRange>>,
}

impl AdAnalyticsResponseAnalytics {
    pub fn new() -> AdAnalyticsResponseAnalytics {
        AdAnalyticsResponseAnalytics {
            summary: None,
            daily: None,
            breakdowns: None,
            unsupported_breakdowns: None,
            breakdown_hints: None,
            breakdown_errors: None,
            breakdown_dropped_metrics: None,
            breakdowns_range: None,
        }
    }
}