1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. |
4
|
|
|
* |
5
|
|
|
* You are hereby granted a non-exclusive, worldwide, royalty-free license to |
6
|
|
|
* use, copy, modify, and distribute this software in source code or binary |
7
|
|
|
* form for use in connection with the web services and APIs provided by |
8
|
|
|
* Facebook. |
9
|
|
|
* |
10
|
|
|
* As with any software that integrates with the Facebook platform, your use |
11
|
|
|
* of this software is subject to the Facebook Developer Principles and |
12
|
|
|
* Policies [http://developers.facebook.com/policy/]. This copyright notice |
13
|
|
|
* shall be included in all copies or substantial portions of the software. |
14
|
|
|
* |
15
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
20
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21
|
|
|
* DEALINGS IN THE SOFTWARE. |
22
|
|
|
* |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
namespace FacebookAds\Object; |
26
|
|
|
|
27
|
|
|
use FacebookAds\ApiRequest; |
28
|
|
|
use FacebookAds\Cursor; |
29
|
|
|
use FacebookAds\Http\RequestInterface; |
30
|
|
|
use FacebookAds\TypeChecker; |
31
|
|
|
use FacebookAds\Object\Fields\AdSetFields; |
32
|
|
|
use FacebookAds\Object\Values\AdActivityCategoryValues; |
33
|
|
|
use FacebookAds\Object\Values\AdAsyncRequestStatusesValues; |
34
|
|
|
use FacebookAds\Object\Values\AdDatePresetValues; |
35
|
|
|
use FacebookAds\Object\Values\AdLabelExecutionOptionsValues; |
36
|
|
|
use FacebookAds\Object\Values\AdSetBillingEventValues; |
37
|
|
|
use FacebookAds\Object\Values\AdSetConfiguredStatusValues; |
38
|
|
|
use FacebookAds\Object\Values\AdSetDatePresetValues; |
39
|
|
|
use FacebookAds\Object\Values\AdSetEffectiveStatusValues; |
40
|
|
|
use FacebookAds\Object\Values\AdSetExecutionOptionsValues; |
41
|
|
|
use FacebookAds\Object\Values\AdSetOperatorValues; |
42
|
|
|
use FacebookAds\Object\Values\AdSetOptimizationGoalValues; |
43
|
|
|
use FacebookAds\Object\Values\AdSetStatusValues; |
44
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionAttributionWindowsValues; |
45
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionBreakdownsValues; |
46
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionReportTimeValues; |
47
|
|
|
use FacebookAds\Object\Values\AdsInsightsBreakdownsValues; |
48
|
|
|
use FacebookAds\Object\Values\AdsInsightsDatePresetValues; |
49
|
|
|
use FacebookAds\Object\Values\AdsInsightsLevelValues; |
50
|
|
|
use FacebookAds\Object\Values\AdsInsightsSummaryActionBreakdownsValues; |
51
|
|
|
use FacebookAds\Object\Values\AdsInsightsSummaryValues; |
52
|
|
|
use FacebookAds\Object\Traits\AdLabelAwareCrudObjectTrait; |
53
|
|
|
use FacebookAds\Object\Traits\ObjectValidation; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* This class is auto-genereated. |
57
|
|
|
* |
58
|
|
|
* For any issues or feature requests related to this class, please let us know |
59
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
60
|
|
|
* pull request for this class. |
61
|
|
|
* |
62
|
|
|
*/ |
63
|
|
|
|
64
|
|
|
class AdSet extends AbstractArchivableCrudObject |
|
|
|
|
65
|
|
|
implements CanRedownloadInterface { |
|
|
|
|
66
|
|
|
|
67
|
|
|
use AdLabelAwareCrudObjectTrait; |
68
|
|
|
use ObjectValidation; |
69
|
|
|
|
70
|
|
|
protected function getEndpoint() { |
71
|
|
|
return 'adsets'; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return AdSetFields |
76
|
|
|
*/ |
77
|
|
|
public static function getFieldsEnum() { |
78
|
|
|
return AdSetFields::getInstance(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
protected static function getReferencedEnums() { |
82
|
|
|
$ref_enums = array(); |
83
|
|
|
$ref_enums['BillingEvent'] = AdSetBillingEventValues::getInstance()->getValues(); |
84
|
|
|
$ref_enums['ConfiguredStatus'] = AdSetConfiguredStatusValues::getInstance()->getValues(); |
85
|
|
|
$ref_enums['EffectiveStatus'] = AdSetEffectiveStatusValues::getInstance()->getValues(); |
86
|
|
|
$ref_enums['OptimizationGoal'] = AdSetOptimizationGoalValues::getInstance()->getValues(); |
87
|
|
|
$ref_enums['Status'] = AdSetStatusValues::getInstance()->getValues(); |
88
|
|
|
$ref_enums['DatePreset'] = AdSetDatePresetValues::getInstance()->getValues(); |
89
|
|
|
$ref_enums['ExecutionOptions'] = AdSetExecutionOptionsValues::getInstance()->getValues(); |
90
|
|
|
$ref_enums['Operator'] = AdSetOperatorValues::getInstance()->getValues(); |
91
|
|
|
return $ref_enums; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
|
95
|
|
|
public function getActivities(array $fields = array(), array $params = array(), $pending = false) { |
96
|
|
|
$this->assureId(); |
97
|
|
|
|
98
|
|
|
$param_types = array( |
99
|
|
|
'business_id' => 'string', |
100
|
|
|
'category' => 'category_enum', |
101
|
|
|
'since' => 'datetime', |
102
|
|
|
'uid' => 'int', |
103
|
|
|
'until' => 'datetime', |
104
|
|
|
); |
105
|
|
|
$enums = array( |
106
|
|
|
'category_enum' => AdActivityCategoryValues::getInstance()->getValues(), |
107
|
|
|
); |
108
|
|
|
|
109
|
|
|
$request = new ApiRequest( |
110
|
|
|
$this->api, |
111
|
|
|
$this->data['id'], |
112
|
|
|
RequestInterface::METHOD_GET, |
113
|
|
|
'/activities', |
114
|
|
|
new AdActivity(), |
115
|
|
|
'EDGE', |
116
|
|
|
AdActivity::getFieldsEnum()->getValues(), |
117
|
|
|
new TypeChecker($param_types, $enums) |
118
|
|
|
); |
119
|
|
|
$request->addParams($params); |
120
|
|
|
$request->addFields($fields); |
121
|
|
|
return $pending ? $request : $request->execute(); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) { |
125
|
|
|
$this->assureId(); |
126
|
|
|
|
127
|
|
|
$param_types = array( |
128
|
|
|
); |
129
|
|
|
$enums = array( |
130
|
|
|
); |
131
|
|
|
|
132
|
|
|
$request = new ApiRequest( |
133
|
|
|
$this->api, |
134
|
|
|
$this->data['id'], |
135
|
|
|
RequestInterface::METHOD_GET, |
136
|
|
|
'/adcreatives', |
137
|
|
|
new AdCreative(), |
138
|
|
|
'EDGE', |
139
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
140
|
|
|
new TypeChecker($param_types, $enums) |
141
|
|
|
); |
142
|
|
|
$request->addParams($params); |
143
|
|
|
$request->addFields($fields); |
144
|
|
|
return $pending ? $request : $request->execute(); |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
public function deleteAdLabels(array $fields = array(), array $params = array(), $pending = false) { |
148
|
|
|
$this->assureId(); |
149
|
|
|
|
150
|
|
|
$param_types = array( |
151
|
|
|
'adlabels' => 'list<Object>', |
152
|
|
|
'execution_options' => 'list<execution_options_enum>', |
153
|
|
|
); |
154
|
|
|
$enums = array( |
155
|
|
|
'execution_options_enum' => AdLabelExecutionOptionsValues::getInstance()->getValues(), |
156
|
|
|
); |
157
|
|
|
|
158
|
|
|
$request = new ApiRequest( |
159
|
|
|
$this->api, |
160
|
|
|
$this->data['id'], |
161
|
|
|
RequestInterface::METHOD_DELETE, |
162
|
|
|
'/adlabels', |
163
|
|
|
new AbstractCrudObject(), |
164
|
|
|
'EDGE', |
165
|
|
|
array(), |
166
|
|
|
new TypeChecker($param_types, $enums) |
167
|
|
|
); |
168
|
|
|
$request->addParams($params); |
169
|
|
|
$request->addFields($fields); |
170
|
|
|
return $pending ? $request : $request->execute(); |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) { |
174
|
|
|
$this->assureId(); |
175
|
|
|
|
176
|
|
|
$param_types = array( |
177
|
|
|
'adlabels' => 'list<Object>', |
178
|
|
|
'execution_options' => 'list<execution_options_enum>', |
179
|
|
|
); |
180
|
|
|
$enums = array( |
181
|
|
|
'execution_options_enum' => AdLabelExecutionOptionsValues::getInstance()->getValues(), |
182
|
|
|
); |
183
|
|
|
|
184
|
|
|
$request = new ApiRequest( |
185
|
|
|
$this->api, |
186
|
|
|
$this->data['id'], |
187
|
|
|
RequestInterface::METHOD_POST, |
188
|
|
|
'/adlabels', |
189
|
|
|
new AdLabel(), |
190
|
|
|
'EDGE', |
191
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
192
|
|
|
new TypeChecker($param_types, $enums) |
193
|
|
|
); |
194
|
|
|
$request->addParams($params); |
195
|
|
|
$request->addFields($fields); |
196
|
|
|
return $pending ? $request : $request->execute(); |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
public function getAds(array $fields = array(), array $params = array(), $pending = false) { |
200
|
|
|
$this->assureId(); |
201
|
|
|
|
202
|
|
|
$param_types = array( |
203
|
|
|
'ad_draft_id' => 'string', |
204
|
|
|
'date_preset' => 'date_preset_enum', |
205
|
|
|
'effective_status' => 'list<string>', |
206
|
|
|
'include_deleted' => 'bool', |
207
|
|
|
'time_range' => 'map', |
208
|
|
|
'updated_since' => 'int', |
209
|
|
|
); |
210
|
|
|
$enums = array( |
211
|
|
|
'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(), |
212
|
|
|
); |
213
|
|
|
|
214
|
|
|
$request = new ApiRequest( |
215
|
|
|
$this->api, |
216
|
|
|
$this->data['id'], |
217
|
|
|
RequestInterface::METHOD_GET, |
218
|
|
|
'/ads', |
219
|
|
|
new Ad(), |
220
|
|
|
'EDGE', |
221
|
|
|
Ad::getFieldsEnum()->getValues(), |
222
|
|
|
new TypeChecker($param_types, $enums) |
223
|
|
|
); |
224
|
|
|
$request->addParams($params); |
225
|
|
|
$request->addFields($fields); |
226
|
|
|
return $pending ? $request : $request->execute(); |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
public function getAsyncAdRequests(array $fields = array(), array $params = array(), $pending = false) { |
230
|
|
|
$this->assureId(); |
231
|
|
|
|
232
|
|
|
$param_types = array( |
233
|
|
|
'statuses' => 'list<statuses_enum>', |
234
|
|
|
); |
235
|
|
|
$enums = array( |
236
|
|
|
'statuses_enum' => AdAsyncRequestStatusesValues::getInstance()->getValues(), |
237
|
|
|
); |
238
|
|
|
|
239
|
|
|
$request = new ApiRequest( |
240
|
|
|
$this->api, |
241
|
|
|
$this->data['id'], |
242
|
|
|
RequestInterface::METHOD_GET, |
243
|
|
|
'/asyncadrequests', |
244
|
|
|
new AdAsyncRequest(), |
245
|
|
|
'EDGE', |
246
|
|
|
AdAsyncRequest::getFieldsEnum()->getValues(), |
247
|
|
|
new TypeChecker($param_types, $enums) |
248
|
|
|
); |
249
|
|
|
$request->addParams($params); |
250
|
|
|
$request->addFields($fields); |
251
|
|
|
return $pending ? $request : $request->execute(); |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
public function getInsights(array $fields = array(), array $params = array(), $pending = false) { |
255
|
|
|
$this->assureId(); |
256
|
|
|
|
257
|
|
|
$param_types = array( |
258
|
|
|
'action_attribution_windows' => 'list<action_attribution_windows_enum>', |
259
|
|
|
'action_breakdowns' => 'list<action_breakdowns_enum>', |
260
|
|
|
'action_report_time' => 'action_report_time_enum', |
261
|
|
|
'breakdowns' => 'list<breakdowns_enum>', |
262
|
|
|
'date_preset' => 'date_preset_enum', |
263
|
|
|
'default_summary' => 'bool', |
264
|
|
|
'fields' => 'list<fields_enum>', |
265
|
|
|
'filtering' => 'list<Object>', |
266
|
|
|
'level' => 'level_enum', |
267
|
|
|
'product_id_limit' => 'int', |
268
|
|
|
'sort' => 'list<string>', |
269
|
|
|
'summary' => 'list<summary_enum>', |
270
|
|
|
'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>', |
271
|
|
|
'time_increment' => 'string', |
272
|
|
|
'time_range' => 'map', |
273
|
|
|
'time_ranges' => 'list<map>', |
274
|
|
|
); |
275
|
|
|
$enums = array( |
276
|
|
|
'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(), |
277
|
|
|
'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(), |
278
|
|
|
'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(), |
279
|
|
|
'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(), |
280
|
|
|
'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(), |
281
|
|
|
'summary_enum' => AdsInsightsSummaryValues::getInstance()->getValues(), |
282
|
|
|
'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(), |
283
|
|
|
'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(), |
284
|
|
|
); |
285
|
|
|
|
286
|
|
|
$request = new ApiRequest( |
287
|
|
|
$this->api, |
288
|
|
|
$this->data['id'], |
289
|
|
|
RequestInterface::METHOD_GET, |
290
|
|
|
'/insights', |
291
|
|
|
new AdsInsights(), |
292
|
|
|
'EDGE', |
293
|
|
|
AdsInsights::getFieldsEnum()->getValues(), |
294
|
|
|
new TypeChecker($param_types, $enums) |
295
|
|
|
); |
296
|
|
|
$request->addParams($params); |
297
|
|
|
$request->addFields($fields); |
298
|
|
|
return $pending ? $request : $request->execute(); |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
public function getInsightsAsync(array $fields = array(), array $params = array(), $pending = false) { |
302
|
|
|
$this->assureId(); |
303
|
|
|
|
304
|
|
|
$param_types = array( |
305
|
|
|
'action_attribution_windows' => 'list<action_attribution_windows_enum>', |
306
|
|
|
'action_breakdowns' => 'list<action_breakdowns_enum>', |
307
|
|
|
'action_report_time' => 'action_report_time_enum', |
308
|
|
|
'breakdowns' => 'list<breakdowns_enum>', |
309
|
|
|
'date_preset' => 'date_preset_enum', |
310
|
|
|
'default_summary' => 'bool', |
311
|
|
|
'fields' => 'list<fields_enum>', |
312
|
|
|
'filtering' => 'list<Object>', |
313
|
|
|
'level' => 'level_enum', |
314
|
|
|
'product_id_limit' => 'int', |
315
|
|
|
'sort' => 'list<string>', |
316
|
|
|
'summary' => 'list<summary_enum>', |
317
|
|
|
'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>', |
318
|
|
|
'time_increment' => 'string', |
319
|
|
|
'time_range' => 'map', |
320
|
|
|
'time_ranges' => 'list<map>', |
321
|
|
|
); |
322
|
|
|
$enums = array( |
323
|
|
|
'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(), |
324
|
|
|
'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(), |
325
|
|
|
'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(), |
326
|
|
|
'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(), |
327
|
|
|
'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(), |
328
|
|
|
'summary_enum' => AdsInsightsSummaryValues::getInstance()->getValues(), |
329
|
|
|
'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(), |
330
|
|
|
'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(), |
331
|
|
|
); |
332
|
|
|
|
333
|
|
|
$request = new ApiRequest( |
334
|
|
|
$this->api, |
335
|
|
|
$this->data['id'], |
336
|
|
|
RequestInterface::METHOD_POST, |
337
|
|
|
'/insights', |
338
|
|
|
new AdReportRun(), |
339
|
|
|
'EDGE', |
340
|
|
|
AdReportRun::getFieldsEnum()->getValues(), |
341
|
|
|
new TypeChecker($param_types, $enums) |
342
|
|
|
); |
343
|
|
|
$request->addParams($params); |
344
|
|
|
$request->addFields($fields); |
345
|
|
|
return $pending ? $request : $request->execute(); |
346
|
|
|
} |
347
|
|
|
|
348
|
|
|
public function getTargetingSentenceLines(array $fields = array(), array $params = array(), $pending = false) { |
349
|
|
|
$this->assureId(); |
350
|
|
|
|
351
|
|
|
$param_types = array( |
352
|
|
|
); |
353
|
|
|
$enums = array( |
354
|
|
|
); |
355
|
|
|
|
356
|
|
|
$request = new ApiRequest( |
357
|
|
|
$this->api, |
358
|
|
|
$this->data['id'], |
359
|
|
|
RequestInterface::METHOD_GET, |
360
|
|
|
'/targetingsentencelines', |
361
|
|
|
new TargetingSentenceLine(), |
362
|
|
|
'EDGE', |
363
|
|
|
TargetingSentenceLine::getFieldsEnum()->getValues(), |
364
|
|
|
new TypeChecker($param_types, $enums) |
365
|
|
|
); |
366
|
|
|
$request->addParams($params); |
367
|
|
|
$request->addFields($fields); |
368
|
|
|
return $pending ? $request : $request->execute(); |
369
|
|
|
} |
370
|
|
|
|
371
|
|
|
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) { |
372
|
|
|
$this->assureId(); |
373
|
|
|
|
374
|
|
|
$param_types = array( |
375
|
|
|
'account_id' => 'string', |
376
|
|
|
); |
377
|
|
|
$enums = array( |
378
|
|
|
); |
379
|
|
|
|
380
|
|
|
$request = new ApiRequest( |
381
|
|
|
$this->api, |
382
|
|
|
$this->data['id'], |
383
|
|
|
RequestInterface::METHOD_DELETE, |
384
|
|
|
'/', |
385
|
|
|
new AbstractCrudObject(), |
386
|
|
|
'NODE', |
387
|
|
|
array(), |
388
|
|
|
new TypeChecker($param_types, $enums) |
389
|
|
|
); |
390
|
|
|
$request->addParams($params); |
391
|
|
|
$request->addFields($fields); |
392
|
|
|
return $pending ? $request : $request->execute(); |
393
|
|
|
} |
394
|
|
|
|
395
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
396
|
|
|
$this->assureId(); |
397
|
|
|
|
398
|
|
|
$param_types = array( |
399
|
|
|
); |
400
|
|
|
$enums = array( |
401
|
|
|
); |
402
|
|
|
|
403
|
|
|
$request = new ApiRequest( |
404
|
|
|
$this->api, |
405
|
|
|
$this->data['id'], |
406
|
|
|
RequestInterface::METHOD_GET, |
407
|
|
|
'/', |
408
|
|
|
new AdSet(), |
409
|
|
|
'NODE', |
410
|
|
|
AdSet::getFieldsEnum()->getValues(), |
411
|
|
|
new TypeChecker($param_types, $enums) |
412
|
|
|
); |
413
|
|
|
$request->addParams($params); |
414
|
|
|
$request->addFields($fields); |
415
|
|
|
return $pending ? $request : $request->execute(); |
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) { |
419
|
|
|
$this->assureId(); |
420
|
|
|
|
421
|
|
|
$param_types = array( |
422
|
|
|
'account_id' => 'string', |
423
|
|
|
'adlabels' => 'list<Object>', |
424
|
|
|
'adset_schedule' => 'list<Object>', |
425
|
|
|
'attribution_window_days' => 'unsigned int', |
426
|
|
|
'bid_amount' => 'int', |
427
|
|
|
'billing_event' => 'billing_event_enum', |
428
|
|
|
'creative_sequence' => 'list<string>', |
429
|
|
|
'daily_budget' => 'unsigned int', |
430
|
|
|
'daily_imps' => 'unsigned int', |
431
|
|
|
'end_time' => 'datetime', |
432
|
|
|
'execution_options' => 'list<execution_options_enum>', |
433
|
|
|
'is_autobid' => 'bool', |
434
|
|
|
'lifetime_budget' => 'unsigned int', |
435
|
|
|
'lifetime_imps' => 'unsigned int', |
436
|
|
|
'name' => 'string', |
437
|
|
|
'optimization_goal' => 'optimization_goal_enum', |
438
|
|
|
'pacing_type' => 'list<string>', |
439
|
|
|
'promoted_object' => 'Object', |
440
|
|
|
'redownload' => 'bool', |
441
|
|
|
'rf_prediction_id' => 'string', |
442
|
|
|
'start_time' => 'datetime', |
443
|
|
|
'status' => 'status_enum', |
444
|
|
|
'targeting' => 'Targeting', |
445
|
|
|
'time_based_ad_rotation_id_blocks' => 'list<list<unsigned int>>', |
446
|
|
|
'time_based_ad_rotation_intervals' => 'list<unsigned int>', |
447
|
|
|
); |
448
|
|
|
$enums = array( |
449
|
|
|
'billing_event_enum' => AdSetBillingEventValues::getInstance()->getValues(), |
450
|
|
|
'execution_options_enum' => AdSetExecutionOptionsValues::getInstance()->getValues(), |
451
|
|
|
'optimization_goal_enum' => AdSetOptimizationGoalValues::getInstance()->getValues(), |
452
|
|
|
'status_enum' => AdSetStatusValues::getInstance()->getValues(), |
453
|
|
|
); |
454
|
|
|
|
455
|
|
|
$request = new ApiRequest( |
456
|
|
|
$this->api, |
457
|
|
|
$this->data['id'], |
458
|
|
|
RequestInterface::METHOD_POST, |
459
|
|
|
'/', |
460
|
|
|
new AdSet(), |
461
|
|
|
'NODE', |
462
|
|
|
AdSet::getFieldsEnum()->getValues(), |
463
|
|
|
new TypeChecker($param_types, $enums) |
464
|
|
|
); |
465
|
|
|
$request->addParams($params); |
466
|
|
|
$request->addFields($fields); |
467
|
|
|
return $pending ? $request : $request->execute(); |
468
|
|
|
} |
469
|
|
|
|
470
|
|
|
} |
471
|
|
|
|