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