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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/*
* 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};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateConversionDestinationRequest {
/// Ad account ID. For LinkedIn: numeric (e.g. \"5123456\") or full `urn:li:sponsoredAccount:{id}` URN. For Google: numeric customer ID (e.g. \"1234567890\") or `customers/{id}` form.
#[serde(rename = "adAccountId")]
pub ad_account_id: String,
#[serde(rename = "name")]
pub name: String,
/// Conversion type. For LinkedIn: a unified standard event name (e.g. \"Purchase\", \"Lead\", \"AddToCart\") or a LinkedIn rule type enum (e.g. \"PURCHASE\", \"QUALIFIED_LEAD\"). For Google: a unified standard event name (Purchase, Subscribe, CompleteRegistration, Lead, Schedule) or a Google ConversionActionCategory enum value directly (e.g. \"PURCHASE\", \"SUBSCRIBE_PAID\", \"SIGNUP\", \"IMPORTED_LEAD\", \"BOOK_APPOINTMENT\"). Unknown values pass through to the platform.
#[serde(rename = "type")]
pub r#type: String,
/// LinkedIn only.
#[serde(rename = "attributionType", skip_serializing_if = "Option::is_none")]
pub attribution_type: Option<AttributionType>,
/// LinkedIn only. Default 30. 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types; the API rejects other combinations locally.
#[serde(
rename = "postClickAttributionWindowSize",
skip_serializing_if = "Option::is_none"
)]
pub post_click_attribution_window_size: Option<PostClickAttributionWindowSize>,
/// LinkedIn only. Default 7. Same 365-day-window type restriction applies as `postClickAttributionWindowSize`.
#[serde(
rename = "viewThroughAttributionWindowSize",
skip_serializing_if = "Option::is_none"
)]
pub view_through_attribution_window_size: Option<ViewThroughAttributionWindowSize>,
/// LinkedIn only. DYNAMIC (default) uses the per-event `value` from `sendConversions`. FIXED uses the rule's `value` field. NO_VALUE drops monetary value entirely.
#[serde(rename = "valueType", skip_serializing_if = "Option::is_none")]
pub value_type: Option<ValueType>,
#[serde(rename = "value", skip_serializing_if = "Option::is_none")]
pub value: Option<Box<models::CreateConversionDestinationRequestValue>>,
/// LinkedIn only. Controls campaign association at rule-creation time: - ALL_CAMPAIGNS: associate the rule with every active, paused, and draft campaign in the ad account - OBJECTIVE_BASED: associate only campaigns whose objective matches the rule's type - NONE: don't auto-associate. Manage associations via the `/associations` endpoints below. Note: auto-association runs once at create time; new campaigns added after the rule still need explicit association.
#[serde(
rename = "autoAssociationType",
skip_serializing_if = "Option::is_none"
)]
pub auto_association_type: Option<AutoAssociationType>,
/// Google Ads only. Whether to count multiple conversions from the same click (MANY_PER_CLICK) or at most one (ONE_PER_CLICK). Defaults to MANY_PER_CLICK if omitted.
#[serde(rename = "countingType", skip_serializing_if = "Option::is_none")]
pub counting_type: Option<CountingType>,
/// Google Ads only. When true, the conversion action is marked as primary and immediately influences Smart Bidding. Defaults to false (secondary, record-only) to avoid unintentionally steering the customer's campaigns on creation.
#[serde(rename = "primaryForGoal", skip_serializing_if = "Option::is_none")]
pub primary_for_goal: Option<bool>,
}
impl CreateConversionDestinationRequest {
pub fn new(
ad_account_id: String,
name: String,
r#type: String,
) -> CreateConversionDestinationRequest {
CreateConversionDestinationRequest {
ad_account_id,
name,
r#type,
attribution_type: None,
post_click_attribution_window_size: None,
view_through_attribution_window_size: None,
value_type: None,
value: None,
auto_association_type: None,
counting_type: None,
primary_for_goal: None,
}
}
}
/// LinkedIn only.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AttributionType {
#[serde(rename = "LAST_TOUCH_BY_CAMPAIGN")]
LastTouchByCampaign,
#[serde(rename = "LAST_TOUCH_BY_CONVERSION")]
LastTouchByConversion,
}
impl Default for AttributionType {
fn default() -> AttributionType {
Self::LastTouchByCampaign
}
}
/// LinkedIn only. Default 30. 365 only allowed for LEAD, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, SUBMIT_APPLICATION rule types; the API rejects other combinations locally.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PostClickAttributionWindowSize {
#[serde(rename = "1")]
Variant1,
#[serde(rename = "7")]
Variant7,
#[serde(rename = "30")]
Variant30,
#[serde(rename = "90")]
Variant90,
#[serde(rename = "365")]
Variant365,
}
impl Default for PostClickAttributionWindowSize {
fn default() -> PostClickAttributionWindowSize {
Self::Variant1
}
}
/// LinkedIn only. Default 7. Same 365-day-window type restriction applies as `postClickAttributionWindowSize`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ViewThroughAttributionWindowSize {
#[serde(rename = "1")]
Variant1,
#[serde(rename = "7")]
Variant7,
#[serde(rename = "30")]
Variant30,
#[serde(rename = "90")]
Variant90,
#[serde(rename = "365")]
Variant365,
}
impl Default for ViewThroughAttributionWindowSize {
fn default() -> ViewThroughAttributionWindowSize {
Self::Variant1
}
}
/// LinkedIn only. DYNAMIC (default) uses the per-event `value` from `sendConversions`. FIXED uses the rule's `value` field. NO_VALUE drops monetary value entirely.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ValueType {
#[serde(rename = "DYNAMIC")]
Dynamic,
#[serde(rename = "FIXED")]
Fixed,
#[serde(rename = "NO_VALUE")]
NoValue,
}
impl Default for ValueType {
fn default() -> ValueType {
Self::Dynamic
}
}
/// LinkedIn only. Controls campaign association at rule-creation time: - ALL_CAMPAIGNS: associate the rule with every active, paused, and draft campaign in the ad account - OBJECTIVE_BASED: associate only campaigns whose objective matches the rule's type - NONE: don't auto-associate. Manage associations via the `/associations` endpoints below. Note: auto-association runs once at create time; new campaigns added after the rule still need explicit association.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AutoAssociationType {
#[serde(rename = "ALL_CAMPAIGNS")]
AllCampaigns,
#[serde(rename = "OBJECTIVE_BASED")]
ObjectiveBased,
#[serde(rename = "NONE")]
None,
}
impl Default for AutoAssociationType {
fn default() -> AutoAssociationType {
Self::AllCampaigns
}
}
/// Google Ads only. Whether to count multiple conversions from the same click (MANY_PER_CLICK) or at most one (ONE_PER_CLICK). Defaults to MANY_PER_CLICK if omitted.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CountingType {
#[serde(rename = "MANY_PER_CLICK")]
ManyPerClick,
#[serde(rename = "ONE_PER_CLICK")]
OnePerClick,
}
impl Default for CountingType {
fn default() -> CountingType {
Self::ManyPerClick
}
}