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\AdAccountFields; |
32
|
|
|
use FacebookAds\Object\Values\AdAccountAccessTypeValues; |
33
|
|
|
use FacebookAds\Object\Values\AdAccountPermittedRolesValues; |
34
|
|
|
use FacebookAds\Object\Values\AdAccountRoasFieldsValues; |
35
|
|
|
use FacebookAds\Object\Values\AdAccountTargetingUnifiedLimitTypeValues; |
36
|
|
|
use FacebookAds\Object\Values\AdActivityCategoryValues; |
37
|
|
|
use FacebookAds\Object\Values\AdCreativeApplinkTreatmentValues; |
38
|
|
|
use FacebookAds\Object\Values\AdCreativeDynamicAdVoiceValues; |
39
|
|
|
use FacebookAds\Object\Values\AdCreativeOperatorValues; |
40
|
|
|
use FacebookAds\Object\Values\AdDatePresetValues; |
41
|
|
|
use FacebookAds\Object\Values\AdExecutionOptionsValues; |
42
|
|
|
use FacebookAds\Object\Values\AdOperatorValues; |
43
|
|
|
use FacebookAds\Object\Values\AdPreviewAdFormatValues; |
44
|
|
|
use FacebookAds\Object\Values\AdSetBillingEventValues; |
45
|
|
|
use FacebookAds\Object\Values\AdSetDatePresetValues; |
46
|
|
|
use FacebookAds\Object\Values\AdSetEffectiveStatusValues; |
47
|
|
|
use FacebookAds\Object\Values\AdSetExecutionOptionsValues; |
48
|
|
|
use FacebookAds\Object\Values\AdSetOperatorValues; |
49
|
|
|
use FacebookAds\Object\Values\AdSetOptimizationGoalValues; |
50
|
|
|
use FacebookAds\Object\Values\AdSetStatusValues; |
51
|
|
|
use FacebookAds\Object\Values\AdStatusValues; |
52
|
|
|
use FacebookAds\Object\Values\AdVideoUnpublishedContentTypeValues; |
53
|
|
|
use FacebookAds\Object\Values\AdVideoUploadPhaseValues; |
54
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionAttributionWindowsValues; |
55
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionBreakdownsValues; |
56
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionReportTimeValues; |
57
|
|
|
use FacebookAds\Object\Values\AdsInsightsBreakdownsValues; |
58
|
|
|
use FacebookAds\Object\Values\AdsInsightsDatePresetValues; |
59
|
|
|
use FacebookAds\Object\Values\AdsInsightsLevelValues; |
60
|
|
|
use FacebookAds\Object\Values\AdsInsightsSummaryActionBreakdownsValues; |
61
|
|
|
use FacebookAds\Object\Values\AdsInsightsSummaryValues; |
62
|
|
|
use FacebookAds\Object\Values\CampaignDatePresetValues; |
63
|
|
|
use FacebookAds\Object\Values\CampaignDeleteStrategyValues; |
64
|
|
|
use FacebookAds\Object\Values\CampaignEffectiveStatusValues; |
65
|
|
|
use FacebookAds\Object\Values\CampaignExecutionOptionsValues; |
66
|
|
|
use FacebookAds\Object\Values\CampaignObjectiveValues; |
67
|
|
|
use FacebookAds\Object\Values\CampaignOperatorValues; |
68
|
|
|
use FacebookAds\Object\Values\CampaignStatusValues; |
69
|
|
|
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues; |
70
|
|
|
use FacebookAds\Object\Values\CustomAudienceContentTypeValues; |
71
|
|
|
use FacebookAds\Object\Values\CustomAudienceFieldsValues; |
72
|
|
|
use FacebookAds\Object\Values\CustomAudienceSubtypeValues; |
73
|
|
|
use FacebookAds\Object\Values\CustomConversionCustomEventTypeValues; |
74
|
|
|
use FacebookAds\Object\Values\OffsitePixelTagValues; |
75
|
|
|
use FacebookAds\Object\Values\ReachEstimateOptimizeForValues; |
76
|
|
|
use FacebookAds\Object\Values\undefinedNotificationModeValues; |
77
|
|
|
use FacebookAds\Object\Values\undefinedSubtypeValues; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* This class is auto-genereated. |
81
|
|
|
* |
82
|
|
|
* For any issues or feature requests related to this class, please let us know |
83
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
84
|
|
|
* pull request for this class. |
85
|
|
|
* |
86
|
|
|
*/ |
87
|
|
|
|
88
|
|
|
class AdAccount extends AbstractCrudObject { |
89
|
|
|
|
90
|
|
|
protected function getEndpoint() { |
91
|
|
|
return 'adaccounts'; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return AdAccountFields |
96
|
|
|
*/ |
97
|
|
|
public static function getFieldsEnum() { |
98
|
|
|
return AdAccountFields::getInstance(); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
protected static function getReferencedEnums() { |
102
|
|
|
$ref_enums = array(); |
103
|
|
|
$ref_enums['AccessType'] = AdAccountAccessTypeValues::getInstance()->getValues(); |
104
|
|
|
$ref_enums['PermittedRoles'] = AdAccountPermittedRolesValues::getInstance()->getValues(); |
105
|
|
|
return $ref_enums; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
|
109
|
|
|
public function getActivities(array $fields = array(), array $params = array(), $pending = false) { |
110
|
|
|
$this->assureId(); |
111
|
|
|
|
112
|
|
|
$param_types = array( |
113
|
|
|
'add_children' => 'bool', |
114
|
|
|
'business_id' => 'string', |
115
|
|
|
'category' => 'category_enum', |
116
|
|
|
'extra_oids' => 'list<string>', |
117
|
|
|
'oid' => 'string', |
118
|
|
|
'since' => 'datetime', |
119
|
|
|
'uid' => 'int', |
120
|
|
|
'until' => 'datetime', |
121
|
|
|
); |
122
|
|
|
$enums = array( |
123
|
|
|
'category_enum' => AdActivityCategoryValues::getInstance()->getValues(), |
124
|
|
|
); |
125
|
|
|
|
126
|
|
|
$request = new ApiRequest( |
127
|
|
|
$this->api, |
128
|
|
|
$this->data['id'], |
129
|
|
|
RequestInterface::METHOD_GET, |
130
|
|
|
'/activities', |
131
|
|
|
new AdActivity(), |
132
|
|
|
'EDGE', |
133
|
|
|
AdActivity::getFieldsEnum()->getValues(), |
134
|
|
|
new TypeChecker($param_types, $enums) |
135
|
|
|
); |
136
|
|
|
$request->addParams($params); |
137
|
|
|
$request->addFields($fields); |
138
|
|
|
return $pending ? $request : $request->execute(); |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
public function getAdPlacePageSets(array $fields = array(), array $params = array(), $pending = false) { |
142
|
|
|
$this->assureId(); |
143
|
|
|
|
144
|
|
|
$param_types = array( |
145
|
|
|
); |
146
|
|
|
$enums = array( |
147
|
|
|
); |
148
|
|
|
|
149
|
|
|
$request = new ApiRequest( |
150
|
|
|
$this->api, |
151
|
|
|
$this->data['id'], |
152
|
|
|
RequestInterface::METHOD_GET, |
153
|
|
|
'/ad_place_page_sets', |
154
|
|
|
new AdPlacePageSet(), |
155
|
|
|
'EDGE', |
156
|
|
|
AdPlacePageSet::getFieldsEnum()->getValues(), |
157
|
|
|
new TypeChecker($param_types, $enums) |
158
|
|
|
); |
159
|
|
|
$request->addParams($params); |
160
|
|
|
$request->addFields($fields); |
161
|
|
|
return $pending ? $request : $request->execute(); |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
public function createAdPlacePageSet(array $fields = array(), array $params = array(), $pending = false) { |
165
|
|
|
$this->assureId(); |
166
|
|
|
|
167
|
|
|
$param_types = array( |
168
|
|
|
'name' => 'string', |
169
|
|
|
'parent_page' => 'string', |
170
|
|
|
); |
171
|
|
|
$enums = array( |
172
|
|
|
); |
173
|
|
|
|
174
|
|
|
$request = new ApiRequest( |
175
|
|
|
$this->api, |
176
|
|
|
$this->data['id'], |
177
|
|
|
RequestInterface::METHOD_POST, |
178
|
|
|
'/ad_place_page_sets', |
179
|
|
|
new AdPlacePageSet(), |
180
|
|
|
'EDGE', |
181
|
|
|
AdPlacePageSet::getFieldsEnum()->getValues(), |
182
|
|
|
new TypeChecker($param_types, $enums) |
183
|
|
|
); |
184
|
|
|
$request->addParams($params); |
185
|
|
|
$request->addFields($fields); |
186
|
|
|
return $pending ? $request : $request->execute(); |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) { |
190
|
|
|
$this->assureId(); |
191
|
|
|
|
192
|
|
|
$param_types = array( |
193
|
|
|
); |
194
|
|
|
$enums = array( |
195
|
|
|
); |
196
|
|
|
|
197
|
|
|
$request = new ApiRequest( |
198
|
|
|
$this->api, |
199
|
|
|
$this->data['id'], |
200
|
|
|
RequestInterface::METHOD_GET, |
201
|
|
|
'/adcreatives', |
202
|
|
|
new AdCreative(), |
203
|
|
|
'EDGE', |
204
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
205
|
|
|
new TypeChecker($param_types, $enums) |
206
|
|
|
); |
207
|
|
|
$request->addParams($params); |
208
|
|
|
$request->addFields($fields); |
209
|
|
|
return $pending ? $request : $request->execute(); |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
public function createAdCreative(array $fields = array(), array $params = array(), $pending = false) { |
213
|
|
|
$this->assureId(); |
214
|
|
|
|
215
|
|
|
$param_types = array( |
216
|
|
|
'action_spec' => 'list<unsigned int>', |
217
|
|
|
'actor_id' => 'unsigned int', |
218
|
|
|
'actor_image_hash' => 'string', |
219
|
|
|
'actor_image_url' => 'string', |
220
|
|
|
'actor_name' => 'string', |
221
|
|
|
'adlabels' => 'list<Object>', |
222
|
|
|
'applink_treatment' => 'applink_treatment_enum', |
223
|
|
|
'body' => 'string', |
224
|
|
|
'call_to_action' => 'Object', |
225
|
|
|
'dynamic_ad_voice' => 'dynamic_ad_voice_enum', |
226
|
|
|
'follow_redirect' => 'bool', |
227
|
|
|
'image_crops' => 'map', |
228
|
|
|
'image_file' => 'string', |
229
|
|
|
'image_hash' => 'string', |
230
|
|
|
'image_url' => 'string', |
231
|
|
|
'instagram_actor_id' => 'string', |
232
|
|
|
'instagram_permalink_url' => 'string', |
233
|
|
|
'link_og_id' => 'string', |
234
|
|
|
'link_url' => 'string', |
235
|
|
|
'name' => 'string', |
236
|
|
|
'object_id' => 'unsigned int', |
237
|
|
|
'object_instagram_id' => 'unsigned int', |
238
|
|
|
'object_story_id' => 'string', |
239
|
|
|
'object_story_spec' => 'AdCreativeObjectStorySpec', |
240
|
|
|
'object_type' => 'string', |
241
|
|
|
'object_url' => 'string', |
242
|
|
|
'place_page_set_id' => 'string', |
243
|
|
|
'platform_customizations' => 'Object', |
244
|
|
|
'product_set_id' => 'string', |
245
|
|
|
'template_url' => 'string', |
246
|
|
|
'thumbnail_url' => 'string', |
247
|
|
|
'title' => 'string', |
248
|
|
|
'url_tags' => 'string', |
249
|
|
|
'video_id' => 'unsigned int', |
250
|
|
|
); |
251
|
|
|
$enums = array( |
252
|
|
|
'applink_treatment_enum' => AdCreativeApplinkTreatmentValues::getInstance()->getValues(), |
253
|
|
|
'dynamic_ad_voice_enum' => AdCreativeDynamicAdVoiceValues::getInstance()->getValues(), |
254
|
|
|
); |
255
|
|
|
|
256
|
|
|
$request = new ApiRequest( |
257
|
|
|
$this->api, |
258
|
|
|
$this->data['id'], |
259
|
|
|
RequestInterface::METHOD_POST, |
260
|
|
|
'/adcreatives', |
261
|
|
|
new AdCreative(), |
262
|
|
|
'EDGE', |
263
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
264
|
|
|
new TypeChecker($param_types, $enums) |
265
|
|
|
); |
266
|
|
|
$request->addParams($params); |
267
|
|
|
$request->addFields($fields); |
268
|
|
|
return $pending ? $request : $request->execute(); |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
public function getAdCreativesByLabels(array $fields = array(), array $params = array(), $pending = false) { |
272
|
|
|
$this->assureId(); |
273
|
|
|
|
274
|
|
|
$param_types = array( |
275
|
|
|
'ad_label_ids' => 'list<string>', |
276
|
|
|
'operator' => 'operator_enum', |
277
|
|
|
); |
278
|
|
|
$enums = array( |
279
|
|
|
'operator_enum' => AdCreativeOperatorValues::getInstance()->getValues(), |
280
|
|
|
); |
281
|
|
|
|
282
|
|
|
$request = new ApiRequest( |
283
|
|
|
$this->api, |
284
|
|
|
$this->data['id'], |
285
|
|
|
RequestInterface::METHOD_GET, |
286
|
|
|
'/adcreativesbylabels', |
287
|
|
|
new AdCreative(), |
288
|
|
|
'EDGE', |
289
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
290
|
|
|
new TypeChecker($param_types, $enums) |
291
|
|
|
); |
292
|
|
|
$request->addParams($params); |
293
|
|
|
$request->addFields($fields); |
294
|
|
|
return $pending ? $request : $request->execute(); |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
public function deleteAdImages(array $fields = array(), array $params = array(), $pending = false) { |
298
|
|
|
$this->assureId(); |
299
|
|
|
|
300
|
|
|
$param_types = array( |
301
|
|
|
'hash' => 'string', |
302
|
|
|
); |
303
|
|
|
$enums = array( |
304
|
|
|
); |
305
|
|
|
|
306
|
|
|
$request = new ApiRequest( |
307
|
|
|
$this->api, |
308
|
|
|
$this->data['id'], |
309
|
|
|
RequestInterface::METHOD_DELETE, |
310
|
|
|
'/adimages', |
311
|
|
|
new AbstractCrudObject(), |
312
|
|
|
'EDGE', |
313
|
|
|
array(), |
314
|
|
|
new TypeChecker($param_types, $enums) |
315
|
|
|
); |
316
|
|
|
$request->addParams($params); |
317
|
|
|
$request->addFields($fields); |
318
|
|
|
return $pending ? $request : $request->execute(); |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
public function getAdImages(array $fields = array(), array $params = array(), $pending = false) { |
322
|
|
|
$this->assureId(); |
323
|
|
|
|
324
|
|
|
$param_types = array( |
325
|
|
|
'biz_tag_id' => 'unsigned int', |
326
|
|
|
'business_id' => 'string', |
327
|
|
|
'hashes' => 'list<string>', |
328
|
|
|
'minheight' => 'unsigned int', |
329
|
|
|
'minwidth' => 'unsigned int', |
330
|
|
|
'name' => 'string', |
331
|
|
|
); |
332
|
|
|
$enums = array( |
333
|
|
|
); |
334
|
|
|
|
335
|
|
|
$request = new ApiRequest( |
336
|
|
|
$this->api, |
337
|
|
|
$this->data['id'], |
338
|
|
|
RequestInterface::METHOD_GET, |
339
|
|
|
'/adimages', |
340
|
|
|
new AdImage(), |
341
|
|
|
'EDGE', |
342
|
|
|
AdImage::getFieldsEnum()->getValues(), |
343
|
|
|
new TypeChecker($param_types, $enums) |
344
|
|
|
); |
345
|
|
|
$request->addParams($params); |
346
|
|
|
$request->addFields($fields); |
347
|
|
|
return $pending ? $request : $request->execute(); |
348
|
|
|
} |
349
|
|
|
|
350
|
|
|
public function createAdImage(array $fields = array(), array $params = array(), $pending = false) { |
351
|
|
|
$this->assureId(); |
352
|
|
|
|
353
|
|
|
$param_types = array( |
354
|
|
|
'bytes' => 'string', |
355
|
|
|
'copy_from' => 'Object', |
356
|
|
|
'zipbytes' => 'string', |
357
|
|
|
); |
358
|
|
|
$enums = array( |
359
|
|
|
); |
360
|
|
|
|
361
|
|
|
$request = new ApiRequest( |
362
|
|
|
$this->api, |
363
|
|
|
$this->data['id'], |
364
|
|
|
RequestInterface::METHOD_POST, |
365
|
|
|
'/adimages', |
366
|
|
|
new AdImage(), |
367
|
|
|
'EDGE', |
368
|
|
|
AdImage::getFieldsEnum()->getValues(), |
369
|
|
|
new TypeChecker($param_types, $enums), |
370
|
|
|
true |
371
|
|
|
); |
372
|
|
|
$request->addParams($params); |
373
|
|
|
$request->addFields($fields); |
374
|
|
|
return $pending ? $request : $request->execute(); |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
public function getAdLabels(array $fields = array(), array $params = array(), $pending = false) { |
378
|
|
|
$this->assureId(); |
379
|
|
|
|
380
|
|
|
$param_types = array( |
381
|
|
|
); |
382
|
|
|
$enums = array( |
383
|
|
|
); |
384
|
|
|
|
385
|
|
|
$request = new ApiRequest( |
386
|
|
|
$this->api, |
387
|
|
|
$this->data['id'], |
388
|
|
|
RequestInterface::METHOD_GET, |
389
|
|
|
'/adlabels', |
390
|
|
|
new AdLabel(), |
391
|
|
|
'EDGE', |
392
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
393
|
|
|
new TypeChecker($param_types, $enums) |
394
|
|
|
); |
395
|
|
|
$request->addParams($params); |
396
|
|
|
$request->addFields($fields); |
397
|
|
|
return $pending ? $request : $request->execute(); |
398
|
|
|
} |
399
|
|
|
|
400
|
|
|
public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) { |
401
|
|
|
$this->assureId(); |
402
|
|
|
|
403
|
|
|
$param_types = array( |
404
|
|
|
'name' => 'string', |
405
|
|
|
); |
406
|
|
|
$enums = array( |
407
|
|
|
); |
408
|
|
|
|
409
|
|
|
$request = new ApiRequest( |
410
|
|
|
$this->api, |
411
|
|
|
$this->data['id'], |
412
|
|
|
RequestInterface::METHOD_POST, |
413
|
|
|
'/adlabels', |
414
|
|
|
new AdLabel(), |
415
|
|
|
'EDGE', |
416
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
417
|
|
|
new TypeChecker($param_types, $enums) |
418
|
|
|
); |
419
|
|
|
$request->addParams($params); |
420
|
|
|
$request->addFields($fields); |
421
|
|
|
return $pending ? $request : $request->execute(); |
422
|
|
|
} |
423
|
|
|
|
424
|
|
|
public function getAdReportRuns(array $fields = array(), array $params = array(), $pending = false) { |
425
|
|
|
$this->assureId(); |
426
|
|
|
|
427
|
|
|
$param_types = array( |
428
|
|
|
); |
429
|
|
|
$enums = array( |
430
|
|
|
); |
431
|
|
|
|
432
|
|
|
$request = new ApiRequest( |
433
|
|
|
$this->api, |
434
|
|
|
$this->data['id'], |
435
|
|
|
RequestInterface::METHOD_GET, |
436
|
|
|
'/adreportruns', |
437
|
|
|
new AdReportRun(), |
438
|
|
|
'EDGE', |
439
|
|
|
AdReportRun::getFieldsEnum()->getValues(), |
440
|
|
|
new TypeChecker($param_types, $enums) |
441
|
|
|
); |
442
|
|
|
$request->addParams($params); |
443
|
|
|
$request->addFields($fields); |
444
|
|
|
return $pending ? $request : $request->execute(); |
445
|
|
|
} |
446
|
|
|
|
447
|
|
|
public function getAdReportSchedules(array $fields = array(), array $params = array(), $pending = false) { |
448
|
|
|
$this->assureId(); |
449
|
|
|
|
450
|
|
|
$param_types = array( |
451
|
|
|
); |
452
|
|
|
$enums = array( |
453
|
|
|
); |
454
|
|
|
|
455
|
|
|
$request = new ApiRequest( |
456
|
|
|
$this->api, |
457
|
|
|
$this->data['id'], |
458
|
|
|
RequestInterface::METHOD_GET, |
459
|
|
|
'/adreportschedules', |
460
|
|
|
new AbstractCrudObject(), |
461
|
|
|
'EDGE', |
462
|
|
|
array(), |
463
|
|
|
new TypeChecker($param_types, $enums) |
464
|
|
|
); |
465
|
|
|
$request->addParams($params); |
466
|
|
|
$request->addFields($fields); |
467
|
|
|
return $pending ? $request : $request->execute(); |
468
|
|
|
} |
469
|
|
|
|
470
|
|
|
public function getAds(array $fields = array(), array $params = array(), $pending = false) { |
471
|
|
|
$this->assureId(); |
472
|
|
|
|
473
|
|
|
$param_types = array( |
474
|
|
|
'ad_draft_id' => 'string', |
475
|
|
|
'date_preset' => 'date_preset_enum', |
476
|
|
|
'effective_status' => 'list<string>', |
477
|
|
|
'include_deleted' => 'bool', |
478
|
|
|
'time_range' => 'map', |
479
|
|
|
'updated_since' => 'int', |
480
|
|
|
); |
481
|
|
|
$enums = array( |
482
|
|
|
'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(), |
483
|
|
|
); |
484
|
|
|
|
485
|
|
|
$request = new ApiRequest( |
486
|
|
|
$this->api, |
487
|
|
|
$this->data['id'], |
488
|
|
|
RequestInterface::METHOD_GET, |
489
|
|
|
'/ads', |
490
|
|
|
new Ad(), |
491
|
|
|
'EDGE', |
492
|
|
|
Ad::getFieldsEnum()->getValues(), |
493
|
|
|
new TypeChecker($param_types, $enums) |
494
|
|
|
); |
495
|
|
|
$request->addParams($params); |
496
|
|
|
$request->addFields($fields); |
497
|
|
|
return $pending ? $request : $request->execute(); |
498
|
|
|
} |
499
|
|
|
|
500
|
|
|
public function createAd(array $fields = array(), array $params = array(), $pending = false) { |
501
|
|
|
$this->assureId(); |
502
|
|
|
|
503
|
|
|
$param_types = array( |
504
|
|
|
'adlabels' => 'list<Object>', |
505
|
|
|
'adset_id' => 'unsigned int', |
506
|
|
|
'bid_amount' => 'int', |
507
|
|
|
'creative' => 'AdCreative', |
508
|
|
|
'date_format' => 'string', |
509
|
|
|
'display_sequence' => 'unsigned int', |
510
|
|
|
'execution_options' => 'list<execution_options_enum>', |
511
|
|
|
'name' => 'string', |
512
|
|
|
'redownload' => 'bool', |
513
|
|
|
'status' => 'status_enum', |
514
|
|
|
'tracking_specs' => 'Object', |
515
|
|
|
); |
516
|
|
|
$enums = array( |
517
|
|
|
'execution_options_enum' => AdExecutionOptionsValues::getInstance()->getValues(), |
518
|
|
|
'status_enum' => AdStatusValues::getInstance()->getValues(), |
519
|
|
|
); |
520
|
|
|
|
521
|
|
|
$request = new ApiRequest( |
522
|
|
|
$this->api, |
523
|
|
|
$this->data['id'], |
524
|
|
|
RequestInterface::METHOD_POST, |
525
|
|
|
'/ads', |
526
|
|
|
new Ad(), |
527
|
|
|
'EDGE', |
528
|
|
|
Ad::getFieldsEnum()->getValues(), |
529
|
|
|
new TypeChecker($param_types, $enums), |
530
|
|
|
true |
531
|
|
|
); |
532
|
|
|
$request->addParams($params); |
533
|
|
|
$request->addFields($fields); |
534
|
|
|
return $pending ? $request : $request->execute(); |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
public function getAdsByLabels(array $fields = array(), array $params = array(), $pending = false) { |
538
|
|
|
$this->assureId(); |
539
|
|
|
|
540
|
|
|
$param_types = array( |
541
|
|
|
'ad_label_ids' => 'list<string>', |
542
|
|
|
'operator' => 'operator_enum', |
543
|
|
|
); |
544
|
|
|
$enums = array( |
545
|
|
|
'operator_enum' => AdOperatorValues::getInstance()->getValues(), |
546
|
|
|
); |
547
|
|
|
|
548
|
|
|
$request = new ApiRequest( |
549
|
|
|
$this->api, |
550
|
|
|
$this->data['id'], |
551
|
|
|
RequestInterface::METHOD_GET, |
552
|
|
|
'/adsbylabels', |
553
|
|
|
new Ad(), |
554
|
|
|
'EDGE', |
555
|
|
|
Ad::getFieldsEnum()->getValues(), |
556
|
|
|
new TypeChecker($param_types, $enums) |
557
|
|
|
); |
558
|
|
|
$request->addParams($params); |
559
|
|
|
$request->addFields($fields); |
560
|
|
|
return $pending ? $request : $request->execute(); |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
public function getAdSets(array $fields = array(), array $params = array(), $pending = false) { |
564
|
|
|
$this->assureId(); |
565
|
|
|
|
566
|
|
|
$param_types = array( |
567
|
|
|
'ad_draft_id' => 'string', |
568
|
|
|
'date_preset' => 'date_preset_enum', |
569
|
|
|
'effective_status' => 'list<effective_status_enum>', |
570
|
|
|
'include_deleted' => 'bool', |
571
|
|
|
'is_completed' => 'bool', |
572
|
|
|
'time_range' => 'map', |
573
|
|
|
); |
574
|
|
|
$enums = array( |
575
|
|
|
'date_preset_enum' => AdSetDatePresetValues::getInstance()->getValues(), |
576
|
|
|
'effective_status_enum' => AdSetEffectiveStatusValues::getInstance()->getValues(), |
577
|
|
|
); |
578
|
|
|
|
579
|
|
|
$request = new ApiRequest( |
580
|
|
|
$this->api, |
581
|
|
|
$this->data['id'], |
582
|
|
|
RequestInterface::METHOD_GET, |
583
|
|
|
'/adsets', |
584
|
|
|
new AdSet(), |
585
|
|
|
'EDGE', |
586
|
|
|
AdSet::getFieldsEnum()->getValues(), |
587
|
|
|
new TypeChecker($param_types, $enums) |
588
|
|
|
); |
589
|
|
|
$request->addParams($params); |
590
|
|
|
$request->addFields($fields); |
591
|
|
|
return $pending ? $request : $request->execute(); |
592
|
|
|
} |
593
|
|
|
|
594
|
|
|
public function createAdSet(array $fields = array(), array $params = array(), $pending = false) { |
595
|
|
|
$this->assureId(); |
596
|
|
|
|
597
|
|
|
$param_types = array( |
598
|
|
|
'adlabels' => 'list<Object>', |
599
|
|
|
'adset_schedule' => 'list<Object>', |
600
|
|
|
'attribution_window_days' => 'unsigned int', |
601
|
|
|
'bid_amount' => 'int', |
602
|
|
|
'billing_event' => 'billing_event_enum', |
603
|
|
|
'campaign_id' => 'string', |
604
|
|
|
'creative_sequence' => 'list<string>', |
605
|
|
|
'daily_budget' => 'unsigned int', |
606
|
|
|
'daily_imps' => 'unsigned int', |
607
|
|
|
'end_time' => 'datetime', |
608
|
|
|
'execution_options' => 'list<execution_options_enum>', |
609
|
|
|
'frequency_control_specs' => 'list<Object>', |
610
|
|
|
'is_autobid' => 'bool', |
611
|
|
|
'lifetime_budget' => 'unsigned int', |
612
|
|
|
'lifetime_imps' => 'unsigned int', |
613
|
|
|
'name' => 'string', |
614
|
|
|
'optimization_goal' => 'optimization_goal_enum', |
615
|
|
|
'pacing_type' => 'list<string>', |
616
|
|
|
'promoted_object' => 'Object', |
617
|
|
|
'redownload' => 'bool', |
618
|
|
|
'rf_prediction_id' => 'string', |
619
|
|
|
'rtb_flag' => 'bool', |
620
|
|
|
'start_time' => 'datetime', |
621
|
|
|
'status' => 'status_enum', |
622
|
|
|
'targeting' => 'Targeting', |
623
|
|
|
'time_based_ad_rotation_id_blocks' => 'list<list<unsigned int>>', |
624
|
|
|
'time_based_ad_rotation_intervals' => 'list<unsigned int>', |
625
|
|
|
); |
626
|
|
|
$enums = array( |
627
|
|
|
'billing_event_enum' => AdSetBillingEventValues::getInstance()->getValues(), |
628
|
|
|
'execution_options_enum' => AdSetExecutionOptionsValues::getInstance()->getValues(), |
629
|
|
|
'optimization_goal_enum' => AdSetOptimizationGoalValues::getInstance()->getValues(), |
630
|
|
|
'status_enum' => AdSetStatusValues::getInstance()->getValues(), |
631
|
|
|
); |
632
|
|
|
|
633
|
|
|
$request = new ApiRequest( |
634
|
|
|
$this->api, |
635
|
|
|
$this->data['id'], |
636
|
|
|
RequestInterface::METHOD_POST, |
637
|
|
|
'/adsets', |
638
|
|
|
new AdSet(), |
639
|
|
|
'EDGE', |
640
|
|
|
AdSet::getFieldsEnum()->getValues(), |
641
|
|
|
new TypeChecker($param_types, $enums) |
642
|
|
|
); |
643
|
|
|
$request->addParams($params); |
644
|
|
|
$request->addFields($fields); |
645
|
|
|
return $pending ? $request : $request->execute(); |
646
|
|
|
} |
647
|
|
|
|
648
|
|
|
public function getAdSetsByLabels(array $fields = array(), array $params = array(), $pending = false) { |
649
|
|
|
$this->assureId(); |
650
|
|
|
|
651
|
|
|
$param_types = array( |
652
|
|
|
'ad_label_ids' => 'list<string>', |
653
|
|
|
'operator' => 'operator_enum', |
654
|
|
|
); |
655
|
|
|
$enums = array( |
656
|
|
|
'operator_enum' => AdSetOperatorValues::getInstance()->getValues(), |
657
|
|
|
); |
658
|
|
|
|
659
|
|
|
$request = new ApiRequest( |
660
|
|
|
$this->api, |
661
|
|
|
$this->data['id'], |
662
|
|
|
RequestInterface::METHOD_GET, |
663
|
|
|
'/adsetsbylabels', |
664
|
|
|
new AdSet(), |
665
|
|
|
'EDGE', |
666
|
|
|
AdSet::getFieldsEnum()->getValues(), |
667
|
|
|
new TypeChecker($param_types, $enums) |
668
|
|
|
); |
669
|
|
|
$request->addParams($params); |
670
|
|
|
$request->addFields($fields); |
671
|
|
|
return $pending ? $request : $request->execute(); |
672
|
|
|
} |
673
|
|
|
|
674
|
|
|
public function getAdsPixels(array $fields = array(), array $params = array(), $pending = false) { |
675
|
|
|
$this->assureId(); |
676
|
|
|
|
677
|
|
|
$param_types = array( |
678
|
|
|
); |
679
|
|
|
$enums = array( |
680
|
|
|
); |
681
|
|
|
|
682
|
|
|
$request = new ApiRequest( |
683
|
|
|
$this->api, |
684
|
|
|
$this->data['id'], |
685
|
|
|
RequestInterface::METHOD_GET, |
686
|
|
|
'/adspixels', |
687
|
|
|
new AdsPixel(), |
688
|
|
|
'EDGE', |
689
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
690
|
|
|
new TypeChecker($param_types, $enums) |
691
|
|
|
); |
692
|
|
|
$request->addParams($params); |
693
|
|
|
$request->addFields($fields); |
694
|
|
|
return $pending ? $request : $request->execute(); |
695
|
|
|
} |
696
|
|
|
|
697
|
|
|
public function createAdsPixel(array $fields = array(), array $params = array(), $pending = false) { |
698
|
|
|
$this->assureId(); |
699
|
|
|
|
700
|
|
|
$param_types = array( |
701
|
|
|
'name' => 'string', |
702
|
|
|
); |
703
|
|
|
$enums = array( |
704
|
|
|
); |
705
|
|
|
|
706
|
|
|
$request = new ApiRequest( |
707
|
|
|
$this->api, |
708
|
|
|
$this->data['id'], |
709
|
|
|
RequestInterface::METHOD_POST, |
710
|
|
|
'/adspixels', |
711
|
|
|
new AdsPixel(), |
712
|
|
|
'EDGE', |
713
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
714
|
|
|
new TypeChecker($param_types, $enums) |
715
|
|
|
); |
716
|
|
|
$request->addParams($params); |
717
|
|
|
$request->addFields($fields); |
718
|
|
|
return $pending ? $request : $request->execute(); |
719
|
|
|
} |
720
|
|
|
|
721
|
|
|
public function getAdvertisableApplications(array $fields = array(), array $params = array(), $pending = false) { |
722
|
|
|
$this->assureId(); |
723
|
|
|
|
724
|
|
|
$param_types = array( |
725
|
|
|
'app_id' => 'string', |
726
|
|
|
'business_id' => 'string', |
727
|
|
|
); |
728
|
|
|
$enums = array( |
729
|
|
|
); |
730
|
|
|
|
731
|
|
|
$request = new ApiRequest( |
732
|
|
|
$this->api, |
733
|
|
|
$this->data['id'], |
734
|
|
|
RequestInterface::METHOD_GET, |
735
|
|
|
'/advertisable_applications', |
736
|
|
|
new AbstractCrudObject(), |
737
|
|
|
'EDGE', |
738
|
|
|
array(), |
739
|
|
|
new TypeChecker($param_types, $enums) |
740
|
|
|
); |
741
|
|
|
$request->addParams($params); |
742
|
|
|
$request->addFields($fields); |
743
|
|
|
return $pending ? $request : $request->execute(); |
744
|
|
|
} |
745
|
|
|
|
746
|
|
|
public function getAdVideos(array $fields = array(), array $params = array(), $pending = false) { |
747
|
|
|
$this->assureId(); |
748
|
|
|
|
749
|
|
|
$param_types = array( |
750
|
|
|
); |
751
|
|
|
$enums = array( |
752
|
|
|
); |
753
|
|
|
|
754
|
|
|
$request = new ApiRequest( |
755
|
|
|
$this->api, |
756
|
|
|
$this->data['id'], |
757
|
|
|
RequestInterface::METHOD_GET, |
758
|
|
|
'/advideos', |
759
|
|
|
new AbstractCrudObject(), |
760
|
|
|
'EDGE', |
761
|
|
|
array(), |
762
|
|
|
new TypeChecker($param_types, $enums) |
763
|
|
|
); |
764
|
|
|
$request->addParams($params); |
765
|
|
|
$request->addFields($fields); |
766
|
|
|
return $pending ? $request : $request->execute(); |
767
|
|
|
} |
768
|
|
|
|
769
|
|
|
public function createAdVideo(array $fields = array(), array $params = array(), $pending = false) { |
770
|
|
|
$this->assureId(); |
771
|
|
|
|
772
|
|
|
$param_types = array( |
773
|
|
|
'composer_session_id' => 'string', |
774
|
|
|
'description' => 'string', |
775
|
|
|
'file_size' => 'unsigned int', |
776
|
|
|
'file_url' => 'string', |
777
|
|
|
'is_explicit_share' => 'bool', |
778
|
|
|
'manual_privacy' => 'bool', |
779
|
|
|
'name' => 'string', |
780
|
|
|
'og_action_type_id' => 'string', |
781
|
|
|
'og_icon_id' => 'string', |
782
|
|
|
'og_object_id' => 'string', |
783
|
|
|
'og_phrase' => 'string', |
784
|
|
|
'og_suggestion_mechanism' => 'string', |
785
|
|
|
'overwrite_id' => 'string', |
786
|
|
|
'referenced_sticker_id' => 'string', |
787
|
|
|
'slideshow_spec' => 'map', |
788
|
|
|
'start_offset' => 'unsigned int', |
789
|
|
|
'time_since_original_post' => 'unsigned int', |
790
|
|
|
'title' => 'string', |
791
|
|
|
'unpublished_content_type' => 'unpublished_content_type_enum', |
792
|
|
|
'upload_phase' => 'upload_phase_enum', |
793
|
|
|
'upload_session_id' => 'string', |
794
|
|
|
'video_file_chunk' => 'string', |
795
|
|
|
); |
796
|
|
|
$enums = array( |
797
|
|
|
'unpublished_content_type_enum' => array( |
798
|
|
|
'SCHEDULED', |
799
|
|
|
'DRAFT', |
800
|
|
|
'ADS_POST', |
801
|
|
|
), |
802
|
|
|
'upload_phase_enum' => array( |
803
|
|
|
'start', |
804
|
|
|
'transfer', |
805
|
|
|
'finish', |
806
|
|
|
'cancel', |
807
|
|
|
), |
808
|
|
|
); |
809
|
|
|
|
810
|
|
|
$request = new ApiRequest( |
811
|
|
|
$this->api, |
812
|
|
|
$this->data['id'], |
813
|
|
|
RequestInterface::METHOD_POST, |
814
|
|
|
'/advideos', |
815
|
|
|
new AbstractCrudObject(), |
816
|
|
|
'EDGE', |
817
|
|
|
array(), |
818
|
|
|
new TypeChecker($param_types, $enums), |
819
|
|
|
true, |
820
|
|
|
true |
821
|
|
|
); |
822
|
|
|
$request->addParams($params); |
823
|
|
|
$request->addFields($fields); |
824
|
|
|
return $pending ? $request : $request->execute(); |
825
|
|
|
} |
826
|
|
|
|
827
|
|
|
public function getApplications(array $fields = array(), array $params = array(), $pending = false) { |
828
|
|
|
$this->assureId(); |
829
|
|
|
|
830
|
|
|
$param_types = array( |
831
|
|
|
); |
832
|
|
|
$enums = array( |
833
|
|
|
); |
834
|
|
|
|
835
|
|
|
$request = new ApiRequest( |
836
|
|
|
$this->api, |
837
|
|
|
$this->data['id'], |
838
|
|
|
RequestInterface::METHOD_GET, |
839
|
|
|
'/applications', |
840
|
|
|
new AbstractCrudObject(), |
841
|
|
|
'EDGE', |
842
|
|
|
array(), |
843
|
|
|
new TypeChecker($param_types, $enums) |
844
|
|
|
); |
845
|
|
|
$request->addParams($params); |
846
|
|
|
$request->addFields($fields); |
847
|
|
|
return $pending ? $request : $request->execute(); |
848
|
|
|
} |
849
|
|
|
|
850
|
|
|
public function getAsyncAdRequestSets(array $fields = array(), array $params = array(), $pending = false) { |
851
|
|
|
$this->assureId(); |
852
|
|
|
|
853
|
|
|
$param_types = array( |
854
|
|
|
'is_completed' => 'bool', |
855
|
|
|
); |
856
|
|
|
$enums = array( |
857
|
|
|
); |
858
|
|
|
|
859
|
|
|
$request = new ApiRequest( |
860
|
|
|
$this->api, |
861
|
|
|
$this->data['id'], |
862
|
|
|
RequestInterface::METHOD_GET, |
863
|
|
|
'/asyncadrequestsets', |
864
|
|
|
new AdAsyncRequestSet(), |
865
|
|
|
'EDGE', |
866
|
|
|
AdAsyncRequestSet::getFieldsEnum()->getValues(), |
867
|
|
|
new TypeChecker($param_types, $enums) |
868
|
|
|
); |
869
|
|
|
$request->addParams($params); |
870
|
|
|
$request->addFields($fields); |
871
|
|
|
return $pending ? $request : $request->execute(); |
872
|
|
|
} |
873
|
|
|
|
874
|
|
|
public function createAsyncAdRequestSet(array $fields = array(), array $params = array(), $pending = false) { |
875
|
|
|
$this->assureId(); |
876
|
|
|
|
877
|
|
|
$param_types = array( |
878
|
|
|
'ad_specs' => 'list<map>', |
879
|
|
|
'name' => 'string', |
880
|
|
|
'notification_mode' => 'notification_mode_enum', |
881
|
|
|
'notification_uri' => 'string', |
882
|
|
|
); |
883
|
|
|
$enums = array( |
884
|
|
|
'notification_mode_enum' => array( |
885
|
|
|
'OFF', |
886
|
|
|
'ON_COMPLETE', |
887
|
|
|
), |
888
|
|
|
); |
889
|
|
|
|
890
|
|
|
$request = new ApiRequest( |
891
|
|
|
$this->api, |
892
|
|
|
$this->data['id'], |
893
|
|
|
RequestInterface::METHOD_POST, |
894
|
|
|
'/asyncadrequestsets', |
895
|
|
|
new AdAsyncRequestSet(), |
896
|
|
|
'EDGE', |
897
|
|
|
AdAsyncRequestSet::getFieldsEnum()->getValues(), |
898
|
|
|
new TypeChecker($param_types, $enums) |
899
|
|
|
); |
900
|
|
|
$request->addParams($params); |
901
|
|
|
$request->addFields($fields); |
902
|
|
|
return $pending ? $request : $request->execute(); |
903
|
|
|
} |
904
|
|
|
|
905
|
|
|
public function getBroadTargetingCategories(array $fields = array(), array $params = array(), $pending = false) { |
906
|
|
|
$this->assureId(); |
907
|
|
|
|
908
|
|
|
$param_types = array( |
909
|
|
|
'custom_categories_only' => 'bool', |
910
|
|
|
); |
911
|
|
|
$enums = array( |
912
|
|
|
); |
913
|
|
|
|
914
|
|
|
$request = new ApiRequest( |
915
|
|
|
$this->api, |
916
|
|
|
$this->data['id'], |
917
|
|
|
RequestInterface::METHOD_GET, |
918
|
|
|
'/broadtargetingcategories', |
919
|
|
|
new BroadTargetingCategories(), |
920
|
|
|
'EDGE', |
921
|
|
|
BroadTargetingCategories::getFieldsEnum()->getValues(), |
922
|
|
|
new TypeChecker($param_types, $enums) |
923
|
|
|
); |
924
|
|
|
$request->addParams($params); |
925
|
|
|
$request->addFields($fields); |
926
|
|
|
return $pending ? $request : $request->execute(); |
927
|
|
|
} |
928
|
|
|
|
929
|
|
|
public function deleteCampaigns(array $fields = array(), array $params = array(), $pending = false) { |
930
|
|
|
$this->assureId(); |
931
|
|
|
|
932
|
|
|
$param_types = array( |
933
|
|
|
'before_date' => 'datetime', |
934
|
|
|
'delete_strategy' => 'delete_strategy_enum', |
935
|
|
|
'object_count' => 'int', |
936
|
|
|
); |
937
|
|
|
$enums = array( |
938
|
|
|
'delete_strategy_enum' => CampaignDeleteStrategyValues::getInstance()->getValues(), |
939
|
|
|
); |
940
|
|
|
|
941
|
|
|
$request = new ApiRequest( |
942
|
|
|
$this->api, |
943
|
|
|
$this->data['id'], |
944
|
|
|
RequestInterface::METHOD_DELETE, |
945
|
|
|
'/campaigns', |
946
|
|
|
new AbstractCrudObject(), |
947
|
|
|
'EDGE', |
948
|
|
|
array(), |
949
|
|
|
new TypeChecker($param_types, $enums) |
950
|
|
|
); |
951
|
|
|
$request->addParams($params); |
952
|
|
|
$request->addFields($fields); |
953
|
|
|
return $pending ? $request : $request->execute(); |
954
|
|
|
} |
955
|
|
|
|
956
|
|
|
public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) { |
957
|
|
|
$this->assureId(); |
958
|
|
|
|
959
|
|
|
$param_types = array( |
960
|
|
|
'ad_draft_id' => 'string', |
961
|
|
|
'date_preset' => 'date_preset_enum', |
962
|
|
|
'effective_status' => 'list<effective_status_enum>', |
963
|
|
|
'is_completed' => 'bool', |
964
|
|
|
'time_range' => 'map', |
965
|
|
|
); |
966
|
|
|
$enums = array( |
967
|
|
|
'date_preset_enum' => CampaignDatePresetValues::getInstance()->getValues(), |
968
|
|
|
'effective_status_enum' => CampaignEffectiveStatusValues::getInstance()->getValues(), |
969
|
|
|
); |
970
|
|
|
|
971
|
|
|
$request = new ApiRequest( |
972
|
|
|
$this->api, |
973
|
|
|
$this->data['id'], |
974
|
|
|
RequestInterface::METHOD_GET, |
975
|
|
|
'/campaigns', |
976
|
|
|
new Campaign(), |
977
|
|
|
'EDGE', |
978
|
|
|
Campaign::getFieldsEnum()->getValues(), |
979
|
|
|
new TypeChecker($param_types, $enums) |
980
|
|
|
); |
981
|
|
|
$request->addParams($params); |
982
|
|
|
$request->addFields($fields); |
983
|
|
|
return $pending ? $request : $request->execute(); |
984
|
|
|
} |
985
|
|
|
|
986
|
|
|
public function createCampaign(array $fields = array(), array $params = array(), $pending = false) { |
987
|
|
|
$this->assureId(); |
988
|
|
|
|
989
|
|
|
$param_types = array( |
990
|
|
|
'adlabels' => 'list<Object>', |
991
|
|
|
'buying_type' => 'string', |
992
|
|
|
'execution_options' => 'list<execution_options_enum>', |
993
|
|
|
'name' => 'string', |
994
|
|
|
'objective' => 'objective_enum', |
995
|
|
|
'promoted_object' => 'Object', |
996
|
|
|
'spend_cap' => 'unsigned int', |
997
|
|
|
'status' => 'status_enum', |
998
|
|
|
); |
999
|
|
|
$enums = array( |
1000
|
|
|
'execution_options_enum' => CampaignExecutionOptionsValues::getInstance()->getValues(), |
1001
|
|
|
'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(), |
1002
|
|
|
'status_enum' => CampaignStatusValues::getInstance()->getValues(), |
1003
|
|
|
); |
1004
|
|
|
|
1005
|
|
|
$request = new ApiRequest( |
1006
|
|
|
$this->api, |
1007
|
|
|
$this->data['id'], |
1008
|
|
|
RequestInterface::METHOD_POST, |
1009
|
|
|
'/campaigns', |
1010
|
|
|
new Campaign(), |
1011
|
|
|
'EDGE', |
1012
|
|
|
Campaign::getFieldsEnum()->getValues(), |
1013
|
|
|
new TypeChecker($param_types, $enums) |
1014
|
|
|
); |
1015
|
|
|
$request->addParams($params); |
1016
|
|
|
$request->addFields($fields); |
1017
|
|
|
return $pending ? $request : $request->execute(); |
1018
|
|
|
} |
1019
|
|
|
|
1020
|
|
|
public function getCampaignsByLabels(array $fields = array(), array $params = array(), $pending = false) { |
1021
|
|
|
$this->assureId(); |
1022
|
|
|
|
1023
|
|
|
$param_types = array( |
1024
|
|
|
'ad_label_ids' => 'list<string>', |
1025
|
|
|
'operator' => 'operator_enum', |
1026
|
|
|
); |
1027
|
|
|
$enums = array( |
1028
|
|
|
'operator_enum' => CampaignOperatorValues::getInstance()->getValues(), |
1029
|
|
|
); |
1030
|
|
|
|
1031
|
|
|
$request = new ApiRequest( |
1032
|
|
|
$this->api, |
1033
|
|
|
$this->data['id'], |
1034
|
|
|
RequestInterface::METHOD_GET, |
1035
|
|
|
'/campaignsbylabels', |
1036
|
|
|
new Campaign(), |
1037
|
|
|
'EDGE', |
1038
|
|
|
Campaign::getFieldsEnum()->getValues(), |
1039
|
|
|
new TypeChecker($param_types, $enums) |
1040
|
|
|
); |
1041
|
|
|
$request->addParams($params); |
1042
|
|
|
$request->addFields($fields); |
1043
|
|
|
return $pending ? $request : $request->execute(); |
1044
|
|
|
} |
1045
|
|
|
|
1046
|
|
|
public function getCustomAudiences(array $fields = array(), array $params = array(), $pending = false) { |
1047
|
|
|
$this->assureId(); |
1048
|
|
|
|
1049
|
|
|
$param_types = array( |
1050
|
|
|
'business_id' => 'string', |
1051
|
|
|
'fields' => 'list<fields_enum>', |
1052
|
|
|
'filtering' => 'list<Object>', |
1053
|
|
|
'pixel_id' => 'string', |
1054
|
|
|
); |
1055
|
|
|
$enums = array( |
1056
|
|
|
'fields_enum' => CustomAudienceFieldsValues::getInstance()->getValues(), |
1057
|
|
|
); |
1058
|
|
|
|
1059
|
|
|
$request = new ApiRequest( |
1060
|
|
|
$this->api, |
1061
|
|
|
$this->data['id'], |
1062
|
|
|
RequestInterface::METHOD_GET, |
1063
|
|
|
'/customaudiences', |
1064
|
|
|
new CustomAudience(), |
1065
|
|
|
'EDGE', |
1066
|
|
|
CustomAudience::getFieldsEnum()->getValues(), |
1067
|
|
|
new TypeChecker($param_types, $enums) |
1068
|
|
|
); |
1069
|
|
|
$request->addParams($params); |
1070
|
|
|
$request->addFields($fields); |
1071
|
|
|
return $pending ? $request : $request->execute(); |
1072
|
|
|
} |
1073
|
|
|
|
1074
|
|
|
public function createCustomAudience(array $fields = array(), array $params = array(), $pending = false) { |
1075
|
|
|
$this->assureId(); |
1076
|
|
|
|
1077
|
|
|
$param_types = array( |
1078
|
|
|
'claim_objective' => 'claim_objective_enum', |
1079
|
|
|
'content_type' => 'content_type_enum', |
1080
|
|
|
'dataset_id' => 'string', |
1081
|
|
|
'description' => 'string', |
1082
|
|
|
'event_source_group' => 'string', |
1083
|
|
|
'list_of_accounts' => 'list<unsigned int>', |
1084
|
|
|
'lookalike_spec' => 'string', |
1085
|
|
|
'name' => 'string', |
1086
|
|
|
'opt_out_link' => 'string', |
1087
|
|
|
'origin_audience_id' => 'string', |
1088
|
|
|
'pixel_id' => 'unsigned int', |
1089
|
|
|
'prefill' => 'bool', |
1090
|
|
|
'product_set_id' => 'string', |
1091
|
|
|
'retention_days' => 'unsigned int', |
1092
|
|
|
'rule' => 'string', |
1093
|
|
|
'subtype' => 'subtype_enum', |
1094
|
|
|
); |
1095
|
|
|
$enums = array( |
1096
|
|
|
'claim_objective_enum' => CustomAudienceClaimObjectiveValues::getInstance()->getValues(), |
1097
|
|
|
'content_type_enum' => CustomAudienceContentTypeValues::getInstance()->getValues(), |
1098
|
|
|
'subtype_enum' => CustomAudienceSubtypeValues::getInstance()->getValues(), |
1099
|
|
|
); |
1100
|
|
|
|
1101
|
|
|
$request = new ApiRequest( |
1102
|
|
|
$this->api, |
1103
|
|
|
$this->data['id'], |
1104
|
|
|
RequestInterface::METHOD_POST, |
1105
|
|
|
'/customaudiences', |
1106
|
|
|
new CustomAudience(), |
1107
|
|
|
'EDGE', |
1108
|
|
|
CustomAudience::getFieldsEnum()->getValues(), |
1109
|
|
|
new TypeChecker($param_types, $enums) |
1110
|
|
|
); |
1111
|
|
|
$request->addParams($params); |
1112
|
|
|
$request->addFields($fields); |
1113
|
|
|
return $pending ? $request : $request->execute(); |
1114
|
|
|
} |
1115
|
|
|
|
1116
|
|
|
public function getCustomAudiencesTos(array $fields = array(), array $params = array(), $pending = false) { |
1117
|
|
|
$this->assureId(); |
1118
|
|
|
|
1119
|
|
|
$param_types = array( |
1120
|
|
|
); |
1121
|
|
|
$enums = array( |
1122
|
|
|
); |
1123
|
|
|
|
1124
|
|
|
$request = new ApiRequest( |
1125
|
|
|
$this->api, |
1126
|
|
|
$this->data['id'], |
1127
|
|
|
RequestInterface::METHOD_GET, |
1128
|
|
|
'/customaudiencestos', |
1129
|
|
|
new CustomAudiencesTOS(), |
1130
|
|
|
'EDGE', |
1131
|
|
|
CustomAudiencesTOS::getFieldsEnum()->getValues(), |
1132
|
|
|
new TypeChecker($param_types, $enums) |
1133
|
|
|
); |
1134
|
|
|
$request->addParams($params); |
1135
|
|
|
$request->addFields($fields); |
1136
|
|
|
return $pending ? $request : $request->execute(); |
1137
|
|
|
} |
1138
|
|
|
|
1139
|
|
|
public function createCustomConversion(array $fields = array(), array $params = array(), $pending = false) { |
1140
|
|
|
$this->assureId(); |
1141
|
|
|
|
1142
|
|
|
$param_types = array( |
1143
|
|
|
'custom_event_type' => 'custom_event_type_enum', |
1144
|
|
|
'default_conversion_value' => 'float', |
1145
|
|
|
'description' => 'string', |
1146
|
|
|
'name' => 'string', |
1147
|
|
|
'pixel_id' => 'string', |
1148
|
|
|
'pixel_rule' => 'string', |
1149
|
|
|
); |
1150
|
|
|
$enums = array( |
1151
|
|
|
'custom_event_type_enum' => CustomConversionCustomEventTypeValues::getInstance()->getValues(), |
1152
|
|
|
); |
1153
|
|
|
|
1154
|
|
|
$request = new ApiRequest( |
1155
|
|
|
$this->api, |
1156
|
|
|
$this->data['id'], |
1157
|
|
|
RequestInterface::METHOD_POST, |
1158
|
|
|
'/customconversions', |
1159
|
|
|
new CustomConversion(), |
1160
|
|
|
'EDGE', |
1161
|
|
|
CustomConversion::getFieldsEnum()->getValues(), |
1162
|
|
|
new TypeChecker($param_types, $enums) |
1163
|
|
|
); |
1164
|
|
|
$request->addParams($params); |
1165
|
|
|
$request->addFields($fields); |
1166
|
|
|
return $pending ? $request : $request->execute(); |
1167
|
|
|
} |
1168
|
|
|
|
1169
|
|
|
public function getGeneratePreviews(array $fields = array(), array $params = array(), $pending = false) { |
1170
|
|
|
$this->assureId(); |
1171
|
|
|
|
1172
|
|
|
$param_types = array( |
1173
|
|
|
'ad_format' => 'ad_format_enum', |
1174
|
|
|
'creative' => 'AdCreative', |
1175
|
|
|
'dynamic_creative_spec' => 'Object', |
1176
|
|
|
'height' => 'unsigned int', |
1177
|
|
|
'interactive' => 'bool', |
1178
|
|
|
'locale' => 'string', |
1179
|
|
|
'post' => 'Object', |
1180
|
|
|
'product_item_ids' => 'list<string>', |
1181
|
|
|
'width' => 'unsigned int', |
1182
|
|
|
); |
1183
|
|
|
$enums = array( |
1184
|
|
|
'ad_format_enum' => AdPreviewAdFormatValues::getInstance()->getValues(), |
1185
|
|
|
); |
1186
|
|
|
|
1187
|
|
|
$request = new ApiRequest( |
1188
|
|
|
$this->api, |
1189
|
|
|
$this->data['id'], |
1190
|
|
|
RequestInterface::METHOD_GET, |
1191
|
|
|
'/generatepreviews', |
1192
|
|
|
new AdPreview(), |
1193
|
|
|
'EDGE', |
1194
|
|
|
AdPreview::getFieldsEnum()->getValues(), |
1195
|
|
|
new TypeChecker($param_types, $enums) |
1196
|
|
|
); |
1197
|
|
|
$request->addParams($params); |
1198
|
|
|
$request->addFields($fields); |
1199
|
|
|
return $pending ? $request : $request->execute(); |
1200
|
|
|
} |
1201
|
|
|
|
1202
|
|
|
public function getInsights(array $fields = array(), array $params = array(), $pending = false) { |
1203
|
|
|
$this->assureId(); |
1204
|
|
|
|
1205
|
|
|
$param_types = array( |
1206
|
|
|
'action_attribution_windows' => 'list<action_attribution_windows_enum>', |
1207
|
|
|
'action_breakdowns' => 'list<action_breakdowns_enum>', |
1208
|
|
|
'action_report_time' => 'action_report_time_enum', |
1209
|
|
|
'breakdowns' => 'list<breakdowns_enum>', |
1210
|
|
|
'date_preset' => 'date_preset_enum', |
1211
|
|
|
'default_summary' => 'bool', |
1212
|
|
|
'fields' => 'list<fields_enum>', |
1213
|
|
|
'filtering' => 'list<Object>', |
1214
|
|
|
'level' => 'level_enum', |
1215
|
|
|
'product_id_limit' => 'int', |
1216
|
|
|
'sort' => 'list<string>', |
1217
|
|
|
'summary' => 'list<summary_enum>', |
1218
|
|
|
'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>', |
1219
|
|
|
'time_increment' => 'string', |
1220
|
|
|
'time_range' => 'map', |
1221
|
|
|
'time_ranges' => 'list<map>', |
1222
|
|
|
); |
1223
|
|
|
$enums = array( |
1224
|
|
|
'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(), |
1225
|
|
|
'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(), |
1226
|
|
|
'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(), |
1227
|
|
|
'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(), |
1228
|
|
|
'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(), |
1229
|
|
|
'summary_enum' => AdsInsightsSummaryValues::getInstance()->getValues(), |
1230
|
|
|
'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(), |
1231
|
|
|
'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(), |
1232
|
|
|
); |
1233
|
|
|
|
1234
|
|
|
$request = new ApiRequest( |
1235
|
|
|
$this->api, |
1236
|
|
|
$this->data['id'], |
1237
|
|
|
RequestInterface::METHOD_GET, |
1238
|
|
|
'/insights', |
1239
|
|
|
new AdsInsights(), |
1240
|
|
|
'EDGE', |
1241
|
|
|
AdsInsights::getFieldsEnum()->getValues(), |
1242
|
|
|
new TypeChecker($param_types, $enums) |
1243
|
|
|
); |
1244
|
|
|
$request->addParams($params); |
1245
|
|
|
$request->addFields($fields); |
1246
|
|
|
return $pending ? $request : $request->execute(); |
1247
|
|
|
} |
1248
|
|
|
|
1249
|
|
|
public function getInsightsAsync(array $fields = array(), array $params = array(), $pending = false) { |
1250
|
|
|
$this->assureId(); |
1251
|
|
|
|
1252
|
|
|
$param_types = array( |
1253
|
|
|
'action_attribution_windows' => 'list<action_attribution_windows_enum>', |
1254
|
|
|
'action_breakdowns' => 'list<action_breakdowns_enum>', |
1255
|
|
|
'action_report_time' => 'action_report_time_enum', |
1256
|
|
|
'breakdowns' => 'list<breakdowns_enum>', |
1257
|
|
|
'date_preset' => 'date_preset_enum', |
1258
|
|
|
'default_summary' => 'bool', |
1259
|
|
|
'fields' => 'list<fields_enum>', |
1260
|
|
|
'filtering' => 'list<Object>', |
1261
|
|
|
'level' => 'level_enum', |
1262
|
|
|
'product_id_limit' => 'int', |
1263
|
|
|
'sort' => 'list<string>', |
1264
|
|
|
'summary' => 'list<summary_enum>', |
1265
|
|
|
'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>', |
1266
|
|
|
'time_increment' => 'string', |
1267
|
|
|
'time_range' => 'map', |
1268
|
|
|
'time_ranges' => 'list<map>', |
1269
|
|
|
); |
1270
|
|
|
$enums = array( |
1271
|
|
|
'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(), |
1272
|
|
|
'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(), |
1273
|
|
|
'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(), |
1274
|
|
|
'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(), |
1275
|
|
|
'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(), |
1276
|
|
|
'summary_enum' => AdsInsightsSummaryValues::getInstance()->getValues(), |
1277
|
|
|
'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(), |
1278
|
|
|
'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(), |
1279
|
|
|
); |
1280
|
|
|
|
1281
|
|
|
$request = new ApiRequest( |
1282
|
|
|
$this->api, |
1283
|
|
|
$this->data['id'], |
1284
|
|
|
RequestInterface::METHOD_POST, |
1285
|
|
|
'/insights', |
1286
|
|
|
new AdReportRun(), |
1287
|
|
|
'EDGE', |
1288
|
|
|
AdReportRun::getFieldsEnum()->getValues(), |
1289
|
|
|
new TypeChecker($param_types, $enums) |
1290
|
|
|
); |
1291
|
|
|
$request->addParams($params); |
1292
|
|
|
$request->addFields($fields); |
1293
|
|
|
return $pending ? $request : $request->execute(); |
1294
|
|
|
} |
1295
|
|
|
|
1296
|
|
|
public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
1297
|
|
|
$this->assureId(); |
1298
|
|
|
|
1299
|
|
|
$param_types = array( |
1300
|
|
|
); |
1301
|
|
|
$enums = array( |
1302
|
|
|
); |
1303
|
|
|
|
1304
|
|
|
$request = new ApiRequest( |
1305
|
|
|
$this->api, |
1306
|
|
|
$this->data['id'], |
1307
|
|
|
RequestInterface::METHOD_GET, |
1308
|
|
|
'/instagram_accounts', |
1309
|
|
|
new AbstractCrudObject(), |
1310
|
|
|
'EDGE', |
1311
|
|
|
array(), |
1312
|
|
|
new TypeChecker($param_types, $enums) |
1313
|
|
|
); |
1314
|
|
|
$request->addParams($params); |
1315
|
|
|
$request->addFields($fields); |
1316
|
|
|
return $pending ? $request : $request->execute(); |
1317
|
|
|
} |
1318
|
|
|
|
1319
|
|
|
public function getLeadGenForms(array $fields = array(), array $params = array(), $pending = false) { |
1320
|
|
|
$this->assureId(); |
1321
|
|
|
|
1322
|
|
|
$param_types = array( |
1323
|
|
|
'query' => 'string', |
1324
|
|
|
); |
1325
|
|
|
$enums = array( |
1326
|
|
|
); |
1327
|
|
|
|
1328
|
|
|
$request = new ApiRequest( |
1329
|
|
|
$this->api, |
1330
|
|
|
$this->data['id'], |
1331
|
|
|
RequestInterface::METHOD_GET, |
1332
|
|
|
'/leadgen_forms', |
1333
|
|
|
new LeadgenForm(), |
1334
|
|
|
'EDGE', |
1335
|
|
|
LeadgenForm::getFieldsEnum()->getValues(), |
1336
|
|
|
new TypeChecker($param_types, $enums) |
1337
|
|
|
); |
1338
|
|
|
$request->addParams($params); |
1339
|
|
|
$request->addFields($fields); |
1340
|
|
|
return $pending ? $request : $request->execute(); |
1341
|
|
|
} |
1342
|
|
|
|
1343
|
|
|
public function getMinimumBudgets(array $fields = array(), array $params = array(), $pending = false) { |
1344
|
|
|
$this->assureId(); |
1345
|
|
|
|
1346
|
|
|
$param_types = array( |
1347
|
|
|
'bid_amount' => 'int', |
1348
|
|
|
); |
1349
|
|
|
$enums = array( |
1350
|
|
|
); |
1351
|
|
|
|
1352
|
|
|
$request = new ApiRequest( |
1353
|
|
|
$this->api, |
1354
|
|
|
$this->data['id'], |
1355
|
|
|
RequestInterface::METHOD_GET, |
1356
|
|
|
'/minimum_budgets', |
1357
|
|
|
new MinimumBudget(), |
1358
|
|
|
'EDGE', |
1359
|
|
|
MinimumBudget::getFieldsEnum()->getValues(), |
1360
|
|
|
new TypeChecker($param_types, $enums) |
1361
|
|
|
); |
1362
|
|
|
$request->addParams($params); |
1363
|
|
|
$request->addFields($fields); |
1364
|
|
|
return $pending ? $request : $request->execute(); |
1365
|
|
|
} |
1366
|
|
|
|
1367
|
|
|
public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) { |
1368
|
|
|
$this->assureId(); |
1369
|
|
|
|
1370
|
|
|
$param_types = array( |
1371
|
|
|
); |
1372
|
|
|
$enums = array( |
1373
|
|
|
); |
1374
|
|
|
|
1375
|
|
|
$request = new ApiRequest( |
1376
|
|
|
$this->api, |
1377
|
|
|
$this->data['id'], |
1378
|
|
|
RequestInterface::METHOD_GET, |
1379
|
|
|
'/offline_conversion_data_sets', |
1380
|
|
|
new AbstractCrudObject(), |
1381
|
|
|
'EDGE', |
1382
|
|
|
array(), |
1383
|
|
|
new TypeChecker($param_types, $enums) |
1384
|
|
|
); |
1385
|
|
|
$request->addParams($params); |
1386
|
|
|
$request->addFields($fields); |
1387
|
|
|
return $pending ? $request : $request->execute(); |
1388
|
|
|
} |
1389
|
|
|
|
1390
|
|
|
public function createOfflineConversion(array $fields = array(), array $params = array(), $pending = false) { |
1391
|
|
|
$this->assureId(); |
1392
|
|
|
|
1393
|
|
|
$param_types = array( |
1394
|
|
|
'event' => 'string', |
1395
|
|
|
'payload' => 'list<Object>', |
1396
|
|
|
'pixel_id' => 'string', |
1397
|
|
|
); |
1398
|
|
|
$enums = array( |
1399
|
|
|
); |
1400
|
|
|
|
1401
|
|
|
$request = new ApiRequest( |
1402
|
|
|
$this->api, |
1403
|
|
|
$this->data['id'], |
1404
|
|
|
RequestInterface::METHOD_POST, |
1405
|
|
|
'/offlineconversions', |
1406
|
|
|
new AbstractCrudObject(), |
1407
|
|
|
'EDGE', |
1408
|
|
|
array(), |
1409
|
|
|
new TypeChecker($param_types, $enums) |
1410
|
|
|
); |
1411
|
|
|
$request->addParams($params); |
1412
|
|
|
$request->addFields($fields); |
1413
|
|
|
return $pending ? $request : $request->execute(); |
1414
|
|
|
} |
1415
|
|
|
|
1416
|
|
|
public function getOffsitePixels(array $fields = array(), array $params = array(), $pending = false) { |
1417
|
|
|
$this->assureId(); |
1418
|
|
|
|
1419
|
|
|
$param_types = array( |
1420
|
|
|
); |
1421
|
|
|
$enums = array( |
1422
|
|
|
); |
1423
|
|
|
|
1424
|
|
|
$request = new ApiRequest( |
1425
|
|
|
$this->api, |
1426
|
|
|
$this->data['id'], |
1427
|
|
|
RequestInterface::METHOD_GET, |
1428
|
|
|
'/offsitepixels', |
1429
|
|
|
new OffsitePixel(), |
1430
|
|
|
'EDGE', |
1431
|
|
|
OffsitePixel::getFieldsEnum()->getValues(), |
1432
|
|
|
new TypeChecker($param_types, $enums) |
1433
|
|
|
); |
1434
|
|
|
$request->addParams($params); |
1435
|
|
|
$request->addFields($fields); |
1436
|
|
|
return $pending ? $request : $request->execute(); |
1437
|
|
|
} |
1438
|
|
|
|
1439
|
|
|
public function createOffsitePixel(array $fields = array(), array $params = array(), $pending = false) { |
1440
|
|
|
$this->assureId(); |
1441
|
|
|
|
1442
|
|
|
$param_types = array( |
1443
|
|
|
'name' => 'string', |
1444
|
|
|
'tag' => 'tag_enum', |
1445
|
|
|
); |
1446
|
|
|
$enums = array( |
1447
|
|
|
'tag_enum' => OffsitePixelTagValues::getInstance()->getValues(), |
1448
|
|
|
); |
1449
|
|
|
|
1450
|
|
|
$request = new ApiRequest( |
1451
|
|
|
$this->api, |
1452
|
|
|
$this->data['id'], |
1453
|
|
|
RequestInterface::METHOD_POST, |
1454
|
|
|
'/offsitepixels', |
1455
|
|
|
new OffsitePixel(), |
1456
|
|
|
'EDGE', |
1457
|
|
|
OffsitePixel::getFieldsEnum()->getValues(), |
1458
|
|
|
new TypeChecker($param_types, $enums) |
1459
|
|
|
); |
1460
|
|
|
$request->addParams($params); |
1461
|
|
|
$request->addFields($fields); |
1462
|
|
|
return $pending ? $request : $request->execute(); |
1463
|
|
|
} |
1464
|
|
|
|
1465
|
|
|
public function getPartnerCategories(array $fields = array(), array $params = array(), $pending = false) { |
1466
|
|
|
$this->assureId(); |
1467
|
|
|
|
1468
|
|
|
$param_types = array( |
1469
|
|
|
'hide_pc' => 'bool', |
1470
|
|
|
'private_or_public' => 'string', |
1471
|
|
|
'targeting_type' => 'string', |
1472
|
|
|
); |
1473
|
|
|
$enums = array( |
1474
|
|
|
); |
1475
|
|
|
|
1476
|
|
|
$request = new ApiRequest( |
1477
|
|
|
$this->api, |
1478
|
|
|
$this->data['id'], |
1479
|
|
|
RequestInterface::METHOD_GET, |
1480
|
|
|
'/partnercategories', |
1481
|
|
|
new PartnerCategory(), |
1482
|
|
|
'EDGE', |
1483
|
|
|
PartnerCategory::getFieldsEnum()->getValues(), |
1484
|
|
|
new TypeChecker($param_types, $enums) |
1485
|
|
|
); |
1486
|
|
|
$request->addParams($params); |
1487
|
|
|
$request->addFields($fields); |
1488
|
|
|
return $pending ? $request : $request->execute(); |
1489
|
|
|
} |
1490
|
|
|
|
1491
|
|
|
public function getPartners(array $fields = array(), array $params = array(), $pending = false) { |
1492
|
|
|
$this->assureId(); |
1493
|
|
|
|
1494
|
|
|
$param_types = array( |
1495
|
|
|
); |
1496
|
|
|
$enums = array( |
1497
|
|
|
); |
1498
|
|
|
|
1499
|
|
|
$request = new ApiRequest( |
1500
|
|
|
$this->api, |
1501
|
|
|
$this->data['id'], |
1502
|
|
|
RequestInterface::METHOD_GET, |
1503
|
|
|
'/partners', |
1504
|
|
|
new AdsDataPartner(), |
1505
|
|
|
'EDGE', |
1506
|
|
|
AdsDataPartner::getFieldsEnum()->getValues(), |
1507
|
|
|
new TypeChecker($param_types, $enums) |
1508
|
|
|
); |
1509
|
|
|
$request->addParams($params); |
1510
|
|
|
$request->addFields($fields); |
1511
|
|
|
return $pending ? $request : $request->execute(); |
1512
|
|
|
} |
1513
|
|
|
|
1514
|
|
|
public function createProductAudience(array $fields = array(), array $params = array(), $pending = false) { |
1515
|
|
|
$this->assureId(); |
1516
|
|
|
|
1517
|
|
|
$param_types = array( |
1518
|
|
|
'associated_audience_id' => 'unsigned int', |
1519
|
|
|
'creation_params' => 'map', |
1520
|
|
|
'description' => 'string', |
1521
|
|
|
'exclusions' => 'list<Object>', |
1522
|
|
|
'inclusions' => 'list<Object>', |
1523
|
|
|
'name' => 'string', |
1524
|
|
|
'opt_out_link' => 'string', |
1525
|
|
|
'parent_audience_id' => 'unsigned int', |
1526
|
|
|
'product_set_id' => 'string', |
1527
|
|
|
'subtype' => 'subtype_enum', |
1528
|
|
|
'tags' => 'list<string>', |
1529
|
|
|
); |
1530
|
|
|
$enums = array( |
1531
|
|
|
'subtype_enum' => array( |
1532
|
|
|
'CUSTOM', |
1533
|
|
|
'WEBSITE', |
1534
|
|
|
'APP', |
1535
|
|
|
'OFFLINE', |
1536
|
|
|
'CLAIM', |
1537
|
|
|
'PARTNER', |
1538
|
|
|
'MANAGED', |
1539
|
|
|
'VIDEO', |
1540
|
|
|
'LOOKALIKE', |
1541
|
|
|
'ENGAGEMENT', |
1542
|
|
|
'DATA_SET', |
1543
|
|
|
'BAG_OF_ACCOUNTS', |
1544
|
|
|
), |
1545
|
|
|
); |
1546
|
|
|
|
1547
|
|
|
$request = new ApiRequest( |
1548
|
|
|
$this->api, |
1549
|
|
|
$this->data['id'], |
1550
|
|
|
RequestInterface::METHOD_POST, |
1551
|
|
|
'/product_audiences', |
1552
|
|
|
new AbstractCrudObject(), |
1553
|
|
|
'EDGE', |
1554
|
|
|
array(), |
1555
|
|
|
new TypeChecker($param_types, $enums) |
1556
|
|
|
); |
1557
|
|
|
$request->addParams($params); |
1558
|
|
|
$request->addFields($fields); |
1559
|
|
|
return $pending ? $request : $request->execute(); |
1560
|
|
|
} |
1561
|
|
|
|
1562
|
|
|
public function getPublisherBlockLists(array $fields = array(), array $params = array(), $pending = false) { |
1563
|
|
|
$this->assureId(); |
1564
|
|
|
|
1565
|
|
|
$param_types = array( |
1566
|
|
|
); |
1567
|
|
|
$enums = array( |
1568
|
|
|
); |
1569
|
|
|
|
1570
|
|
|
$request = new ApiRequest( |
1571
|
|
|
$this->api, |
1572
|
|
|
$this->data['id'], |
1573
|
|
|
RequestInterface::METHOD_GET, |
1574
|
|
|
'/publisher_block_lists', |
1575
|
|
|
new AbstractCrudObject(), |
1576
|
|
|
'EDGE', |
1577
|
|
|
array(), |
1578
|
|
|
new TypeChecker($param_types, $enums) |
1579
|
|
|
); |
1580
|
|
|
$request->addParams($params); |
1581
|
|
|
$request->addFields($fields); |
1582
|
|
|
return $pending ? $request : $request->execute(); |
1583
|
|
|
} |
1584
|
|
|
|
1585
|
|
|
public function createPublisherBlockList(array $fields = array(), array $params = array(), $pending = false) { |
1586
|
|
|
$this->assureId(); |
1587
|
|
|
|
1588
|
|
|
$param_types = array( |
1589
|
|
|
'name' => 'string', |
1590
|
|
|
); |
1591
|
|
|
$enums = array( |
1592
|
|
|
); |
1593
|
|
|
|
1594
|
|
|
$request = new ApiRequest( |
1595
|
|
|
$this->api, |
1596
|
|
|
$this->data['id'], |
1597
|
|
|
RequestInterface::METHOD_POST, |
1598
|
|
|
'/publisher_block_lists', |
1599
|
|
|
new AbstractCrudObject(), |
1600
|
|
|
'EDGE', |
1601
|
|
|
array(), |
1602
|
|
|
new TypeChecker($param_types, $enums) |
1603
|
|
|
); |
1604
|
|
|
$request->addParams($params); |
1605
|
|
|
$request->addFields($fields); |
1606
|
|
|
return $pending ? $request : $request->execute(); |
1607
|
|
|
} |
1608
|
|
|
|
1609
|
|
|
public function getRateCard(array $fields = array(), array $params = array(), $pending = false) { |
1610
|
|
|
$this->assureId(); |
1611
|
|
|
|
1612
|
|
|
$param_types = array( |
1613
|
|
|
); |
1614
|
|
|
$enums = array( |
1615
|
|
|
); |
1616
|
|
|
|
1617
|
|
|
$request = new ApiRequest( |
1618
|
|
|
$this->api, |
1619
|
|
|
$this->data['id'], |
1620
|
|
|
RequestInterface::METHOD_GET, |
1621
|
|
|
'/ratecard', |
1622
|
|
|
new RateCard(), |
1623
|
|
|
'EDGE', |
1624
|
|
|
RateCard::getFieldsEnum()->getValues(), |
1625
|
|
|
new TypeChecker($param_types, $enums) |
1626
|
|
|
); |
1627
|
|
|
$request->addParams($params); |
1628
|
|
|
$request->addFields($fields); |
1629
|
|
|
return $pending ? $request : $request->execute(); |
1630
|
|
|
} |
1631
|
|
|
|
1632
|
|
|
public function getReachEstimate(array $fields = array(), array $params = array(), $pending = false) { |
1633
|
|
|
$this->assureId(); |
1634
|
|
|
|
1635
|
|
|
$param_types = array( |
1636
|
|
|
'currency' => 'string', |
1637
|
|
|
'daily_budget' => 'float', |
1638
|
|
|
'object_store_url' => 'string', |
1639
|
|
|
'optimize_for' => 'optimize_for_enum', |
1640
|
|
|
'targeting_spec' => 'Targeting', |
1641
|
|
|
); |
1642
|
|
|
$enums = array( |
1643
|
|
|
'optimize_for_enum' => ReachEstimateOptimizeForValues::getInstance()->getValues(), |
1644
|
|
|
); |
1645
|
|
|
|
1646
|
|
|
$request = new ApiRequest( |
1647
|
|
|
$this->api, |
1648
|
|
|
$this->data['id'], |
1649
|
|
|
RequestInterface::METHOD_GET, |
1650
|
|
|
'/reachestimate', |
1651
|
|
|
new ReachEstimate(), |
1652
|
|
|
'EDGE', |
1653
|
|
|
ReachEstimate::getFieldsEnum()->getValues(), |
1654
|
|
|
new TypeChecker($param_types, $enums) |
1655
|
|
|
); |
1656
|
|
|
$request->addParams($params); |
1657
|
|
|
$request->addFields($fields); |
1658
|
|
|
return $pending ? $request : $request->execute(); |
1659
|
|
|
} |
1660
|
|
|
|
1661
|
|
|
public function getReachFrequencyPredictions(array $fields = array(), array $params = array(), $pending = false) { |
1662
|
|
|
$this->assureId(); |
1663
|
|
|
|
1664
|
|
|
$param_types = array( |
1665
|
|
|
); |
1666
|
|
|
$enums = array( |
1667
|
|
|
); |
1668
|
|
|
|
1669
|
|
|
$request = new ApiRequest( |
1670
|
|
|
$this->api, |
1671
|
|
|
$this->data['id'], |
1672
|
|
|
RequestInterface::METHOD_GET, |
1673
|
|
|
'/reachfrequencypredictions', |
1674
|
|
|
new ReachFrequencyPrediction(), |
1675
|
|
|
'EDGE', |
1676
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
1677
|
|
|
new TypeChecker($param_types, $enums) |
1678
|
|
|
); |
1679
|
|
|
$request->addParams($params); |
1680
|
|
|
$request->addFields($fields); |
1681
|
|
|
return $pending ? $request : $request->execute(); |
1682
|
|
|
} |
1683
|
|
|
|
1684
|
|
|
public function createReachFrequencyPrediction(array $fields = array(), array $params = array(), $pending = false) { |
1685
|
|
|
$this->assureId(); |
1686
|
|
|
|
1687
|
|
|
$param_types = array( |
1688
|
|
|
'budget' => 'unsigned int', |
1689
|
|
|
'campaign_group_id' => 'string', |
1690
|
|
|
'destination_id' => 'unsigned int', |
1691
|
|
|
'destination_ids' => 'list<string>', |
1692
|
|
|
'end_time' => 'unsigned int', |
1693
|
|
|
'frequency_cap' => 'unsigned int', |
1694
|
|
|
'interval_frequency_cap_reset_period' => 'unsigned int', |
1695
|
|
|
'num_curve_points' => 'unsigned int', |
1696
|
|
|
'objective' => 'string', |
1697
|
|
|
'prediction_mode' => 'unsigned int', |
1698
|
|
|
'reach' => 'unsigned int', |
1699
|
|
|
'rf_prediction_id_to_share' => 'string', |
1700
|
|
|
'start_time' => 'unsigned int', |
1701
|
|
|
'stop_time' => 'unsigned int', |
1702
|
|
|
'story_event_type' => 'unsigned int', |
1703
|
|
|
'target_spec' => 'Targeting', |
1704
|
|
|
); |
1705
|
|
|
$enums = array( |
1706
|
|
|
); |
1707
|
|
|
|
1708
|
|
|
$request = new ApiRequest( |
1709
|
|
|
$this->api, |
1710
|
|
|
$this->data['id'], |
1711
|
|
|
RequestInterface::METHOD_POST, |
1712
|
|
|
'/reachfrequencypredictions', |
1713
|
|
|
new ReachFrequencyPrediction(), |
1714
|
|
|
'EDGE', |
1715
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
1716
|
|
|
new TypeChecker($param_types, $enums) |
1717
|
|
|
); |
1718
|
|
|
$request->addParams($params); |
1719
|
|
|
$request->addFields($fields); |
1720
|
|
|
return $pending ? $request : $request->execute(); |
1721
|
|
|
} |
1722
|
|
|
|
1723
|
|
|
public function getRoas(array $fields = array(), array $params = array(), $pending = false) { |
1724
|
|
|
$this->assureId(); |
1725
|
|
|
|
1726
|
|
|
$param_types = array( |
1727
|
|
|
'fields' => 'list<fields_enum>', |
1728
|
|
|
'filtering' => 'list<Object>', |
1729
|
|
|
'time_increment' => 'string', |
1730
|
|
|
'time_range' => 'Object', |
1731
|
|
|
); |
1732
|
|
|
$enums = array( |
1733
|
|
|
'fields_enum' => AdAccountRoasFieldsValues::getInstance()->getValues(), |
1734
|
|
|
); |
1735
|
|
|
|
1736
|
|
|
$request = new ApiRequest( |
1737
|
|
|
$this->api, |
1738
|
|
|
$this->data['id'], |
1739
|
|
|
RequestInterface::METHOD_GET, |
1740
|
|
|
'/roas', |
1741
|
|
|
new AdAccountRoas(), |
1742
|
|
|
'EDGE', |
1743
|
|
|
AdAccountRoas::getFieldsEnum()->getValues(), |
1744
|
|
|
new TypeChecker($param_types, $enums) |
1745
|
|
|
); |
1746
|
|
|
$request->addParams($params); |
1747
|
|
|
$request->addFields($fields); |
1748
|
|
|
return $pending ? $request : $request->execute(); |
1749
|
|
|
} |
1750
|
|
|
|
1751
|
|
|
public function getTargetingBrowse(array $fields = array(), array $params = array(), $pending = false) { |
1752
|
|
|
$this->assureId(); |
1753
|
|
|
|
1754
|
|
|
$param_types = array( |
1755
|
|
|
'include_nodes' => 'bool', |
1756
|
|
|
'limit_type' => 'limit_type_enum', |
1757
|
|
|
); |
1758
|
|
|
$enums = array( |
1759
|
|
|
'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(), |
1760
|
|
|
); |
1761
|
|
|
|
1762
|
|
|
$request = new ApiRequest( |
1763
|
|
|
$this->api, |
1764
|
|
|
$this->data['id'], |
1765
|
|
|
RequestInterface::METHOD_GET, |
1766
|
|
|
'/targetingbrowse', |
1767
|
|
|
new AdAccountTargetingUnified(), |
1768
|
|
|
'EDGE', |
1769
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1770
|
|
|
new TypeChecker($param_types, $enums) |
1771
|
|
|
); |
1772
|
|
|
$request->addParams($params); |
1773
|
|
|
$request->addFields($fields); |
1774
|
|
|
return $pending ? $request : $request->execute(); |
1775
|
|
|
} |
1776
|
|
|
|
1777
|
|
|
public function getTargetingSearch(array $fields = array(), array $params = array(), $pending = false) { |
1778
|
|
|
$this->assureId(); |
1779
|
|
|
|
1780
|
|
|
$param_types = array( |
1781
|
|
|
'limit_type' => 'limit_type_enum', |
1782
|
|
|
'q' => 'string', |
1783
|
|
|
); |
1784
|
|
|
$enums = array( |
1785
|
|
|
'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(), |
1786
|
|
|
); |
1787
|
|
|
|
1788
|
|
|
$request = new ApiRequest( |
1789
|
|
|
$this->api, |
1790
|
|
|
$this->data['id'], |
1791
|
|
|
RequestInterface::METHOD_GET, |
1792
|
|
|
'/targetingsearch', |
1793
|
|
|
new AdAccountTargetingUnified(), |
1794
|
|
|
'EDGE', |
1795
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1796
|
|
|
new TypeChecker($param_types, $enums) |
1797
|
|
|
); |
1798
|
|
|
$request->addParams($params); |
1799
|
|
|
$request->addFields($fields); |
1800
|
|
|
return $pending ? $request : $request->execute(); |
1801
|
|
|
} |
1802
|
|
|
|
1803
|
|
|
public function getTargetingSentenceLines(array $fields = array(), array $params = array(), $pending = false) { |
1804
|
|
|
$this->assureId(); |
1805
|
|
|
|
1806
|
|
|
$param_types = array( |
1807
|
|
|
'discard_ages' => 'bool', |
1808
|
|
|
'discard_placements' => 'bool', |
1809
|
|
|
'targeting_spec' => 'Targeting', |
1810
|
|
|
); |
1811
|
|
|
$enums = array( |
1812
|
|
|
); |
1813
|
|
|
|
1814
|
|
|
$request = new ApiRequest( |
1815
|
|
|
$this->api, |
1816
|
|
|
$this->data['id'], |
1817
|
|
|
RequestInterface::METHOD_GET, |
1818
|
|
|
'/targetingsentencelines', |
1819
|
|
|
new TargetingSentenceLine(), |
1820
|
|
|
'EDGE', |
1821
|
|
|
TargetingSentenceLine::getFieldsEnum()->getValues(), |
1822
|
|
|
new TypeChecker($param_types, $enums) |
1823
|
|
|
); |
1824
|
|
|
$request->addParams($params); |
1825
|
|
|
$request->addFields($fields); |
1826
|
|
|
return $pending ? $request : $request->execute(); |
1827
|
|
|
} |
1828
|
|
|
|
1829
|
|
|
public function getTargetingSuggestions(array $fields = array(), array $params = array(), $pending = false) { |
1830
|
|
|
$this->assureId(); |
1831
|
|
|
|
1832
|
|
|
$param_types = array( |
1833
|
|
|
'limit_type' => 'limit_type_enum', |
1834
|
|
|
'targeting_list' => 'list<Object>', |
1835
|
|
|
); |
1836
|
|
|
$enums = array( |
1837
|
|
|
'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(), |
1838
|
|
|
); |
1839
|
|
|
|
1840
|
|
|
$request = new ApiRequest( |
1841
|
|
|
$this->api, |
1842
|
|
|
$this->data['id'], |
1843
|
|
|
RequestInterface::METHOD_GET, |
1844
|
|
|
'/targetingsuggestions', |
1845
|
|
|
new AdAccountTargetingUnified(), |
1846
|
|
|
'EDGE', |
1847
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1848
|
|
|
new TypeChecker($param_types, $enums) |
1849
|
|
|
); |
1850
|
|
|
$request->addParams($params); |
1851
|
|
|
$request->addFields($fields); |
1852
|
|
|
return $pending ? $request : $request->execute(); |
1853
|
|
|
} |
1854
|
|
|
|
1855
|
|
|
public function getTargetingValidation(array $fields = array(), array $params = array(), $pending = false) { |
1856
|
|
|
$this->assureId(); |
1857
|
|
|
|
1858
|
|
|
$param_types = array( |
1859
|
|
|
'id_list' => 'list<unsigned int>', |
1860
|
|
|
'name_list' => 'list<string>', |
1861
|
|
|
'targeting_list' => 'list<Object>', |
1862
|
|
|
); |
1863
|
|
|
$enums = array( |
1864
|
|
|
); |
1865
|
|
|
|
1866
|
|
|
$request = new ApiRequest( |
1867
|
|
|
$this->api, |
1868
|
|
|
$this->data['id'], |
1869
|
|
|
RequestInterface::METHOD_GET, |
1870
|
|
|
'/targetingvalidation', |
1871
|
|
|
new AdAccountTargetingUnified(), |
1872
|
|
|
'EDGE', |
1873
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1874
|
|
|
new TypeChecker($param_types, $enums) |
1875
|
|
|
); |
1876
|
|
|
$request->addParams($params); |
1877
|
|
|
$request->addFields($fields); |
1878
|
|
|
return $pending ? $request : $request->execute(); |
1879
|
|
|
} |
1880
|
|
|
|
1881
|
|
|
public function getTransactions(array $fields = array(), array $params = array(), $pending = false) { |
1882
|
|
|
$this->assureId(); |
1883
|
|
|
|
1884
|
|
|
$param_types = array( |
1885
|
|
|
'time_start' => 'int', |
1886
|
|
|
'time_stop' => 'int', |
1887
|
|
|
); |
1888
|
|
|
$enums = array( |
1889
|
|
|
); |
1890
|
|
|
|
1891
|
|
|
$request = new ApiRequest( |
1892
|
|
|
$this->api, |
1893
|
|
|
$this->data['id'], |
1894
|
|
|
RequestInterface::METHOD_GET, |
1895
|
|
|
'/transactions', |
1896
|
|
|
new Transaction(), |
1897
|
|
|
'EDGE', |
1898
|
|
|
Transaction::getFieldsEnum()->getValues(), |
1899
|
|
|
new TypeChecker($param_types, $enums) |
1900
|
|
|
); |
1901
|
|
|
$request->addParams($params); |
1902
|
|
|
$request->addFields($fields); |
1903
|
|
|
return $pending ? $request : $request->execute(); |
1904
|
|
|
} |
1905
|
|
|
|
1906
|
|
|
public function getUsers(array $fields = array(), array $params = array(), $pending = false) { |
1907
|
|
|
$this->assureId(); |
1908
|
|
|
|
1909
|
|
|
$param_types = array( |
1910
|
|
|
); |
1911
|
|
|
$enums = array( |
1912
|
|
|
); |
1913
|
|
|
|
1914
|
|
|
$request = new ApiRequest( |
1915
|
|
|
$this->api, |
1916
|
|
|
$this->data['id'], |
1917
|
|
|
RequestInterface::METHOD_GET, |
1918
|
|
|
'/users', |
1919
|
|
|
new AdAccountUser(), |
1920
|
|
|
'EDGE', |
1921
|
|
|
AdAccountUser::getFieldsEnum()->getValues(), |
1922
|
|
|
new TypeChecker($param_types, $enums) |
1923
|
|
|
); |
1924
|
|
|
$request->addParams($params); |
1925
|
|
|
$request->addFields($fields); |
1926
|
|
|
return $pending ? $request : $request->execute(); |
1927
|
|
|
} |
1928
|
|
|
|
1929
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
1930
|
|
|
$this->assureId(); |
1931
|
|
|
|
1932
|
|
|
$param_types = array( |
1933
|
|
|
); |
1934
|
|
|
$enums = array( |
1935
|
|
|
); |
1936
|
|
|
|
1937
|
|
|
$request = new ApiRequest( |
1938
|
|
|
$this->api, |
1939
|
|
|
$this->data['id'], |
1940
|
|
|
RequestInterface::METHOD_GET, |
1941
|
|
|
'/', |
1942
|
|
|
new AdAccount(), |
1943
|
|
|
'NODE', |
1944
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
1945
|
|
|
new TypeChecker($param_types, $enums) |
1946
|
|
|
); |
1947
|
|
|
$request->addParams($params); |
1948
|
|
|
$request->addFields($fields); |
1949
|
|
|
return $pending ? $request : $request->execute(); |
1950
|
|
|
} |
1951
|
|
|
|
1952
|
|
|
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) { |
1953
|
|
|
$this->assureId(); |
1954
|
|
|
|
1955
|
|
|
$param_types = array( |
1956
|
|
|
'agency_client_declaration' => 'map', |
1957
|
|
|
'business_info' => 'map', |
1958
|
|
|
'end_advertiser' => 'string', |
1959
|
|
|
'is_notifications_enabled' => 'bool', |
1960
|
|
|
'media_agency' => 'string', |
1961
|
|
|
'name' => 'string', |
1962
|
|
|
'partner' => 'string', |
1963
|
|
|
'redownload' => 'bool', |
1964
|
|
|
'spend_cap' => 'float', |
1965
|
|
|
'spend_cap_action' => 'string', |
1966
|
|
|
); |
1967
|
|
|
$enums = array( |
1968
|
|
|
); |
1969
|
|
|
|
1970
|
|
|
$request = new ApiRequest( |
1971
|
|
|
$this->api, |
1972
|
|
|
$this->data['id'], |
1973
|
|
|
RequestInterface::METHOD_POST, |
1974
|
|
|
'/', |
1975
|
|
|
new AdAccount(), |
1976
|
|
|
'NODE', |
1977
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
1978
|
|
|
new TypeChecker($param_types, $enums) |
1979
|
|
|
); |
1980
|
|
|
$request->addParams($params); |
1981
|
|
|
$request->addFields($fields); |
1982
|
|
|
return $pending ? $request : $request->execute(); |
1983
|
|
|
} |
1984
|
|
|
|
1985
|
|
|
/** |
1986
|
|
|
* @deprecated use getCampaignsByLabels instead |
1987
|
|
|
*/ |
1988
|
|
|
public function getCampaignsByLabel( |
1989
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
1990
|
|
|
return $this->getCampaignsByLabels($fields, $params, $pending); |
1991
|
|
|
} |
1992
|
|
|
|
1993
|
|
|
/** |
1994
|
|
|
* @deprecated use getAdSetsByLabels instead |
1995
|
|
|
*/ |
1996
|
|
|
public function getAdSetsByLabel( |
1997
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
1998
|
|
|
return $this->getAdSetsByLabels($fields, $params, $pending); |
1999
|
|
|
} |
2000
|
|
|
|
2001
|
|
|
/** |
2002
|
|
|
* @deprecated use getAdsByLabels instead |
2003
|
|
|
*/ |
2004
|
|
|
public function getAdsByLabel( |
2005
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2006
|
|
|
return $this->getAdsByLabels($fields, $params, $pending); |
2007
|
|
|
} |
2008
|
|
|
|
2009
|
|
|
/** |
2010
|
|
|
* @deprecated use getAdCreativesByLabels instead |
2011
|
|
|
*/ |
2012
|
|
|
public function getAdCreativesByLabel( |
2013
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2014
|
|
|
return $this->getAdCreativesByLabels($fields, $params, $pending); |
2015
|
|
|
} |
2016
|
|
|
|
2017
|
|
|
/** |
2018
|
|
|
* @deprecated use getUsers instead |
2019
|
|
|
*/ |
2020
|
|
|
public function getAdUsers( |
2021
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2022
|
|
|
return $this->getUsers($fields, $params, $pending); |
2023
|
|
|
} |
2024
|
|
|
|
2025
|
|
|
/** |
2026
|
|
|
* @deprecated use getGeneratePreviews instead |
2027
|
|
|
*/ |
2028
|
|
|
public function getAdPreviews( |
2029
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2030
|
|
|
return $this->getGeneratePreviews($fields, $params, $pending); |
2031
|
|
|
} |
2032
|
|
|
|
2033
|
|
|
/** |
2034
|
|
|
* @deprecated use getRateCard instead |
2035
|
|
|
*/ |
2036
|
|
|
public function getRateCards( |
2037
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2038
|
|
|
return $this->getRateCard($fields, $params, $pending); |
2039
|
|
|
} |
2040
|
|
|
|
2041
|
|
|
/** |
2042
|
|
|
* @deprecated use getTargetingSentenceLines instead |
2043
|
|
|
*/ |
2044
|
|
|
public function getTargetingDescription( |
2045
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2046
|
|
|
return $this->getTargetingSentenceLines($fields, $params, $pending); |
2047
|
|
|
} |
2048
|
|
|
|
2049
|
|
|
/** |
2050
|
|
|
* @deprecated use getBroadTargetingCategories instead |
2051
|
|
|
*/ |
2052
|
|
|
public function getBroadCategoryTargeting( |
2053
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2054
|
|
|
return $this->getBroadTargetingCategories($fields, $params, $pending); |
2055
|
|
|
} |
2056
|
|
|
|
2057
|
|
|
/** |
2058
|
|
|
* @deprecated use getOffsitePixels instead |
2059
|
|
|
*/ |
2060
|
|
|
public function getConversionPixels( |
2061
|
|
|
array $fields = array(), array $params = array(), $pending = false) { |
2062
|
|
|
return $this->getOffsitePixels($fields, $params, $pending); |
2063
|
|
|
} |
2064
|
|
|
} |
2065
|
|
|
|