/*
 * 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 GetAdsTimeline200ResponseRowsInner {
    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
    pub date: Option<String>,
    /// Native currency units (matches /ads/tree convention).
    #[serde(rename = "spend", skip_serializing_if = "Option::is_none")]
    pub spend: Option<f64>,
    #[serde(rename = "impressions", skip_serializing_if = "Option::is_none")]
    pub impressions: Option<i32>,
    #[serde(rename = "reach", skip_serializing_if = "Option::is_none")]
    pub reach: Option<i32>,
    #[serde(rename = "clicks", skip_serializing_if = "Option::is_none")]
    pub clicks: Option<i32>,
    #[serde(rename = "engagement", skip_serializing_if = "Option::is_none")]
    pub engagement: Option<i32>,
    /// Click-through rate as a percentage (0–100).
    #[serde(rename = "ctr", skip_serializing_if = "Option::is_none")]
    pub ctr: Option<f64>,
    /// Cost per click in native currency.
    #[serde(rename = "cpc", skip_serializing_if = "Option::is_none")]
    pub cpc: Option<f64>,
    /// Cost per 1000 impressions in native currency.
    #[serde(rename = "cpm", skip_serializing_if = "Option::is_none")]
    pub cpm: Option<f64>,
    /// Sum of conversion events matching the campaign optimization goal. Meta-only at time of writing.
    #[serde(rename = "conversions", skip_serializing_if = "Option::is_none")]
    pub conversions: Option<i32>,
    #[serde(rename = "costPerConversion", skip_serializing_if = "Option::is_none")]
    pub cost_per_conversion: Option<f64>,
    /// Per-action-type counts merged across all ads on this day. Keys are platform-native action types.
    #[serde(rename = "actions", skip_serializing_if = "Option::is_none")]
    pub actions: Option<std::collections::HashMap<String, f64>>,
    /// Monetary mirror of `actions` in native currency.
    #[serde(rename = "actionValues", skip_serializing_if = "Option::is_none")]
    pub action_values: Option<std::collections::HashMap<String, f64>>,
    /// Sum of purchase-type action values on this day, native currency.
    #[serde(rename = "purchaseValue", skip_serializing_if = "Option::is_none")]
    pub purchase_value: Option<f64>,
    /// Derived purchaseValue / spend.
    #[serde(rename = "roas", skip_serializing_if = "Option::is_none")]
    pub roas: Option<f64>,
}

impl GetAdsTimeline200ResponseRowsInner {
    pub fn new() -> GetAdsTimeline200ResponseRowsInner {
        GetAdsTimeline200ResponseRowsInner {
            date: None,
            spend: None,
            impressions: None,
            reach: None,
            clicks: None,
            engagement: None,
            ctr: None,
            cpc: None,
            cpm: None,
            conversions: None,
            cost_per_conversion: None,
            actions: None,
            action_values: None,
            purchase_value: None,
            roas: None,
        }
    }
}
