1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* 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};
/// AdTreeAdSet : Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdTreeAdSet {
#[serde(rename = "platformAdSetId", skip_serializing_if = "Option::is_none")]
pub platform_ad_set_id: Option<String>,
#[serde(rename = "adSetName", skip_serializing_if = "Option::is_none")]
pub ad_set_name: Option<String>,
/// Derived from child ad statuses
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<models::AdStatus>,
#[serde(rename = "adCount", skip_serializing_if = "Option::is_none")]
pub ad_count: Option<i32>,
#[serde(rename = "budget", skip_serializing_if = "Option::is_none")]
pub budget: Option<Box<models::AdTreeAdSetBudget>>,
#[serde(rename = "adSetBudget", skip_serializing_if = "Option::is_none")]
pub ad_set_budget: Option<Box<models::AdTreeAdSetAdSetBudget>>,
#[serde(rename = "metrics", skip_serializing_if = "Option::is_none")]
pub metrics: Option<Box<models::AdMetrics>>,
/// What the delivery system optimizes for. Meta ad set optimization goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION), or on LinkedIn the campaign's effective optimizationTargetType (NONE means manual bidding). See the `optimizationGoal` field on `Ad` for the full value spaces.
#[serde(
rename = "optimizationGoal",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub optimization_goal: Option<Option<String>>,
#[serde(
rename = "bidStrategy",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub bid_strategy: Option<Option<models::BidStrategy>>,
/// Bid amount in whole currency units. On Meta/TikTok populated when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP; on LinkedIn it is the campaign's effective unitCost and pairs with `costType`, where 0 is a real, delivery-stopping value.
#[serde(
rename = "bidAmount",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub bid_amount: Option<Option<f64>>,
/// Minimum ROAS as a decimal multiplier (2.0 = 2.0x). Populated when bidStrategy is LOWEST_COST_WITH_MIN_ROAS.
#[serde(
rename = "roasAverageFloor",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub roas_average_floor: Option<Option<f64>>,
/// LinkedIn only. Effective cost model (billing event) of the LinkedIn campaign backing this ad set: CPM, CPC or CPV. Null for non-LinkedIn ad sets.
#[serde(
rename = "costType",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub cost_type: Option<Option<String>>,
/// LinkedIn only. Why the LinkedIn campaign backing this ad set is (or is not) delivering. A LinkedIn Campaign maps to this ad-set node, so this is the level where LinkedIn's holds actually apply. Empty means no serving data, [\"RUNNABLE\"] means eligible to serve, anything else is a hold. See the `servingStatuses` field on `Ad` for the known values.
#[serde(rename = "servingStatuses", skip_serializing_if = "Option::is_none")]
pub serving_statuses: Option<Vec<String>>,
#[serde(rename = "promotedObject", skip_serializing_if = "Option::is_none")]
pub promoted_object: Option<Box<models::AdTreeAdSetPromotedObject>>,
/// Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent). When `timeIncrement=1&dailyLevel=ad`, each entry also carries a `daily[]` array of `AdDailyMetrics`.
#[serde(rename = "ads", skip_serializing_if = "Option::is_none")]
pub ads: Option<Vec<models::Ad>>,
/// Per-day metric series for this ad set. Present only when `GET /v1/ads/tree` is called with `timeIncrement=1` and `dailyLevel` is `adset` or `ad`.
#[serde(rename = "daily", skip_serializing_if = "Option::is_none")]
pub daily: Option<Vec<models::AdDailyMetrics>>,
}
impl AdTreeAdSet {
/// Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
pub fn new() -> AdTreeAdSet {
AdTreeAdSet {
platform_ad_set_id: None,
ad_set_name: None,
status: None,
ad_count: None,
budget: None,
ad_set_budget: None,
metrics: None,
optimization_goal: None,
bid_strategy: None,
bid_amount: None,
roas_average_floor: None,
cost_type: None,
serving_statuses: None,
promoted_object: None,
ads: None,
daily: None,
}
}
}