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