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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
* 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};
/// UploadedOrDerivedAudience : customer_list, website, or lookalike audience (uploaded or derived from a source).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UploadedOrDerivedAudience {
#[serde(rename = "accountId")]
pub account_id: String,
/// Platform ad account ID. Must start with act_ for Meta; bare platform id for others (Google customer id, X/TikTok/LinkedIn/Pinterest account id).
#[serde(rename = "adAccountId")]
pub ad_account_id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "type")]
pub r#type: Type,
/// Required for website_retargeting audiences (LinkedIn only). Each rule is a URL pattern; a member who visits any matching page enters the segment. Needs the LinkedIn Insight Tag installed on the customer's site — the segment only starts filling once the tag reports visits. The response's `platformAudienceId` is the LinkedIn adSegment id, valid for downstream use. These segments appear in GET /v1/ads/audiences with `type: website_retargeting` once LinkedIn has finished building them.
#[serde(rename = "matchRules", skip_serializing_if = "Option::is_none")]
pub match_rules: Option<Vec<models::UploadedOrDerivedAudienceMatchRulesInner>>,
/// Required for engagement audiences (LinkedIn only): what members engaged with — a video/leadgen/single-image ad campaign, a Company Page or an Event page.
#[serde(rename = "sourceType", skip_serializing_if = "Option::is_none")]
pub source_type: Option<SourceType>,
/// Required for engagement audiences. The action, validated by LinkedIn against `sourceType`. Common values: VIDEO_ADS FIRST_QUARTILE / MIDPOINT / THIRD_QUARTILE / FULL_COMPLETE; LEAD_GEN_FORMS VIEW_FORM / LEAD_FORM_SUBMIT; ORGANIZATION_PAGES VIEW / CTA_CLICK; EVENT_PAGES RSVPED / VIDEO_VIEWED / ENGAGEMENT / CLICK.
#[serde(rename = "trigger", skip_serializing_if = "Option::is_none")]
pub trigger: Option<String>,
/// Required for engagement audiences. Rolling window.
#[serde(rename = "lookbackDays", skip_serializing_if = "Option::is_none")]
pub lookback_days: Option<LookbackDays>,
/// Required for engagement audiences. Campaign URNs for the ad source types, organization URNs for pages and events. LinkedIn creates one rule per source, all sharing the same trigger and lookbackDays.
#[serde(rename = "engagementSources", skip_serializing_if = "Option::is_none")]
pub engagement_sources: Option<Vec<String>>,
/// Required for company_list audiences (LinkedIn only): plain-text company rows for account targeting. Each row needs at least one identifier. LinkedIn recommends 1,000+ companies for a usable match rate and takes up to 48h to process the list.
#[serde(rename = "companies", skip_serializing_if = "Option::is_none")]
pub companies: Option<Vec<models::UploadedOrDerivedAudienceCompaniesInner>>,
/// Required for website audiences
#[serde(rename = "pixelId", skip_serializing_if = "Option::is_none")]
pub pixel_id: Option<String>,
/// Required for website audiences
#[serde(rename = "retentionDays", skip_serializing_if = "Option::is_none")]
pub retention_days: Option<i32>,
/// Required for lookalike audiences
#[serde(rename = "sourceAudienceId", skip_serializing_if = "Option::is_none")]
pub source_audience_id: Option<String>,
/// 2-letter code, required for lookalike audiences
#[serde(rename = "country", skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
/// Required for lookalike audiences
#[serde(rename = "ratio", skip_serializing_if = "Option::is_none")]
pub ratio: Option<f64>,
/// Pixel event rule for website audiences (optional)
#[serde(rename = "rule", skip_serializing_if = "Option::is_none")]
pub rule: Option<serde_json::Value>,
/// Data source declaration for GDPR compliance (customer_list only)
#[serde(rename = "customerFileSource", skip_serializing_if = "Option::is_none")]
pub customer_file_source: Option<String>,
}
impl UploadedOrDerivedAudience {
/// customer_list, website, or lookalike audience (uploaded or derived from a source).
pub fn new(
account_id: String,
ad_account_id: String,
name: String,
r#type: Type,
) -> UploadedOrDerivedAudience {
UploadedOrDerivedAudience {
account_id,
ad_account_id,
name,
description: None,
r#type,
match_rules: None,
source_type: None,
trigger: None,
lookback_days: None,
engagement_sources: None,
companies: None,
pixel_id: None,
retention_days: None,
source_audience_id: None,
country: None,
ratio: None,
rule: None,
customer_file_source: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "customer_list")]
CustomerList,
#[serde(rename = "company_list")]
CompanyList,
#[serde(rename = "engagement")]
Engagement,
#[serde(rename = "website")]
Website,
#[serde(rename = "website_retargeting")]
WebsiteRetargeting,
#[serde(rename = "lookalike")]
Lookalike,
}
impl Default for Type {
fn default() -> Type {
Self::CustomerList
}
}
/// Required for engagement audiences (LinkedIn only): what members engaged with — a video/leadgen/single-image ad campaign, a Company Page or an Event page.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SourceType {
#[serde(rename = "VIDEO_ADS")]
VideoAds,
#[serde(rename = "LEAD_GEN_FORMS")]
LeadGenForms,
#[serde(rename = "ORGANIZATION_PAGES")]
OrganizationPages,
#[serde(rename = "EVENT_PAGES")]
EventPages,
#[serde(rename = "SINGLE_IMAGE_ADS")]
SingleImageAds,
}
impl Default for SourceType {
fn default() -> SourceType {
Self::VideoAds
}
}
/// Required for engagement audiences. Rolling window.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LookbackDays {
#[serde(rename = "30")]
Variant30,
#[serde(rename = "60")]
Variant60,
#[serde(rename = "90")]
Variant90,
#[serde(rename = "180")]
Variant180,
#[serde(rename = "365")]
Variant365,
}
impl Default for LookbackDays {
fn default() -> LookbackDays {
Self::Variant30
}
}