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
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
* 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};
/// TrackingTag : A platform measurement tag — the thing you create, install on a website, send events to, and target ads against. On Meta this is a Pixel (`kind: pixel`). The shape is platform-neutral so other platforms (Pinterest Tag, LinkedIn Insight Tag, etc.) can be added without changing the contract; platform-specific fields are simply absent where a platform has no equivalent. Returned by `listTrackingTags`, `createTrackingTag`, `getTrackingTag`, and `updateTrackingTag`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TrackingTag {
/// Platform-native tag id. Meta: numeric pixel id, as a string.
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "platform")]
pub platform: Platform,
/// Platform-native flavor of the tag (Meta: `pixel`).
#[serde(rename = "kind")]
pub kind: Kind,
/// `inactive` when the platform reports the tag as broken/unavailable.
#[serde(rename = "status")]
pub status: Status,
/// The base-code `<script>` snippet to install on the site. Meta only; populated by `getTrackingTag`, omitted from the list view.
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
/// Unix seconds of the last event the tag received, or `null` if it never fired. The practical \"is it installed and working\" signal.
#[serde(rename = "lastFiredTime", skip_serializing_if = "Option::is_none")]
pub last_fired_time: Option<i32>,
/// Whether the tag is in a broken/unavailable state (Meta `is_unavailable`).
#[serde(rename = "isUnavailable", skip_serializing_if = "Option::is_none")]
pub is_unavailable: Option<bool>,
/// Convenience flag derived from `lastFiredTime` — has the tag ever fired.
#[serde(rename = "installed", skip_serializing_if = "Option::is_none")]
pub installed: Option<bool>,
/// Unix seconds the tag was created.
#[serde(rename = "creationTime", skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i32>,
/// Business Manager id that owns the tag, or `null` when the tag lives on a personal (non-BM) ad account — such tags can't be shared with other ad accounts.
#[serde(rename = "ownerBusinessId", skip_serializing_if = "Option::is_none")]
pub owner_business_id: Option<String>,
/// Ad account id (`act_...`) that owns the tag, when reported.
#[serde(rename = "ownerAdAccountId", skip_serializing_if = "Option::is_none")]
pub owner_ad_account_id: Option<String>,
}
impl TrackingTag {
/// A platform measurement tag — the thing you create, install on a website, send events to, and target ads against. On Meta this is a Pixel (`kind: pixel`). The shape is platform-neutral so other platforms (Pinterest Tag, LinkedIn Insight Tag, etc.) can be added without changing the contract; platform-specific fields are simply absent where a platform has no equivalent. Returned by `listTrackingTags`, `createTrackingTag`, `getTrackingTag`, and `updateTrackingTag`.
pub fn new(
id: String,
name: String,
platform: Platform,
kind: Kind,
status: Status,
) -> TrackingTag {
TrackingTag {
id,
name,
platform,
kind,
status,
code: None,
last_fired_time: None,
is_unavailable: None,
installed: None,
creation_time: None,
owner_business_id: None,
owner_ad_account_id: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "metaads")]
Metaads,
}
impl Default for Platform {
fn default() -> Platform {
Self::Metaads
}
}
/// Platform-native flavor of the tag (Meta: `pixel`).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
#[serde(rename = "pixel")]
Pixel,
#[serde(rename = "tag")]
Tag,
#[serde(rename = "insight_tag")]
InsightTag,
}
impl Default for Kind {
fn default() -> Kind {
Self::Pixel
}
}
/// `inactive` when the platform reports the tag as broken/unavailable.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "active")]
Active,
#[serde(rename = "inactive")]
Inactive,
}
impl Default for Status {
fn default() -> Status {
Self::Active
}
}