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\AdAccountDeliveryEstimateOptimizationGoalValues; |
34
|
|
|
use FacebookAds\Object\Values\AdAccountPermittedRolesValues; |
35
|
|
|
use FacebookAds\Object\Values\AdAccountRoasFieldsValues; |
36
|
|
|
use FacebookAds\Object\Values\AdAccountTargetingUnifiedLimitTypeValues; |
37
|
|
|
use FacebookAds\Object\Values\AdActivityCategoryValues; |
38
|
|
|
use FacebookAds\Object\Values\AdCreativeApplinkTreatmentValues; |
39
|
|
|
use FacebookAds\Object\Values\AdCreativeDynamicAdVoiceValues; |
40
|
|
|
use FacebookAds\Object\Values\AdCreativeOperatorValues; |
41
|
|
|
use FacebookAds\Object\Values\AdDatePresetValues; |
42
|
|
|
use FacebookAds\Object\Values\AdExecutionOptionsValues; |
43
|
|
|
use FacebookAds\Object\Values\AdOperatorValues; |
44
|
|
|
use FacebookAds\Object\Values\AdPlacePageSetLocationTypesValues; |
45
|
|
|
use FacebookAds\Object\Values\AdPreviewAdFormatValues; |
46
|
|
|
use FacebookAds\Object\Values\AdSetBillingEventValues; |
47
|
|
|
use FacebookAds\Object\Values\AdSetDatePresetValues; |
48
|
|
|
use FacebookAds\Object\Values\AdSetEffectiveStatusValues; |
49
|
|
|
use FacebookAds\Object\Values\AdSetExecutionOptionsValues; |
50
|
|
|
use FacebookAds\Object\Values\AdSetOperatorValues; |
51
|
|
|
use FacebookAds\Object\Values\AdSetOptimizationGoalValues; |
52
|
|
|
use FacebookAds\Object\Values\AdSetStatusValues; |
53
|
|
|
use FacebookAds\Object\Values\AdStatusValues; |
54
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionAttributionWindowsValues; |
55
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionBreakdownsValues; |
56
|
|
|
use FacebookAds\Object\Values\AdsInsightsActionReportTimeValues; |
57
|
|
|
use FacebookAds\Object\Values\AdsInsightsBreakdownsValues; |
58
|
|
|
use FacebookAds\Object\Values\AdsInsightsDatePresetValues; |
59
|
|
|
use FacebookAds\Object\Values\AdsInsightsLevelValues; |
60
|
|
|
use FacebookAds\Object\Values\AdsInsightsSummaryActionBreakdownsValues; |
61
|
|
|
use FacebookAds\Object\Values\AdsInsightsSummaryValues; |
62
|
|
|
use FacebookAds\Object\Values\CampaignDatePresetValues; |
63
|
|
|
use FacebookAds\Object\Values\CampaignDeleteStrategyValues; |
64
|
|
|
use FacebookAds\Object\Values\CampaignEffectiveStatusValues; |
65
|
|
|
use FacebookAds\Object\Values\CampaignExecutionOptionsValues; |
66
|
|
|
use FacebookAds\Object\Values\CampaignObjectiveValues; |
67
|
|
|
use FacebookAds\Object\Values\CampaignOperatorValues; |
68
|
|
|
use FacebookAds\Object\Values\CampaignStatusValues; |
69
|
|
|
use FacebookAds\Object\Values\CustomAudienceClaimObjectiveValues; |
70
|
|
|
use FacebookAds\Object\Values\CustomAudienceContentTypeValues; |
71
|
|
|
use FacebookAds\Object\Values\CustomAudienceFieldsValues; |
72
|
|
|
use FacebookAds\Object\Values\CustomAudienceSubtypeValues; |
73
|
|
|
use FacebookAds\Object\Values\CustomConversionCustomEventTypeValues; |
74
|
|
|
use FacebookAds\Object\Values\OffsitePixelTagValues; |
75
|
|
|
use FacebookAds\Object\Values\PartnerCategoryPrivateOrPublicValues; |
76
|
|
|
use FacebookAds\Object\Values\ReachEstimateOptimizeForValues; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* This class is auto-genereated. |
80
|
|
|
* |
81
|
|
|
* For any issues or feature requests related to this class, please let us know |
82
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
83
|
|
|
* pull request for this class. |
84
|
|
|
* |
85
|
|
|
*/ |
86
|
|
|
|
87
|
|
|
class AdAccount extends AbstractCrudObject { |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @deprecated getEndpoint function is deprecated |
91
|
|
|
*/ |
92
|
|
|
protected function getEndpoint() { |
93
|
|
|
return 'adaccounts'; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return AdAccountFields |
98
|
|
|
*/ |
99
|
|
|
public static function getFieldsEnum() { |
100
|
|
|
return AdAccountFields::getInstance(); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
protected static function getReferencedEnums() { |
104
|
|
|
$ref_enums = array(); |
105
|
|
|
$ref_enums['AccessType'] = AdAccountAccessTypeValues::getInstance()->getValues(); |
106
|
|
|
$ref_enums['PermittedRoles'] = AdAccountPermittedRolesValues::getInstance()->getValues(); |
107
|
|
|
return $ref_enums; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
|
111
|
|
|
public function getActivities(array $fields = array(), array $params = array(), $pending = false) { |
112
|
|
|
$this->assureId(); |
113
|
|
|
|
114
|
|
|
$param_types = array( |
115
|
|
|
'add_children' => 'bool', |
116
|
|
|
'business_id' => 'string', |
117
|
|
|
'category' => 'category_enum', |
118
|
|
|
'extra_oids' => 'list<string>', |
119
|
|
|
'oid' => 'string', |
120
|
|
|
'since' => 'datetime', |
121
|
|
|
'uid' => 'int', |
122
|
|
|
'until' => 'datetime', |
123
|
|
|
); |
124
|
|
|
$enums = array( |
125
|
|
|
'category_enum' => AdActivityCategoryValues::getInstance()->getValues(), |
126
|
|
|
); |
127
|
|
|
|
128
|
|
|
$request = new ApiRequest( |
129
|
|
|
$this->api, |
130
|
|
|
$this->data['id'], |
131
|
|
|
RequestInterface::METHOD_GET, |
132
|
|
|
'/activities', |
133
|
|
|
new AdActivity(), |
134
|
|
|
'EDGE', |
135
|
|
|
AdActivity::getFieldsEnum()->getValues(), |
136
|
|
|
new TypeChecker($param_types, $enums) |
137
|
|
|
); |
138
|
|
|
$request->addParams($params); |
139
|
|
|
$request->addFields($fields); |
140
|
|
|
return $pending ? $request : $request->execute(); |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
public function getAdPlacePageSets(array $fields = array(), array $params = array(), $pending = false) { |
144
|
|
|
$this->assureId(); |
145
|
|
|
|
146
|
|
|
$param_types = array( |
147
|
|
|
); |
148
|
|
|
$enums = array( |
149
|
|
|
); |
150
|
|
|
|
151
|
|
|
$request = new ApiRequest( |
152
|
|
|
$this->api, |
153
|
|
|
$this->data['id'], |
154
|
|
|
RequestInterface::METHOD_GET, |
155
|
|
|
'/ad_place_page_sets', |
156
|
|
|
new AdPlacePageSet(), |
157
|
|
|
'EDGE', |
158
|
|
|
AdPlacePageSet::getFieldsEnum()->getValues(), |
159
|
|
|
new TypeChecker($param_types, $enums) |
160
|
|
|
); |
161
|
|
|
$request->addParams($params); |
162
|
|
|
$request->addFields($fields); |
163
|
|
|
return $pending ? $request : $request->execute(); |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
public function createAdPlacePageSet(array $fields = array(), array $params = array(), $pending = false) { |
167
|
|
|
$this->assureId(); |
168
|
|
|
|
169
|
|
|
$param_types = array( |
170
|
|
|
'location_types' => 'list<location_types_enum>', |
171
|
|
|
'name' => 'string', |
172
|
|
|
'parent_page' => 'string', |
173
|
|
|
); |
174
|
|
|
$enums = array( |
175
|
|
|
'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(), |
176
|
|
|
); |
177
|
|
|
|
178
|
|
|
$request = new ApiRequest( |
179
|
|
|
$this->api, |
180
|
|
|
$this->data['id'], |
181
|
|
|
RequestInterface::METHOD_POST, |
182
|
|
|
'/ad_place_page_sets', |
183
|
|
|
new AdPlacePageSet(), |
184
|
|
|
'EDGE', |
185
|
|
|
AdPlacePageSet::getFieldsEnum()->getValues(), |
186
|
|
|
new TypeChecker($param_types, $enums) |
187
|
|
|
); |
188
|
|
|
$request->addParams($params); |
189
|
|
|
$request->addFields($fields); |
190
|
|
|
return $pending ? $request : $request->execute(); |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) { |
194
|
|
|
$this->assureId(); |
195
|
|
|
|
196
|
|
|
$param_types = array( |
197
|
|
|
); |
198
|
|
|
$enums = array( |
199
|
|
|
); |
200
|
|
|
|
201
|
|
|
$request = new ApiRequest( |
202
|
|
|
$this->api, |
203
|
|
|
$this->data['id'], |
204
|
|
|
RequestInterface::METHOD_GET, |
205
|
|
|
'/adcreatives', |
206
|
|
|
new AdCreative(), |
207
|
|
|
'EDGE', |
208
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
209
|
|
|
new TypeChecker($param_types, $enums) |
210
|
|
|
); |
211
|
|
|
$request->addParams($params); |
212
|
|
|
$request->addFields($fields); |
213
|
|
|
return $pending ? $request : $request->execute(); |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
public function createAdCreative(array $fields = array(), array $params = array(), $pending = false) { |
217
|
|
|
$this->assureId(); |
218
|
|
|
|
219
|
|
|
$param_types = array( |
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
|
|
|
'image_crops' => 'map', |
227
|
|
|
'image_file' => 'string', |
228
|
|
|
'image_hash' => 'string', |
229
|
|
|
'image_url' => 'string', |
230
|
|
|
'instagram_actor_id' => 'string', |
231
|
|
|
'instagram_permalink_url' => 'string', |
232
|
|
|
'instagram_story_id' => 'unsigned int', |
233
|
|
|
'link_og_id' => 'string', |
234
|
|
|
'link_url' => 'string', |
235
|
|
|
'name' => 'string', |
236
|
|
|
'object_id' => 'unsigned int', |
237
|
|
|
'object_story_id' => 'string', |
238
|
|
|
'object_story_spec' => 'AdCreativeObjectStorySpec', |
239
|
|
|
'object_type' => 'string', |
240
|
|
|
'object_url' => 'string', |
241
|
|
|
'platform_customizations' => 'Object', |
242
|
|
|
'product_set_id' => 'string', |
243
|
|
|
'template_url' => 'string', |
244
|
|
|
'template_url_spec' => 'Object', |
245
|
|
|
'thumbnail_url' => 'string', |
246
|
|
|
'title' => 'string', |
247
|
|
|
'url_tags' => 'string', |
248
|
|
|
'use_page_actor_override' => 'bool', |
249
|
|
|
); |
250
|
|
|
$enums = array( |
251
|
|
|
'applink_treatment_enum' => AdCreativeApplinkTreatmentValues::getInstance()->getValues(), |
252
|
|
|
'dynamic_ad_voice_enum' => AdCreativeDynamicAdVoiceValues::getInstance()->getValues(), |
253
|
|
|
); |
254
|
|
|
|
255
|
|
|
$request = new ApiRequest( |
256
|
|
|
$this->api, |
257
|
|
|
$this->data['id'], |
258
|
|
|
RequestInterface::METHOD_POST, |
259
|
|
|
'/adcreatives', |
260
|
|
|
new AdCreative(), |
261
|
|
|
'EDGE', |
262
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
263
|
|
|
new TypeChecker($param_types, $enums) |
264
|
|
|
); |
265
|
|
|
$request->addParams($params); |
266
|
|
|
$request->addFields($fields); |
267
|
|
|
return $pending ? $request : $request->execute(); |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
public function getAdCreativesByLabels(array $fields = array(), array $params = array(), $pending = false) { |
271
|
|
|
$this->assureId(); |
272
|
|
|
|
273
|
|
|
$param_types = array( |
274
|
|
|
'ad_label_ids' => 'list<string>', |
275
|
|
|
'operator' => 'operator_enum', |
276
|
|
|
); |
277
|
|
|
$enums = array( |
278
|
|
|
'operator_enum' => AdCreativeOperatorValues::getInstance()->getValues(), |
279
|
|
|
); |
280
|
|
|
|
281
|
|
|
$request = new ApiRequest( |
282
|
|
|
$this->api, |
283
|
|
|
$this->data['id'], |
284
|
|
|
RequestInterface::METHOD_GET, |
285
|
|
|
'/adcreativesbylabels', |
286
|
|
|
new AdCreative(), |
287
|
|
|
'EDGE', |
288
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
289
|
|
|
new TypeChecker($param_types, $enums) |
290
|
|
|
); |
291
|
|
|
$request->addParams($params); |
292
|
|
|
$request->addFields($fields); |
293
|
|
|
return $pending ? $request : $request->execute(); |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
public function deleteAdImages(array $fields = array(), array $params = array(), $pending = false) { |
297
|
|
|
$this->assureId(); |
298
|
|
|
|
299
|
|
|
$param_types = array( |
300
|
|
|
'hash' => 'string', |
301
|
|
|
); |
302
|
|
|
$enums = array( |
303
|
|
|
); |
304
|
|
|
|
305
|
|
|
$request = new ApiRequest( |
306
|
|
|
$this->api, |
307
|
|
|
$this->data['id'], |
308
|
|
|
RequestInterface::METHOD_DELETE, |
309
|
|
|
'/adimages', |
310
|
|
|
new AbstractCrudObject(), |
311
|
|
|
'EDGE', |
312
|
|
|
array(), |
313
|
|
|
new TypeChecker($param_types, $enums) |
314
|
|
|
); |
315
|
|
|
$request->addParams($params); |
316
|
|
|
$request->addFields($fields); |
317
|
|
|
return $pending ? $request : $request->execute(); |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
public function getAdImages(array $fields = array(), array $params = array(), $pending = false) { |
321
|
|
|
$this->assureId(); |
322
|
|
|
|
323
|
|
|
$param_types = array( |
324
|
|
|
'biz_tag_id' => 'unsigned int', |
325
|
|
|
'business_id' => 'string', |
326
|
|
|
'hashes' => 'list<string>', |
327
|
|
|
'minheight' => 'unsigned int', |
328
|
|
|
'minwidth' => 'unsigned int', |
329
|
|
|
'name' => 'string', |
330
|
|
|
); |
331
|
|
|
$enums = array( |
332
|
|
|
); |
333
|
|
|
|
334
|
|
|
$request = new ApiRequest( |
335
|
|
|
$this->api, |
336
|
|
|
$this->data['id'], |
337
|
|
|
RequestInterface::METHOD_GET, |
338
|
|
|
'/adimages', |
339
|
|
|
new AdImage(), |
340
|
|
|
'EDGE', |
341
|
|
|
AdImage::getFieldsEnum()->getValues(), |
342
|
|
|
new TypeChecker($param_types, $enums) |
343
|
|
|
); |
344
|
|
|
$request->addParams($params); |
345
|
|
|
$request->addFields($fields); |
346
|
|
|
return $pending ? $request : $request->execute(); |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
public function createAdImage(array $fields = array(), array $params = array(), $pending = false) { |
350
|
|
|
$this->assureId(); |
351
|
|
|
|
352
|
|
|
$param_types = array( |
353
|
|
|
'bytes' => 'Object', |
354
|
|
|
'copy_from' => 'Object', |
355
|
|
|
'zipbytes' => 'Object', |
356
|
|
|
); |
357
|
|
|
$enums = array( |
358
|
|
|
); |
359
|
|
|
|
360
|
|
|
$request = new ApiRequest( |
361
|
|
|
$this->api, |
362
|
|
|
$this->data['id'], |
363
|
|
|
RequestInterface::METHOD_POST, |
364
|
|
|
'/adimages', |
365
|
|
|
new AdImage(), |
366
|
|
|
'EDGE', |
367
|
|
|
AdImage::getFieldsEnum()->getValues(), |
368
|
|
|
new TypeChecker($param_types, $enums), |
369
|
|
|
true |
370
|
|
|
); |
371
|
|
|
$request->addParams($params); |
372
|
|
|
$request->addFields($fields); |
373
|
|
|
return $pending ? $request : $request->execute(); |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
public function getAdLabels(array $fields = array(), array $params = array(), $pending = false) { |
377
|
|
|
$this->assureId(); |
378
|
|
|
|
379
|
|
|
$param_types = array( |
380
|
|
|
); |
381
|
|
|
$enums = array( |
382
|
|
|
); |
383
|
|
|
|
384
|
|
|
$request = new ApiRequest( |
385
|
|
|
$this->api, |
386
|
|
|
$this->data['id'], |
387
|
|
|
RequestInterface::METHOD_GET, |
388
|
|
|
'/adlabels', |
389
|
|
|
new AdLabel(), |
390
|
|
|
'EDGE', |
391
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
392
|
|
|
new TypeChecker($param_types, $enums) |
393
|
|
|
); |
394
|
|
|
$request->addParams($params); |
395
|
|
|
$request->addFields($fields); |
396
|
|
|
return $pending ? $request : $request->execute(); |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
public function createAdLabel(array $fields = array(), array $params = array(), $pending = false) { |
400
|
|
|
$this->assureId(); |
401
|
|
|
|
402
|
|
|
$param_types = array( |
403
|
|
|
'name' => 'string', |
404
|
|
|
); |
405
|
|
|
$enums = array( |
406
|
|
|
); |
407
|
|
|
|
408
|
|
|
$request = new ApiRequest( |
409
|
|
|
$this->api, |
410
|
|
|
$this->data['id'], |
411
|
|
|
RequestInterface::METHOD_POST, |
412
|
|
|
'/adlabels', |
413
|
|
|
new AdLabel(), |
414
|
|
|
'EDGE', |
415
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
416
|
|
|
new TypeChecker($param_types, $enums) |
417
|
|
|
); |
418
|
|
|
$request->addParams($params); |
419
|
|
|
$request->addFields($fields); |
420
|
|
|
return $pending ? $request : $request->execute(); |
421
|
|
|
} |
422
|
|
|
|
423
|
|
|
public function getAdReportRuns(array $fields = array(), array $params = array(), $pending = false) { |
424
|
|
|
$this->assureId(); |
425
|
|
|
|
426
|
|
|
$param_types = array( |
427
|
|
|
); |
428
|
|
|
$enums = array( |
429
|
|
|
); |
430
|
|
|
|
431
|
|
|
$request = new ApiRequest( |
432
|
|
|
$this->api, |
433
|
|
|
$this->data['id'], |
434
|
|
|
RequestInterface::METHOD_GET, |
435
|
|
|
'/adreportruns', |
436
|
|
|
new AdReportRun(), |
437
|
|
|
'EDGE', |
438
|
|
|
AdReportRun::getFieldsEnum()->getValues(), |
439
|
|
|
new TypeChecker($param_types, $enums) |
440
|
|
|
); |
441
|
|
|
$request->addParams($params); |
442
|
|
|
$request->addFields($fields); |
443
|
|
|
return $pending ? $request : $request->execute(); |
444
|
|
|
} |
445
|
|
|
|
446
|
|
|
public function getAdReportSchedules(array $fields = array(), array $params = array(), $pending = false) { |
447
|
|
|
$this->assureId(); |
448
|
|
|
|
449
|
|
|
$param_types = array( |
450
|
|
|
); |
451
|
|
|
$enums = array( |
452
|
|
|
); |
453
|
|
|
|
454
|
|
|
$request = new ApiRequest( |
455
|
|
|
$this->api, |
456
|
|
|
$this->data['id'], |
457
|
|
|
RequestInterface::METHOD_GET, |
458
|
|
|
'/adreportschedules', |
459
|
|
|
new AbstractCrudObject(), |
460
|
|
|
'EDGE', |
461
|
|
|
array(), |
462
|
|
|
new TypeChecker($param_types, $enums) |
463
|
|
|
); |
464
|
|
|
$request->addParams($params); |
465
|
|
|
$request->addFields($fields); |
466
|
|
|
return $pending ? $request : $request->execute(); |
467
|
|
|
} |
468
|
|
|
|
469
|
|
|
public function getAds(array $fields = array(), array $params = array(), $pending = false) { |
470
|
|
|
$this->assureId(); |
471
|
|
|
|
472
|
|
|
$param_types = array( |
473
|
|
|
'ad_draft_id' => 'string', |
474
|
|
|
'date_preset' => 'date_preset_enum', |
475
|
|
|
'effective_status' => 'list<string>', |
476
|
|
|
'include_deleted' => 'bool', |
477
|
|
|
'time_range' => 'Object', |
478
|
|
|
'updated_since' => 'int', |
479
|
|
|
); |
480
|
|
|
$enums = array( |
481
|
|
|
'date_preset_enum' => AdDatePresetValues::getInstance()->getValues(), |
482
|
|
|
); |
483
|
|
|
|
484
|
|
|
$request = new ApiRequest( |
485
|
|
|
$this->api, |
486
|
|
|
$this->data['id'], |
487
|
|
|
RequestInterface::METHOD_GET, |
488
|
|
|
'/ads', |
489
|
|
|
new Ad(), |
490
|
|
|
'EDGE', |
491
|
|
|
Ad::getFieldsEnum()->getValues(), |
492
|
|
|
new TypeChecker($param_types, $enums) |
493
|
|
|
); |
494
|
|
|
$request->addParams($params); |
495
|
|
|
$request->addFields($fields); |
496
|
|
|
return $pending ? $request : $request->execute(); |
497
|
|
|
} |
498
|
|
|
|
499
|
|
|
public function createAd(array $fields = array(), array $params = array(), $pending = false) { |
500
|
|
|
$this->assureId(); |
501
|
|
|
|
502
|
|
|
$param_types = array( |
503
|
|
|
'adlabels' => 'list<Object>', |
504
|
|
|
'adset_id' => 'unsigned int', |
505
|
|
|
'adset_spec' => 'AdSet', |
506
|
|
|
'bid_amount' => 'int', |
507
|
|
|
'creative' => 'AdCreative', |
508
|
|
|
'date_format' => 'string', |
509
|
|
|
'display_sequence' => 'unsigned int', |
510
|
|
|
'execution_options' => 'list<execution_options_enum>', |
511
|
|
|
'name' => 'string', |
512
|
|
|
'redownload' => 'bool', |
513
|
|
|
'status' => 'status_enum', |
514
|
|
|
'tracking_specs' => 'Object', |
515
|
|
|
); |
516
|
|
|
$enums = array( |
517
|
|
|
'execution_options_enum' => AdExecutionOptionsValues::getInstance()->getValues(), |
518
|
|
|
'status_enum' => AdStatusValues::getInstance()->getValues(), |
519
|
|
|
); |
520
|
|
|
|
521
|
|
|
$request = new ApiRequest( |
522
|
|
|
$this->api, |
523
|
|
|
$this->data['id'], |
524
|
|
|
RequestInterface::METHOD_POST, |
525
|
|
|
'/ads', |
526
|
|
|
new Ad(), |
527
|
|
|
'EDGE', |
528
|
|
|
Ad::getFieldsEnum()->getValues(), |
529
|
|
|
new TypeChecker($param_types, $enums), |
530
|
|
|
true |
531
|
|
|
); |
532
|
|
|
$request->addParams($params); |
533
|
|
|
$request->addFields($fields); |
534
|
|
|
return $pending ? $request : $request->execute(); |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
public function getAdsByLabels(array $fields = array(), array $params = array(), $pending = false) { |
538
|
|
|
$this->assureId(); |
539
|
|
|
|
540
|
|
|
$param_types = array( |
541
|
|
|
'ad_label_ids' => 'list<string>', |
542
|
|
|
'operator' => 'operator_enum', |
543
|
|
|
); |
544
|
|
|
$enums = array( |
545
|
|
|
'operator_enum' => AdOperatorValues::getInstance()->getValues(), |
546
|
|
|
); |
547
|
|
|
|
548
|
|
|
$request = new ApiRequest( |
549
|
|
|
$this->api, |
550
|
|
|
$this->data['id'], |
551
|
|
|
RequestInterface::METHOD_GET, |
552
|
|
|
'/adsbylabels', |
553
|
|
|
new Ad(), |
554
|
|
|
'EDGE', |
555
|
|
|
Ad::getFieldsEnum()->getValues(), |
556
|
|
|
new TypeChecker($param_types, $enums) |
557
|
|
|
); |
558
|
|
|
$request->addParams($params); |
559
|
|
|
$request->addFields($fields); |
560
|
|
|
return $pending ? $request : $request->execute(); |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
public function getAdSets(array $fields = array(), array $params = array(), $pending = false) { |
564
|
|
|
$this->assureId(); |
565
|
|
|
|
566
|
|
|
$param_types = array( |
567
|
|
|
'ad_draft_id' => 'string', |
568
|
|
|
'date_preset' => 'date_preset_enum', |
569
|
|
|
'effective_status' => 'list<effective_status_enum>', |
570
|
|
|
'include_deleted' => 'bool', |
571
|
|
|
'is_completed' => 'bool', |
572
|
|
|
'time_range' => 'Object', |
573
|
|
|
); |
574
|
|
|
$enums = array( |
575
|
|
|
'date_preset_enum' => AdSetDatePresetValues::getInstance()->getValues(), |
576
|
|
|
'effective_status_enum' => AdSetEffectiveStatusValues::getInstance()->getValues(), |
577
|
|
|
); |
578
|
|
|
|
579
|
|
|
$request = new ApiRequest( |
580
|
|
|
$this->api, |
581
|
|
|
$this->data['id'], |
582
|
|
|
RequestInterface::METHOD_GET, |
583
|
|
|
'/adsets', |
584
|
|
|
new AdSet(), |
585
|
|
|
'EDGE', |
586
|
|
|
AdSet::getFieldsEnum()->getValues(), |
587
|
|
|
new TypeChecker($param_types, $enums) |
588
|
|
|
); |
589
|
|
|
$request->addParams($params); |
590
|
|
|
$request->addFields($fields); |
591
|
|
|
return $pending ? $request : $request->execute(); |
592
|
|
|
} |
593
|
|
|
|
594
|
|
|
public function createAdSet(array $fields = array(), array $params = array(), $pending = false) { |
595
|
|
|
$this->assureId(); |
596
|
|
|
|
597
|
|
|
$param_types = array( |
598
|
|
|
'adlabels' => 'list<Object>', |
599
|
|
|
'adset_schedule' => 'list<Object>', |
600
|
|
|
'attribution_spec' => 'list<map>', |
601
|
|
|
'bid_amount' => 'int', |
602
|
|
|
'billing_event' => 'billing_event_enum', |
603
|
|
|
'campaign_id' => 'string', |
604
|
|
|
'campaign_spec' => 'Object', |
605
|
|
|
'creative_sequence' => 'list<string>', |
606
|
|
|
'daily_budget' => 'unsigned int', |
607
|
|
|
'daily_imps' => 'unsigned int', |
608
|
|
|
'end_time' => 'datetime', |
609
|
|
|
'execution_options' => 'list<execution_options_enum>', |
610
|
|
|
'frequency_control_specs' => 'list<Object>', |
611
|
|
|
'is_autobid' => 'bool', |
612
|
|
|
'is_average_price_pacing' => 'bool', |
613
|
|
|
'lifetime_budget' => 'unsigned int', |
614
|
|
|
'lifetime_imps' => 'unsigned int', |
615
|
|
|
'name' => 'string', |
616
|
|
|
'optimization_goal' => 'optimization_goal_enum', |
617
|
|
|
'pacing_type' => 'list<string>', |
618
|
|
|
'promoted_object' => 'Object', |
619
|
|
|
'redownload' => 'bool', |
620
|
|
|
'rf_prediction_id' => 'string', |
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_fov' => 'unsigned int', |
787
|
|
|
'original_projection_type' => 'original_projection_type_enum', |
788
|
|
|
'referenced_sticker_id' => 'string', |
789
|
|
|
'slideshow_spec' => 'map', |
790
|
|
|
'start_offset' => 'unsigned int', |
791
|
|
|
'time_since_original_post' => 'unsigned int', |
792
|
|
|
'title' => 'string', |
793
|
|
|
'unpublished_content_type' => 'unpublished_content_type_enum', |
794
|
|
|
'upload_phase' => 'upload_phase_enum', |
795
|
|
|
'upload_session_id' => 'string', |
796
|
|
|
'video_file_chunk' => 'string', |
797
|
|
|
); |
798
|
|
|
$enums = array( |
799
|
|
|
'original_projection_type_enum' => array( |
800
|
|
|
'equirectangular', |
801
|
|
|
'cubemap', |
802
|
|
|
), |
803
|
|
|
'unpublished_content_type_enum' => array( |
804
|
|
|
'SCHEDULED', |
805
|
|
|
'DRAFT', |
806
|
|
|
'ADS_POST', |
807
|
|
|
), |
808
|
|
|
'upload_phase_enum' => array( |
809
|
|
|
'start', |
810
|
|
|
'transfer', |
811
|
|
|
'finish', |
812
|
|
|
'cancel', |
813
|
|
|
), |
814
|
|
|
); |
815
|
|
|
|
816
|
|
|
$request = new ApiRequest( |
817
|
|
|
$this->api, |
818
|
|
|
$this->data['id'], |
819
|
|
|
RequestInterface::METHOD_POST, |
820
|
|
|
'/advideos', |
821
|
|
|
new AbstractCrudObject(), |
822
|
|
|
'EDGE', |
823
|
|
|
array(), |
824
|
|
|
new TypeChecker($param_types, $enums), |
825
|
|
|
true, |
826
|
|
|
true |
827
|
|
|
); |
828
|
|
|
$request->addParams($params); |
829
|
|
|
$request->addFields($fields); |
830
|
|
|
return $pending ? $request : $request->execute(); |
831
|
|
|
} |
832
|
|
|
|
833
|
|
|
public function getApplications(array $fields = array(), array $params = array(), $pending = false) { |
834
|
|
|
$this->assureId(); |
835
|
|
|
|
836
|
|
|
$param_types = array( |
837
|
|
|
); |
838
|
|
|
$enums = array( |
839
|
|
|
); |
840
|
|
|
|
841
|
|
|
$request = new ApiRequest( |
842
|
|
|
$this->api, |
843
|
|
|
$this->data['id'], |
844
|
|
|
RequestInterface::METHOD_GET, |
845
|
|
|
'/applications', |
846
|
|
|
new AbstractCrudObject(), |
847
|
|
|
'EDGE', |
848
|
|
|
array(), |
849
|
|
|
new TypeChecker($param_types, $enums) |
850
|
|
|
); |
851
|
|
|
$request->addParams($params); |
852
|
|
|
$request->addFields($fields); |
853
|
|
|
return $pending ? $request : $request->execute(); |
854
|
|
|
} |
855
|
|
|
|
856
|
|
|
public function getAsyncAdRequestSets(array $fields = array(), array $params = array(), $pending = false) { |
857
|
|
|
$this->assureId(); |
858
|
|
|
|
859
|
|
|
$param_types = array( |
860
|
|
|
'is_completed' => 'bool', |
861
|
|
|
); |
862
|
|
|
$enums = array( |
863
|
|
|
); |
864
|
|
|
|
865
|
|
|
$request = new ApiRequest( |
866
|
|
|
$this->api, |
867
|
|
|
$this->data['id'], |
868
|
|
|
RequestInterface::METHOD_GET, |
869
|
|
|
'/asyncadrequestsets', |
870
|
|
|
new AdAsyncRequestSet(), |
871
|
|
|
'EDGE', |
872
|
|
|
AdAsyncRequestSet::getFieldsEnum()->getValues(), |
873
|
|
|
new TypeChecker($param_types, $enums) |
874
|
|
|
); |
875
|
|
|
$request->addParams($params); |
876
|
|
|
$request->addFields($fields); |
877
|
|
|
return $pending ? $request : $request->execute(); |
878
|
|
|
} |
879
|
|
|
|
880
|
|
|
public function createAsyncAdRequestSet(array $fields = array(), array $params = array(), $pending = false) { |
881
|
|
|
$this->assureId(); |
882
|
|
|
|
883
|
|
|
$param_types = array( |
884
|
|
|
'ad_specs' => 'list<map>', |
885
|
|
|
'name' => 'string', |
886
|
|
|
'notification_mode' => 'notification_mode_enum', |
887
|
|
|
'notification_uri' => 'string', |
888
|
|
|
); |
889
|
|
|
$enums = array( |
890
|
|
|
'notification_mode_enum' => array( |
891
|
|
|
'OFF', |
892
|
|
|
'ON_COMPLETE', |
893
|
|
|
), |
894
|
|
|
); |
895
|
|
|
|
896
|
|
|
$request = new ApiRequest( |
897
|
|
|
$this->api, |
898
|
|
|
$this->data['id'], |
899
|
|
|
RequestInterface::METHOD_POST, |
900
|
|
|
'/asyncadrequestsets', |
901
|
|
|
new AdAsyncRequestSet(), |
902
|
|
|
'EDGE', |
903
|
|
|
AdAsyncRequestSet::getFieldsEnum()->getValues(), |
904
|
|
|
new TypeChecker($param_types, $enums) |
905
|
|
|
); |
906
|
|
|
$request->addParams($params); |
907
|
|
|
$request->addFields($fields); |
908
|
|
|
return $pending ? $request : $request->execute(); |
909
|
|
|
} |
910
|
|
|
|
911
|
|
|
public function getBroadTargetingCategories(array $fields = array(), array $params = array(), $pending = false) { |
912
|
|
|
$this->assureId(); |
913
|
|
|
|
914
|
|
|
$param_types = array( |
915
|
|
|
'custom_categories_only' => 'bool', |
916
|
|
|
); |
917
|
|
|
$enums = array( |
918
|
|
|
); |
919
|
|
|
|
920
|
|
|
$request = new ApiRequest( |
921
|
|
|
$this->api, |
922
|
|
|
$this->data['id'], |
923
|
|
|
RequestInterface::METHOD_GET, |
924
|
|
|
'/broadtargetingcategories', |
925
|
|
|
new BroadTargetingCategories(), |
926
|
|
|
'EDGE', |
927
|
|
|
BroadTargetingCategories::getFieldsEnum()->getValues(), |
928
|
|
|
new TypeChecker($param_types, $enums) |
929
|
|
|
); |
930
|
|
|
$request->addParams($params); |
931
|
|
|
$request->addFields($fields); |
932
|
|
|
return $pending ? $request : $request->execute(); |
933
|
|
|
} |
934
|
|
|
|
935
|
|
|
public function deleteCampaigns(array $fields = array(), array $params = array(), $pending = false) { |
936
|
|
|
$this->assureId(); |
937
|
|
|
|
938
|
|
|
$param_types = array( |
939
|
|
|
'before_date' => 'datetime', |
940
|
|
|
'delete_strategy' => 'delete_strategy_enum', |
941
|
|
|
'object_count' => 'int', |
942
|
|
|
); |
943
|
|
|
$enums = array( |
944
|
|
|
'delete_strategy_enum' => CampaignDeleteStrategyValues::getInstance()->getValues(), |
945
|
|
|
); |
946
|
|
|
|
947
|
|
|
$request = new ApiRequest( |
948
|
|
|
$this->api, |
949
|
|
|
$this->data['id'], |
950
|
|
|
RequestInterface::METHOD_DELETE, |
951
|
|
|
'/campaigns', |
952
|
|
|
new AbstractCrudObject(), |
953
|
|
|
'EDGE', |
954
|
|
|
array(), |
955
|
|
|
new TypeChecker($param_types, $enums) |
956
|
|
|
); |
957
|
|
|
$request->addParams($params); |
958
|
|
|
$request->addFields($fields); |
959
|
|
|
return $pending ? $request : $request->execute(); |
960
|
|
|
} |
961
|
|
|
|
962
|
|
|
public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) { |
963
|
|
|
$this->assureId(); |
964
|
|
|
|
965
|
|
|
$param_types = array( |
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
|
|
|
'custom_event_type' => 'custom_event_type_enum', |
1152
|
|
|
'default_conversion_value' => 'float', |
1153
|
|
|
'description' => 'string', |
1154
|
|
|
'event_source_id' => 'string', |
1155
|
|
|
'name' => 'string', |
1156
|
|
|
'rule' => 'string', |
1157
|
|
|
); |
1158
|
|
|
$enums = array( |
1159
|
|
|
'custom_event_type_enum' => CustomConversionCustomEventTypeValues::getInstance()->getValues(), |
1160
|
|
|
); |
1161
|
|
|
|
1162
|
|
|
$request = new ApiRequest( |
1163
|
|
|
$this->api, |
1164
|
|
|
$this->data['id'], |
1165
|
|
|
RequestInterface::METHOD_POST, |
1166
|
|
|
'/customconversions', |
1167
|
|
|
new CustomConversion(), |
1168
|
|
|
'EDGE', |
1169
|
|
|
CustomConversion::getFieldsEnum()->getValues(), |
1170
|
|
|
new TypeChecker($param_types, $enums) |
1171
|
|
|
); |
1172
|
|
|
$request->addParams($params); |
1173
|
|
|
$request->addFields($fields); |
1174
|
|
|
return $pending ? $request : $request->execute(); |
1175
|
|
|
} |
1176
|
|
|
|
1177
|
|
|
public function getDeliveryEstimate(array $fields = array(), array $params = array(), $pending = false) { |
1178
|
|
|
$this->assureId(); |
1179
|
|
|
|
1180
|
|
|
$param_types = array( |
1181
|
|
|
'optimization_goal' => 'optimization_goal_enum', |
1182
|
|
|
'promoted_object' => 'Object', |
1183
|
|
|
'targeting_spec' => 'Targeting', |
1184
|
|
|
); |
1185
|
|
|
$enums = array( |
1186
|
|
|
'optimization_goal_enum' => AdAccountDeliveryEstimateOptimizationGoalValues::getInstance()->getValues(), |
1187
|
|
|
); |
1188
|
|
|
|
1189
|
|
|
$request = new ApiRequest( |
1190
|
|
|
$this->api, |
1191
|
|
|
$this->data['id'], |
1192
|
|
|
RequestInterface::METHOD_GET, |
1193
|
|
|
'/delivery_estimate', |
1194
|
|
|
new AdAccountDeliveryEstimate(), |
1195
|
|
|
'EDGE', |
1196
|
|
|
AdAccountDeliveryEstimate::getFieldsEnum()->getValues(), |
1197
|
|
|
new TypeChecker($param_types, $enums) |
1198
|
|
|
); |
1199
|
|
|
$request->addParams($params); |
1200
|
|
|
$request->addFields($fields); |
1201
|
|
|
return $pending ? $request : $request->execute(); |
1202
|
|
|
} |
1203
|
|
|
|
1204
|
|
|
public function getGeneratePreviews(array $fields = array(), array $params = array(), $pending = false) { |
1205
|
|
|
$this->assureId(); |
1206
|
|
|
|
1207
|
|
|
$param_types = array( |
1208
|
|
|
'ad_format' => 'ad_format_enum', |
1209
|
|
|
'creative' => 'AdCreative', |
1210
|
|
|
'end_date' => 'datetime', |
1211
|
|
|
'height' => 'unsigned int', |
1212
|
|
|
'locale' => 'string', |
1213
|
|
|
'place_page_id' => 'int', |
1214
|
|
|
'post' => 'Object', |
1215
|
|
|
'product_item_ids' => 'list<string>', |
1216
|
|
|
'start_date' => 'datetime', |
1217
|
|
|
'width' => 'unsigned int', |
1218
|
|
|
); |
1219
|
|
|
$enums = array( |
1220
|
|
|
'ad_format_enum' => AdPreviewAdFormatValues::getInstance()->getValues(), |
1221
|
|
|
); |
1222
|
|
|
|
1223
|
|
|
$request = new ApiRequest( |
1224
|
|
|
$this->api, |
1225
|
|
|
$this->data['id'], |
1226
|
|
|
RequestInterface::METHOD_GET, |
1227
|
|
|
'/generatepreviews', |
1228
|
|
|
new AdPreview(), |
1229
|
|
|
'EDGE', |
1230
|
|
|
AdPreview::getFieldsEnum()->getValues(), |
1231
|
|
|
new TypeChecker($param_types, $enums) |
1232
|
|
|
); |
1233
|
|
|
$request->addParams($params); |
1234
|
|
|
$request->addFields($fields); |
1235
|
|
|
return $pending ? $request : $request->execute(); |
1236
|
|
|
} |
1237
|
|
|
|
1238
|
|
|
public function getInsights(array $fields = array(), array $params = array(), $pending = false) { |
1239
|
|
|
$this->assureId(); |
1240
|
|
|
|
1241
|
|
|
$param_types = array( |
1242
|
|
|
'action_attribution_windows' => 'list<action_attribution_windows_enum>', |
1243
|
|
|
'action_breakdowns' => 'list<action_breakdowns_enum>', |
1244
|
|
|
'action_report_time' => 'action_report_time_enum', |
1245
|
|
|
'breakdowns' => 'list<breakdowns_enum>', |
1246
|
|
|
'date_preset' => 'date_preset_enum', |
1247
|
|
|
'default_summary' => 'bool', |
1248
|
|
|
'export_columns' => 'list<string>', |
1249
|
|
|
'export_format' => 'string', |
1250
|
|
|
'export_name' => 'string', |
1251
|
|
|
'fields' => 'list<fields_enum>', |
1252
|
|
|
'filtering' => 'list<Object>', |
1253
|
|
|
'level' => 'level_enum', |
1254
|
|
|
'product_id_limit' => 'int', |
1255
|
|
|
'sort' => 'list<string>', |
1256
|
|
|
'summary' => 'list<summary_enum>', |
1257
|
|
|
'summary_action_breakdowns' => 'list<summary_action_breakdowns_enum>', |
1258
|
|
|
'time_increment' => 'string', |
1259
|
|
|
'time_range' => 'Object', |
1260
|
|
|
'time_ranges' => 'list<Object>', |
1261
|
|
|
'use_account_attribution_setting' => 'bool', |
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
|
|
|
'use_account_attribution_setting' => 'bool', |
1313
|
|
|
); |
1314
|
|
|
$enums = array( |
1315
|
|
|
'action_attribution_windows_enum' => AdsInsightsActionAttributionWindowsValues::getInstance()->getValues(), |
1316
|
|
|
'action_breakdowns_enum' => AdsInsightsActionBreakdownsValues::getInstance()->getValues(), |
1317
|
|
|
'action_report_time_enum' => AdsInsightsActionReportTimeValues::getInstance()->getValues(), |
1318
|
|
|
'breakdowns_enum' => AdsInsightsBreakdownsValues::getInstance()->getValues(), |
1319
|
|
|
'date_preset_enum' => AdsInsightsDatePresetValues::getInstance()->getValues(), |
1320
|
|
|
'summary_enum' => AdsInsightsSummaryValues::getInstance()->getValues(), |
1321
|
|
|
'level_enum' => AdsInsightsLevelValues::getInstance()->getValues(), |
1322
|
|
|
'summary_action_breakdowns_enum' => AdsInsightsSummaryActionBreakdownsValues::getInstance()->getValues(), |
1323
|
|
|
); |
1324
|
|
|
|
1325
|
|
|
$request = new ApiRequest( |
1326
|
|
|
$this->api, |
1327
|
|
|
$this->data['id'], |
1328
|
|
|
RequestInterface::METHOD_POST, |
1329
|
|
|
'/insights', |
1330
|
|
|
new AdReportRun(), |
1331
|
|
|
'EDGE', |
1332
|
|
|
AdReportRun::getFieldsEnum()->getValues(), |
1333
|
|
|
new TypeChecker($param_types, $enums) |
1334
|
|
|
); |
1335
|
|
|
$request->addParams($params); |
1336
|
|
|
$request->addFields($fields); |
1337
|
|
|
return $pending ? $request : $request->execute(); |
1338
|
|
|
} |
1339
|
|
|
|
1340
|
|
|
public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
1341
|
|
|
$this->assureId(); |
1342
|
|
|
|
1343
|
|
|
$param_types = array( |
1344
|
|
|
); |
1345
|
|
|
$enums = array( |
1346
|
|
|
); |
1347
|
|
|
|
1348
|
|
|
$request = new ApiRequest( |
1349
|
|
|
$this->api, |
1350
|
|
|
$this->data['id'], |
1351
|
|
|
RequestInterface::METHOD_GET, |
1352
|
|
|
'/instagram_accounts', |
1353
|
|
|
new AbstractCrudObject(), |
1354
|
|
|
'EDGE', |
1355
|
|
|
array(), |
1356
|
|
|
new TypeChecker($param_types, $enums) |
1357
|
|
|
); |
1358
|
|
|
$request->addParams($params); |
1359
|
|
|
$request->addFields($fields); |
1360
|
|
|
return $pending ? $request : $request->execute(); |
1361
|
|
|
} |
1362
|
|
|
|
1363
|
|
|
public function getLeadGenForms(array $fields = array(), array $params = array(), $pending = false) { |
1364
|
|
|
$this->assureId(); |
1365
|
|
|
|
1366
|
|
|
$param_types = array( |
1367
|
|
|
'query' => 'string', |
1368
|
|
|
); |
1369
|
|
|
$enums = array( |
1370
|
|
|
); |
1371
|
|
|
|
1372
|
|
|
$request = new ApiRequest( |
1373
|
|
|
$this->api, |
1374
|
|
|
$this->data['id'], |
1375
|
|
|
RequestInterface::METHOD_GET, |
1376
|
|
|
'/leadgen_forms', |
1377
|
|
|
new LeadgenForm(), |
1378
|
|
|
'EDGE', |
1379
|
|
|
LeadgenForm::getFieldsEnum()->getValues(), |
1380
|
|
|
new TypeChecker($param_types, $enums) |
1381
|
|
|
); |
1382
|
|
|
$request->addParams($params); |
1383
|
|
|
$request->addFields($fields); |
1384
|
|
|
return $pending ? $request : $request->execute(); |
1385
|
|
|
} |
1386
|
|
|
|
1387
|
|
|
public function getMinimumBudgets(array $fields = array(), array $params = array(), $pending = false) { |
1388
|
|
|
$this->assureId(); |
1389
|
|
|
|
1390
|
|
|
$param_types = array( |
1391
|
|
|
'bid_amount' => 'int', |
1392
|
|
|
); |
1393
|
|
|
$enums = array( |
1394
|
|
|
); |
1395
|
|
|
|
1396
|
|
|
$request = new ApiRequest( |
1397
|
|
|
$this->api, |
1398
|
|
|
$this->data['id'], |
1399
|
|
|
RequestInterface::METHOD_GET, |
1400
|
|
|
'/minimum_budgets', |
1401
|
|
|
new MinimumBudget(), |
1402
|
|
|
'EDGE', |
1403
|
|
|
MinimumBudget::getFieldsEnum()->getValues(), |
1404
|
|
|
new TypeChecker($param_types, $enums) |
1405
|
|
|
); |
1406
|
|
|
$request->addParams($params); |
1407
|
|
|
$request->addFields($fields); |
1408
|
|
|
return $pending ? $request : $request->execute(); |
1409
|
|
|
} |
1410
|
|
|
|
1411
|
|
|
public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) { |
1412
|
|
|
$this->assureId(); |
1413
|
|
|
|
1414
|
|
|
$param_types = array( |
1415
|
|
|
); |
1416
|
|
|
$enums = array( |
1417
|
|
|
); |
1418
|
|
|
|
1419
|
|
|
$request = new ApiRequest( |
1420
|
|
|
$this->api, |
1421
|
|
|
$this->data['id'], |
1422
|
|
|
RequestInterface::METHOD_GET, |
1423
|
|
|
'/offline_conversion_data_sets', |
1424
|
|
|
new AbstractCrudObject(), |
1425
|
|
|
'EDGE', |
1426
|
|
|
array(), |
1427
|
|
|
new TypeChecker($param_types, $enums) |
1428
|
|
|
); |
1429
|
|
|
$request->addParams($params); |
1430
|
|
|
$request->addFields($fields); |
1431
|
|
|
return $pending ? $request : $request->execute(); |
1432
|
|
|
} |
1433
|
|
|
|
1434
|
|
|
public function getOffsitePixels(array $fields = array(), array $params = array(), $pending = false) { |
1435
|
|
|
$this->assureId(); |
1436
|
|
|
|
1437
|
|
|
$param_types = array( |
1438
|
|
|
); |
1439
|
|
|
$enums = array( |
1440
|
|
|
); |
1441
|
|
|
|
1442
|
|
|
$request = new ApiRequest( |
1443
|
|
|
$this->api, |
1444
|
|
|
$this->data['id'], |
1445
|
|
|
RequestInterface::METHOD_GET, |
1446
|
|
|
'/offsitepixels', |
1447
|
|
|
new OffsitePixel(), |
1448
|
|
|
'EDGE', |
1449
|
|
|
OffsitePixel::getFieldsEnum()->getValues(), |
1450
|
|
|
new TypeChecker($param_types, $enums) |
1451
|
|
|
); |
1452
|
|
|
$request->addParams($params); |
1453
|
|
|
$request->addFields($fields); |
1454
|
|
|
return $pending ? $request : $request->execute(); |
1455
|
|
|
} |
1456
|
|
|
|
1457
|
|
|
public function createOffsitePixel(array $fields = array(), array $params = array(), $pending = false) { |
1458
|
|
|
$this->assureId(); |
1459
|
|
|
|
1460
|
|
|
$param_types = array( |
1461
|
|
|
'name' => 'string', |
1462
|
|
|
'tag' => 'tag_enum', |
1463
|
|
|
); |
1464
|
|
|
$enums = array( |
1465
|
|
|
'tag_enum' => OffsitePixelTagValues::getInstance()->getValues(), |
1466
|
|
|
); |
1467
|
|
|
|
1468
|
|
|
$request = new ApiRequest( |
1469
|
|
|
$this->api, |
1470
|
|
|
$this->data['id'], |
1471
|
|
|
RequestInterface::METHOD_POST, |
1472
|
|
|
'/offsitepixels', |
1473
|
|
|
new OffsitePixel(), |
1474
|
|
|
'EDGE', |
1475
|
|
|
OffsitePixel::getFieldsEnum()->getValues(), |
1476
|
|
|
new TypeChecker($param_types, $enums) |
1477
|
|
|
); |
1478
|
|
|
$request->addParams($params); |
1479
|
|
|
$request->addFields($fields); |
1480
|
|
|
return $pending ? $request : $request->execute(); |
1481
|
|
|
} |
1482
|
|
|
|
1483
|
|
|
public function getPartnerCategories(array $fields = array(), array $params = array(), $pending = false) { |
1484
|
|
|
$this->assureId(); |
1485
|
|
|
|
1486
|
|
|
$param_types = array( |
1487
|
|
|
'hide_pc' => 'bool', |
1488
|
|
|
'private_or_public' => 'private_or_public_enum', |
1489
|
|
|
'targeting_type' => 'string', |
1490
|
|
|
); |
1491
|
|
|
$enums = array( |
1492
|
|
|
'private_or_public_enum' => PartnerCategoryPrivateOrPublicValues::getInstance()->getValues(), |
1493
|
|
|
); |
1494
|
|
|
|
1495
|
|
|
$request = new ApiRequest( |
1496
|
|
|
$this->api, |
1497
|
|
|
$this->data['id'], |
1498
|
|
|
RequestInterface::METHOD_GET, |
1499
|
|
|
'/partnercategories', |
1500
|
|
|
new PartnerCategory(), |
1501
|
|
|
'EDGE', |
1502
|
|
|
PartnerCategory::getFieldsEnum()->getValues(), |
1503
|
|
|
new TypeChecker($param_types, $enums) |
1504
|
|
|
); |
1505
|
|
|
$request->addParams($params); |
1506
|
|
|
$request->addFields($fields); |
1507
|
|
|
return $pending ? $request : $request->execute(); |
1508
|
|
|
} |
1509
|
|
|
|
1510
|
|
|
public function getPartners(array $fields = array(), array $params = array(), $pending = false) { |
1511
|
|
|
$this->assureId(); |
1512
|
|
|
|
1513
|
|
|
$param_types = array( |
1514
|
|
|
); |
1515
|
|
|
$enums = array( |
1516
|
|
|
); |
1517
|
|
|
|
1518
|
|
|
$request = new ApiRequest( |
1519
|
|
|
$this->api, |
1520
|
|
|
$this->data['id'], |
1521
|
|
|
RequestInterface::METHOD_GET, |
1522
|
|
|
'/partners', |
1523
|
|
|
new AdsDataPartner(), |
1524
|
|
|
'EDGE', |
1525
|
|
|
AdsDataPartner::getFieldsEnum()->getValues(), |
1526
|
|
|
new TypeChecker($param_types, $enums) |
1527
|
|
|
); |
1528
|
|
|
$request->addParams($params); |
1529
|
|
|
$request->addFields($fields); |
1530
|
|
|
return $pending ? $request : $request->execute(); |
1531
|
|
|
} |
1532
|
|
|
|
1533
|
|
|
public function createProductAudience(array $fields = array(), array $params = array(), $pending = false) { |
1534
|
|
|
$this->assureId(); |
1535
|
|
|
|
1536
|
|
|
$param_types = array( |
1537
|
|
|
'associated_audience_id' => 'unsigned int', |
1538
|
|
|
'creation_params' => 'map', |
1539
|
|
|
'description' => 'string', |
1540
|
|
|
'exclusions' => 'list<Object>', |
1541
|
|
|
'inclusions' => 'list<Object>', |
1542
|
|
|
'name' => 'string', |
1543
|
|
|
'opt_out_link' => 'string', |
1544
|
|
|
'parent_audience_id' => 'unsigned int', |
1545
|
|
|
'product_set_id' => 'string', |
1546
|
|
|
'subtype' => 'subtype_enum', |
1547
|
|
|
'tags' => 'list<string>', |
1548
|
|
|
); |
1549
|
|
|
$enums = array( |
1550
|
|
|
'subtype_enum' => array( |
1551
|
|
|
'CUSTOM', |
1552
|
|
|
'WEBSITE', |
1553
|
|
|
'APP', |
1554
|
|
|
'OFFLINE_CONVERSION', |
1555
|
|
|
'CLAIM', |
1556
|
|
|
'PARTNER', |
1557
|
|
|
'MANAGED', |
1558
|
|
|
'VIDEO', |
1559
|
|
|
'LOOKALIKE', |
1560
|
|
|
'ENGAGEMENT', |
1561
|
|
|
'DATA_SET', |
1562
|
|
|
'BAG_OF_ACCOUNTS', |
1563
|
|
|
'STUDY_RULE_AUDIENCE', |
1564
|
|
|
'FOX', |
1565
|
|
|
), |
1566
|
|
|
); |
1567
|
|
|
|
1568
|
|
|
$request = new ApiRequest( |
1569
|
|
|
$this->api, |
1570
|
|
|
$this->data['id'], |
1571
|
|
|
RequestInterface::METHOD_POST, |
1572
|
|
|
'/product_audiences', |
1573
|
|
|
new CustomAudience(), |
1574
|
|
|
'EDGE', |
1575
|
|
|
CustomAudience::getFieldsEnum()->getValues(), |
1576
|
|
|
new TypeChecker($param_types, $enums) |
1577
|
|
|
); |
1578
|
|
|
$request->addParams($params); |
1579
|
|
|
$request->addFields($fields); |
1580
|
|
|
return $pending ? $request : $request->execute(); |
1581
|
|
|
} |
1582
|
|
|
|
1583
|
|
|
public function getPublisherBlockLists(array $fields = array(), array $params = array(), $pending = false) { |
1584
|
|
|
$this->assureId(); |
1585
|
|
|
|
1586
|
|
|
$param_types = array( |
1587
|
|
|
); |
1588
|
|
|
$enums = array( |
1589
|
|
|
); |
1590
|
|
|
|
1591
|
|
|
$request = new ApiRequest( |
1592
|
|
|
$this->api, |
1593
|
|
|
$this->data['id'], |
1594
|
|
|
RequestInterface::METHOD_GET, |
1595
|
|
|
'/publisher_block_lists', |
1596
|
|
|
new AbstractCrudObject(), |
1597
|
|
|
'EDGE', |
1598
|
|
|
array(), |
1599
|
|
|
new TypeChecker($param_types, $enums) |
1600
|
|
|
); |
1601
|
|
|
$request->addParams($params); |
1602
|
|
|
$request->addFields($fields); |
1603
|
|
|
return $pending ? $request : $request->execute(); |
1604
|
|
|
} |
1605
|
|
|
|
1606
|
|
|
public function createPublisherBlockList(array $fields = array(), array $params = array(), $pending = false) { |
1607
|
|
|
$this->assureId(); |
1608
|
|
|
|
1609
|
|
|
$param_types = array( |
1610
|
|
|
'name' => 'string', |
1611
|
|
|
); |
1612
|
|
|
$enums = array( |
1613
|
|
|
); |
1614
|
|
|
|
1615
|
|
|
$request = new ApiRequest( |
1616
|
|
|
$this->api, |
1617
|
|
|
$this->data['id'], |
1618
|
|
|
RequestInterface::METHOD_POST, |
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 getRateCard(array $fields = array(), array $params = array(), $pending = false) { |
1631
|
|
|
$this->assureId(); |
1632
|
|
|
|
1633
|
|
|
$param_types = array( |
1634
|
|
|
); |
1635
|
|
|
$enums = array( |
1636
|
|
|
); |
1637
|
|
|
|
1638
|
|
|
$request = new ApiRequest( |
1639
|
|
|
$this->api, |
1640
|
|
|
$this->data['id'], |
1641
|
|
|
RequestInterface::METHOD_GET, |
1642
|
|
|
'/ratecard', |
1643
|
|
|
new RateCard(), |
1644
|
|
|
'EDGE', |
1645
|
|
|
RateCard::getFieldsEnum()->getValues(), |
1646
|
|
|
new TypeChecker($param_types, $enums) |
1647
|
|
|
); |
1648
|
|
|
$request->addParams($params); |
1649
|
|
|
$request->addFields($fields); |
1650
|
|
|
return $pending ? $request : $request->execute(); |
1651
|
|
|
} |
1652
|
|
|
|
1653
|
|
|
public function getReachEstimate(array $fields = array(), array $params = array(), $pending = false) { |
1654
|
|
|
$this->assureId(); |
1655
|
|
|
|
1656
|
|
|
$param_types = array( |
1657
|
|
|
'currency' => 'string', |
1658
|
|
|
'daily_budget' => 'float', |
1659
|
|
|
'object_store_url' => 'string', |
1660
|
|
|
'optimize_for' => 'optimize_for_enum', |
1661
|
|
|
'targeting_spec' => 'Targeting', |
1662
|
|
|
); |
1663
|
|
|
$enums = array( |
1664
|
|
|
'optimize_for_enum' => ReachEstimateOptimizeForValues::getInstance()->getValues(), |
1665
|
|
|
); |
1666
|
|
|
|
1667
|
|
|
$request = new ApiRequest( |
1668
|
|
|
$this->api, |
1669
|
|
|
$this->data['id'], |
1670
|
|
|
RequestInterface::METHOD_GET, |
1671
|
|
|
'/reachestimate', |
1672
|
|
|
new ReachEstimate(), |
1673
|
|
|
'EDGE', |
1674
|
|
|
ReachEstimate::getFieldsEnum()->getValues(), |
1675
|
|
|
new TypeChecker($param_types, $enums) |
1676
|
|
|
); |
1677
|
|
|
$request->addParams($params); |
1678
|
|
|
$request->addFields($fields); |
1679
|
|
|
return $pending ? $request : $request->execute(); |
1680
|
|
|
} |
1681
|
|
|
|
1682
|
|
|
public function getReachFrequencyPredictions(array $fields = array(), array $params = array(), $pending = false) { |
1683
|
|
|
$this->assureId(); |
1684
|
|
|
|
1685
|
|
|
$param_types = array( |
1686
|
|
|
); |
1687
|
|
|
$enums = array( |
1688
|
|
|
); |
1689
|
|
|
|
1690
|
|
|
$request = new ApiRequest( |
1691
|
|
|
$this->api, |
1692
|
|
|
$this->data['id'], |
1693
|
|
|
RequestInterface::METHOD_GET, |
1694
|
|
|
'/reachfrequencypredictions', |
1695
|
|
|
new ReachFrequencyPrediction(), |
1696
|
|
|
'EDGE', |
1697
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
1698
|
|
|
new TypeChecker($param_types, $enums) |
1699
|
|
|
); |
1700
|
|
|
$request->addParams($params); |
1701
|
|
|
$request->addFields($fields); |
1702
|
|
|
return $pending ? $request : $request->execute(); |
1703
|
|
|
} |
1704
|
|
|
|
1705
|
|
|
public function createReachFrequencyPrediction(array $fields = array(), array $params = array(), $pending = false) { |
1706
|
|
|
$this->assureId(); |
1707
|
|
|
|
1708
|
|
|
$param_types = array( |
1709
|
|
|
'budget' => 'unsigned int', |
1710
|
|
|
'campaign_group_id' => 'string', |
1711
|
|
|
'day_parting_schedule' => 'list<Object>', |
1712
|
|
|
'destination_id' => 'unsigned int', |
1713
|
|
|
'destination_ids' => 'list<string>', |
1714
|
|
|
'end_time' => 'unsigned int', |
1715
|
|
|
'frequency_cap' => 'unsigned int', |
1716
|
|
|
'interval_frequency_cap_reset_period' => 'unsigned int', |
1717
|
|
|
'num_curve_points' => 'unsigned int', |
1718
|
|
|
'objective' => 'string', |
1719
|
|
|
'prediction_mode' => 'unsigned int', |
1720
|
|
|
'reach' => 'unsigned int', |
1721
|
|
|
'rf_prediction_id_to_share' => 'string', |
1722
|
|
|
'start_time' => 'unsigned int', |
1723
|
|
|
'stop_time' => 'unsigned int', |
1724
|
|
|
'story_event_type' => 'unsigned int', |
1725
|
|
|
'target_spec' => 'Targeting', |
1726
|
|
|
); |
1727
|
|
|
$enums = array( |
1728
|
|
|
); |
1729
|
|
|
|
1730
|
|
|
$request = new ApiRequest( |
1731
|
|
|
$this->api, |
1732
|
|
|
$this->data['id'], |
1733
|
|
|
RequestInterface::METHOD_POST, |
1734
|
|
|
'/reachfrequencypredictions', |
1735
|
|
|
new ReachFrequencyPrediction(), |
1736
|
|
|
'EDGE', |
1737
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
1738
|
|
|
new TypeChecker($param_types, $enums) |
1739
|
|
|
); |
1740
|
|
|
$request->addParams($params); |
1741
|
|
|
$request->addFields($fields); |
1742
|
|
|
return $pending ? $request : $request->execute(); |
1743
|
|
|
} |
1744
|
|
|
|
1745
|
|
|
public function getRoas(array $fields = array(), array $params = array(), $pending = false) { |
1746
|
|
|
$this->assureId(); |
1747
|
|
|
|
1748
|
|
|
$param_types = array( |
1749
|
|
|
'fields' => 'list<fields_enum>', |
1750
|
|
|
'filtering' => 'list<Object>', |
1751
|
|
|
'time_increment' => 'string', |
1752
|
|
|
'time_range' => 'Object', |
1753
|
|
|
); |
1754
|
|
|
$enums = array( |
1755
|
|
|
'fields_enum' => AdAccountRoasFieldsValues::getInstance()->getValues(), |
1756
|
|
|
); |
1757
|
|
|
|
1758
|
|
|
$request = new ApiRequest( |
1759
|
|
|
$this->api, |
1760
|
|
|
$this->data['id'], |
1761
|
|
|
RequestInterface::METHOD_GET, |
1762
|
|
|
'/roas', |
1763
|
|
|
new AdAccountRoas(), |
1764
|
|
|
'EDGE', |
1765
|
|
|
AdAccountRoas::getFieldsEnum()->getValues(), |
1766
|
|
|
new TypeChecker($param_types, $enums) |
1767
|
|
|
); |
1768
|
|
|
$request->addParams($params); |
1769
|
|
|
$request->addFields($fields); |
1770
|
|
|
return $pending ? $request : $request->execute(); |
1771
|
|
|
} |
1772
|
|
|
|
1773
|
|
|
public function getTargetingBrowse(array $fields = array(), array $params = array(), $pending = false) { |
1774
|
|
|
$this->assureId(); |
1775
|
|
|
|
1776
|
|
|
$param_types = array( |
1777
|
|
|
'include_nodes' => 'bool', |
1778
|
|
|
'limit_type' => 'limit_type_enum', |
1779
|
|
|
); |
1780
|
|
|
$enums = array( |
1781
|
|
|
'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(), |
1782
|
|
|
); |
1783
|
|
|
|
1784
|
|
|
$request = new ApiRequest( |
1785
|
|
|
$this->api, |
1786
|
|
|
$this->data['id'], |
1787
|
|
|
RequestInterface::METHOD_GET, |
1788
|
|
|
'/targetingbrowse', |
1789
|
|
|
new AdAccountTargetingUnified(), |
1790
|
|
|
'EDGE', |
1791
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1792
|
|
|
new TypeChecker($param_types, $enums) |
1793
|
|
|
); |
1794
|
|
|
$request->addParams($params); |
1795
|
|
|
$request->addFields($fields); |
1796
|
|
|
return $pending ? $request : $request->execute(); |
1797
|
|
|
} |
1798
|
|
|
|
1799
|
|
|
public function getTargetingSearch(array $fields = array(), array $params = array(), $pending = false) { |
1800
|
|
|
$this->assureId(); |
1801
|
|
|
|
1802
|
|
|
$param_types = array( |
1803
|
|
|
'limit_type' => 'limit_type_enum', |
1804
|
|
|
'q' => 'string', |
1805
|
|
|
); |
1806
|
|
|
$enums = array( |
1807
|
|
|
'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(), |
1808
|
|
|
); |
1809
|
|
|
|
1810
|
|
|
$request = new ApiRequest( |
1811
|
|
|
$this->api, |
1812
|
|
|
$this->data['id'], |
1813
|
|
|
RequestInterface::METHOD_GET, |
1814
|
|
|
'/targetingsearch', |
1815
|
|
|
new AdAccountTargetingUnified(), |
1816
|
|
|
'EDGE', |
1817
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1818
|
|
|
new TypeChecker($param_types, $enums) |
1819
|
|
|
); |
1820
|
|
|
$request->addParams($params); |
1821
|
|
|
$request->addFields($fields); |
1822
|
|
|
return $pending ? $request : $request->execute(); |
1823
|
|
|
} |
1824
|
|
|
|
1825
|
|
|
public function getTargetingSentenceLines(array $fields = array(), array $params = array(), $pending = false) { |
1826
|
|
|
$this->assureId(); |
1827
|
|
|
|
1828
|
|
|
$param_types = array( |
1829
|
|
|
'discard_ages' => 'bool', |
1830
|
|
|
'discard_placements' => 'bool', |
1831
|
|
|
'targeting_spec' => 'Targeting', |
1832
|
|
|
); |
1833
|
|
|
$enums = array( |
1834
|
|
|
); |
1835
|
|
|
|
1836
|
|
|
$request = new ApiRequest( |
1837
|
|
|
$this->api, |
1838
|
|
|
$this->data['id'], |
1839
|
|
|
RequestInterface::METHOD_GET, |
1840
|
|
|
'/targetingsentencelines', |
1841
|
|
|
new TargetingSentenceLine(), |
1842
|
|
|
'EDGE', |
1843
|
|
|
TargetingSentenceLine::getFieldsEnum()->getValues(), |
1844
|
|
|
new TypeChecker($param_types, $enums) |
1845
|
|
|
); |
1846
|
|
|
$request->addParams($params); |
1847
|
|
|
$request->addFields($fields); |
1848
|
|
|
return $pending ? $request : $request->execute(); |
1849
|
|
|
} |
1850
|
|
|
|
1851
|
|
|
public function getTargetingSuggestions(array $fields = array(), array $params = array(), $pending = false) { |
1852
|
|
|
$this->assureId(); |
1853
|
|
|
|
1854
|
|
|
$param_types = array( |
1855
|
|
|
'limit_type' => 'limit_type_enum', |
1856
|
|
|
'targeting_list' => 'list<Object>', |
1857
|
|
|
); |
1858
|
|
|
$enums = array( |
1859
|
|
|
'limit_type_enum' => AdAccountTargetingUnifiedLimitTypeValues::getInstance()->getValues(), |
1860
|
|
|
); |
1861
|
|
|
|
1862
|
|
|
$request = new ApiRequest( |
1863
|
|
|
$this->api, |
1864
|
|
|
$this->data['id'], |
1865
|
|
|
RequestInterface::METHOD_GET, |
1866
|
|
|
'/targetingsuggestions', |
1867
|
|
|
new AdAccountTargetingUnified(), |
1868
|
|
|
'EDGE', |
1869
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1870
|
|
|
new TypeChecker($param_types, $enums) |
1871
|
|
|
); |
1872
|
|
|
$request->addParams($params); |
1873
|
|
|
$request->addFields($fields); |
1874
|
|
|
return $pending ? $request : $request->execute(); |
1875
|
|
|
} |
1876
|
|
|
|
1877
|
|
|
public function getTargetingValidation(array $fields = array(), array $params = array(), $pending = false) { |
1878
|
|
|
$this->assureId(); |
1879
|
|
|
|
1880
|
|
|
$param_types = array( |
1881
|
|
|
'id_list' => 'list<unsigned int>', |
1882
|
|
|
'name_list' => 'list<string>', |
1883
|
|
|
'targeting_list' => 'list<Object>', |
1884
|
|
|
); |
1885
|
|
|
$enums = array( |
1886
|
|
|
); |
1887
|
|
|
|
1888
|
|
|
$request = new ApiRequest( |
1889
|
|
|
$this->api, |
1890
|
|
|
$this->data['id'], |
1891
|
|
|
RequestInterface::METHOD_GET, |
1892
|
|
|
'/targetingvalidation', |
1893
|
|
|
new AdAccountTargetingUnified(), |
1894
|
|
|
'EDGE', |
1895
|
|
|
AdAccountTargetingUnified::getFieldsEnum()->getValues(), |
1896
|
|
|
new TypeChecker($param_types, $enums) |
1897
|
|
|
); |
1898
|
|
|
$request->addParams($params); |
1899
|
|
|
$request->addFields($fields); |
1900
|
|
|
return $pending ? $request : $request->execute(); |
1901
|
|
|
} |
1902
|
|
|
|
1903
|
|
|
public function deleteTracking(array $fields = array(), array $params = array(), $pending = false) { |
1904
|
|
|
$this->assureId(); |
1905
|
|
|
|
1906
|
|
|
$param_types = array( |
1907
|
|
|
'tracking_specs' => 'Object', |
1908
|
|
|
); |
1909
|
|
|
$enums = array( |
1910
|
|
|
); |
1911
|
|
|
|
1912
|
|
|
$request = new ApiRequest( |
1913
|
|
|
$this->api, |
1914
|
|
|
$this->data['id'], |
1915
|
|
|
RequestInterface::METHOD_DELETE, |
1916
|
|
|
'/tracking', |
1917
|
|
|
new AbstractCrudObject(), |
1918
|
|
|
'EDGE', |
1919
|
|
|
array(), |
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 createTracking(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_POST, |
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 getTransactions(array $fields = array(), array $params = array(), $pending = false) { |
1952
|
|
|
$this->assureId(); |
1953
|
|
|
|
1954
|
|
|
$param_types = array( |
1955
|
|
|
'time_start' => 'int', |
1956
|
|
|
'time_stop' => 'int', |
1957
|
|
|
); |
1958
|
|
|
$enums = array( |
1959
|
|
|
); |
1960
|
|
|
|
1961
|
|
|
$request = new ApiRequest( |
1962
|
|
|
$this->api, |
1963
|
|
|
$this->data['id'], |
1964
|
|
|
RequestInterface::METHOD_GET, |
1965
|
|
|
'/transactions', |
1966
|
|
|
new Transaction(), |
1967
|
|
|
'EDGE', |
1968
|
|
|
Transaction::getFieldsEnum()->getValues(), |
1969
|
|
|
new TypeChecker($param_types, $enums) |
1970
|
|
|
); |
1971
|
|
|
$request->addParams($params); |
1972
|
|
|
$request->addFields($fields); |
1973
|
|
|
return $pending ? $request : $request->execute(); |
1974
|
|
|
} |
1975
|
|
|
|
1976
|
|
|
public function getUsers(array $fields = array(), array $params = array(), $pending = false) { |
1977
|
|
|
$this->assureId(); |
1978
|
|
|
|
1979
|
|
|
$param_types = array( |
1980
|
|
|
); |
1981
|
|
|
$enums = array( |
1982
|
|
|
); |
1983
|
|
|
|
1984
|
|
|
$request = new ApiRequest( |
1985
|
|
|
$this->api, |
1986
|
|
|
$this->data['id'], |
1987
|
|
|
RequestInterface::METHOD_GET, |
1988
|
|
|
'/users', |
1989
|
|
|
new AdAccountUser(), |
1990
|
|
|
'EDGE', |
1991
|
|
|
AdAccountUser::getFieldsEnum()->getValues(), |
1992
|
|
|
new TypeChecker($param_types, $enums) |
1993
|
|
|
); |
1994
|
|
|
$request->addParams($params); |
1995
|
|
|
$request->addFields($fields); |
1996
|
|
|
return $pending ? $request : $request->execute(); |
1997
|
|
|
} |
1998
|
|
|
|
1999
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
2000
|
|
|
$this->assureId(); |
2001
|
|
|
|
2002
|
|
|
$param_types = array( |
2003
|
|
|
); |
2004
|
|
|
$enums = array( |
2005
|
|
|
); |
2006
|
|
|
|
2007
|
|
|
$request = new ApiRequest( |
2008
|
|
|
$this->api, |
2009
|
|
|
$this->data['id'], |
2010
|
|
|
RequestInterface::METHOD_GET, |
2011
|
|
|
'/', |
2012
|
|
|
new AdAccount(), |
2013
|
|
|
'NODE', |
2014
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
2015
|
|
|
new TypeChecker($param_types, $enums) |
2016
|
|
|
); |
2017
|
|
|
$request->addParams($params); |
2018
|
|
|
$request->addFields($fields); |
2019
|
|
|
return $pending ? $request : $request->execute(); |
2020
|
|
|
} |
2021
|
|
|
|
2022
|
|
|
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) { |
2023
|
|
|
$this->assureId(); |
2024
|
|
|
|
2025
|
|
|
$param_types = array( |
2026
|
|
|
'agency_client_declaration' => 'map', |
2027
|
|
|
'attribution_spec' => 'list<Object>', |
2028
|
|
|
'business_info' => 'map', |
2029
|
|
|
'end_advertiser' => 'string', |
2030
|
|
|
'is_notifications_enabled' => 'bool', |
2031
|
|
|
'media_agency' => 'string', |
2032
|
|
|
'name' => 'string', |
2033
|
|
|
'partner' => 'string', |
2034
|
|
|
'redownload' => 'bool', |
2035
|
|
|
'spend_cap' => 'float', |
2036
|
|
|
'spend_cap_action' => 'string', |
2037
|
|
|
); |
2038
|
|
|
$enums = array( |
2039
|
|
|
); |
2040
|
|
|
|
2041
|
|
|
$request = new ApiRequest( |
2042
|
|
|
$this->api, |
2043
|
|
|
$this->data['id'], |
2044
|
|
|
RequestInterface::METHOD_POST, |
2045
|
|
|
'/', |
2046
|
|
|
new AdAccount(), |
2047
|
|
|
'NODE', |
2048
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
2049
|
|
|
new TypeChecker($param_types, $enums) |
2050
|
|
|
); |
2051
|
|
|
$request->addParams($params); |
2052
|
|
|
$request->addFields($fields); |
2053
|
|
|
return $pending ? $request : $request->execute(); |
2054
|
|
|
} |
2055
|
|
|
|
2056
|
|
|
} |
2057
|
|
|
|