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