-
-
Notifications
You must be signed in to change notification settings - Fork 392
/
Campaign.java
346 lines (312 loc) · 7.6 KB
/
Campaign.java
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
/*
* Copyright (c) 2010-2020 Mark Allen, Norbert Bartels.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.restfb.types.ads;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.restfb.Facebook;
import com.restfb.annotation.GraphAPI;
import com.restfb.types.features.HasCreatedTime;
import lombok.Getter;
import lombok.Setter;
/**
* Represents the <a href="https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group">Campaign</a>
* Marketing API type
*/
public class Campaign extends NamedAdsObject implements HasCreatedTime {
/**
* ID of the ad account that owns this campaign
*
* -- GETTER --
*
* @return ID of the ad account that owns this campaign
*/
@Getter
@Setter
@Facebook("account_id")
private String accountId;
/**
* Ad Labels associated with this campaign
*
* -- GETTER --
*
* @return Ad Labels associated with this campaign
*/
@Getter
@Setter
@Facebook("adlabels")
private List<AdLabel> adlabels;
/**
* Bid strategy for this campaign
*/
@Getter
@Setter
@Facebook("bid_strategy")
private String bidStrategy;
/**
* The Boosted Object this campaign has associated, if any
*/
@Getter
@Setter
@Facebook("boosted_object_id")
private String boostedObjectId;
/**
* Automated Brand Lift V2 studies for this ad set.
*/
@Getter
@Setter
@Facebook("brand_lift_studies")
private List<AdStudy> brandLiftStudies = new ArrayList<>();
/**
* Whether to automatically rebalance budgets daily for all the adsets under this campaign.
*/
@Getter
@Setter
@Facebook("budget_rebalance_flag")
private Boolean budgetRebalanceFlag;
/**
* Remaining budget
*/
@Getter
@Setter
@Facebook("budget_remaining")
private String budgetRemaining;
/**
* Buying type, possible values are:
* <ul>
* <li>AUCTION: default</li>
* <li>RESERVED: for reach and frequency ads</li>
* </ul>
*
* -- GETTER --
*
* @return Buying type
*/
@Getter
@Setter
@Facebook("buying_type")
private String buyingType;
/**
* If we can create a new automated brand lift study for the ad set.
*/
@Getter
@Setter
@Facebook("can_create_brand_lift_study")
private Boolean canCreateBrandLiftStudy;
/**
* Whether the campaign can set the spend cap
*
* -- GETTER --
*
* @return Whether the campaign can set the spend cap
*/
@Getter
@Setter
@Facebook("can_use_spend_cap")
private Boolean canUseSpendCap;
/**
* If this status is PAUSED, all its active ad sets and ads will be paused and have an effective status
* CAMPAIGN_PAUSED. Prefer using 'status' instead of this.
*
* possible values: ACTIVE, PAUSED, DELETED, ARCHIVED
*
* -- GETTER --
*
* @return the configured status
*/
@Getter
@Setter
@Facebook("configured_status")
private String configuredStatus;
/**
* Created Time
*
* -- GETTER --
*
* @return Created Time
*/
@Getter(onMethod_ = {@Override})
@Setter
@Facebook("created_time")
private Date createdTime;
/**
* The daily budget of the campaign
*/
@Getter
@Setter
@Facebook("daily_budget")
private String dailyBudget;
/**
* The effective status of this campaign.
*
* possible values: ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO,
* CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED
*
* -- GETTER --
*
* @return The effective status of this campaign
*/
@Getter
@Setter
@Facebook("effective_status")
private String effectiveStatus;
/**
* Issues for this campaign that prevented it from deliverying.
*
* -- GETTER --
*
* @return List of issues for this campaign that prevented it from deliverying.
*/
@Getter(onMethod_ = @GraphAPI(since = "3.2"))
@Setter
@Facebook("issues_info")
@GraphAPI(since = "3.2")
private List<AdCampaignIssuesInfo> issuesInfo = new ArrayList<>();
/**
* Last budget toggling time
*/
@Getter
@Setter
@Facebook("last_budget_toggling_time")
private Date lastBudgetTogglingTime;
/**
* The lifetime budget of the campaign
*/
@Getter
@Setter
@Facebook("lifetime_budget")
private String lifetimeBudget;
/**
* Campaign's objective
*
* -- GETTER --
*
* @return Campaign's objective
*/
@Getter
@Setter
@Facebook
private String objective;
/**
* If there are recommendations for this campaign, this field includes them.
*
* -- GETTER --
*
* @return If there are recommendations for this campaign, this field includes them.
*/
@Getter
@Setter
@Facebook
private List<AdRecommendation> recommendations = new ArrayList<>();
/**
* The source campaign that this campaign is copied from
*/
@Getter
@Setter
@Facebook("source_campaign")
private Campaign sourceCampaign;
/**
* The source campaign id that this campaign is copied from
*/
@Getter
@Setter
@Facebook("source_campaign_id")
private String sourceCampaignId;
/**
* The campaign's Special Ad Category. One of {@code HOUSING}, {@code EMPLOYMENT}, {@code CREDIT}, or {@code NONE}.
*/
@Deprecated
@Getter
@Setter
@GraphAPI(until = "7.0")
@Facebook("special_ad_category")
private String specialAdCategory;
@Getter
@Setter
@GraphAPI(since = "7.0")
@Facebook("special_ad_categories")
private List<String> specialAdCategories = new ArrayList<>();
/**
* A spend cap for the campaign, such that it will not spend more than this cap. Expressed as integer value of the
* subunit in your currency.
*
* -- GETTER --
*
* @return A spend cap for the campaign, such that it will not spend more than this cap.
*/
@Getter
@Setter
@Facebook("spend_cap")
private String spendCap;
/**
* Start Time
*
* -- GETTER --
*
* @return Start Time
*/
@Getter
@Setter
@Facebook("start_time")
private Date startTime;
/**
* If this status is PAUSED, all its active ad sets and ads will be paused and have an effective status
* CAMPAIGN_PAUSED. The field returns the same value as 'configured_status', and is the suggested one to use.
*
* -- GETTER --
*
* @return the status
*/
@Getter
@Setter
@Facebook
private String status;
/**
* Stop Time
*
* -- GETTER --
*
* @return Stop Time
*/
@Getter
@Setter
@Facebook("stop_time")
private Date stopTime;
/**
* Topline ID
*/
@Getter
@Setter
@Facebook("topline_id")
private String toplineId;
/**
* Updated Time
*
* -- GETTER --
*
* @return Updated Time
*/
@Getter
@Setter
@Facebook("updated_time")
private Date updatedTime;
}