/*
* 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.350.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 AdsTimelineResponseRowsInner {
#[serde(rename = "date", skip_serializing_if = "Option::is_none")]
pub date: Option<String>,
/// ISO 4217 currency of every money field in this row (spend, cpc, cpm, costPerConversion, purchaseValue, actionValues). An account whose ad accounts bill in different currencies gets one row per currency for that day, never a sum across currencies. Null when the currency of the ad accounts in this row is unknown. Added 2026-10-23.
#[serde(
rename = "currency",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub currency: Option<Option<String>>,
/// Native currency units (matches /ads/tree convention), in `currency`.
#[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>,
/// Reach summed across the account's ads for this single day. A person seen by two ads the same day counts twice, and reach is de-duplicated per day only: do NOT sum it across days (people reached on multiple days would be double-counted).
#[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 to 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 over the range. Fractional values are normal (attribution splitting + Google modeled conversions). Meta: the ad set Ads Manager Results (see AdMetrics.conversions). Google: tracked conversions. X / LinkedIn: reported website/lead conversions (added 2026-07).
#[serde(rename = "conversions", skip_serializing_if = "Option::is_none")]
pub conversions: Option<f64>,
/// All conversions, including actions excluded from the Conversions column (Google metrics.all_conversions). 0 on platforms without the concept.
#[serde(rename = "allConversions", skip_serializing_if = "Option::is_none")]
pub all_conversions: Option<f64>,
#[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 AdsTimelineResponseRowsInner {
pub fn new() -> AdsTimelineResponseRowsInner {
AdsTimelineResponseRowsInner {
date: None,
currency: None,
spend: None,
impressions: None,
reach: None,
clicks: None,
engagement: None,
ctr: None,
cpc: None,
cpm: None,
conversions: None,
all_conversions: None,
cost_per_conversion: None,
actions: None,
action_values: None,
purchase_value: None,
roas: None,
}
}
}