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\BusinessFields; |
32
|
|
|
use FacebookAds\Object\Values\AdStudyTypeValues; |
33
|
|
|
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues; |
34
|
|
|
use FacebookAds\Object\Values\ReachFrequencyPredictionStatusValues; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* This class is auto-generated. |
38
|
|
|
* |
39
|
|
|
* For any issues or feature requests related to this class, please let us know |
40
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
41
|
|
|
* pull request for this class. |
42
|
|
|
* |
43
|
|
|
*/ |
44
|
|
|
|
45
|
|
|
class Business extends AbstractCrudObject { |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @return BusinessFields |
49
|
|
|
*/ |
50
|
|
|
public static function getFieldsEnum() { |
51
|
|
|
return BusinessFields::getInstance(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
protected static function getReferencedEnums() { |
55
|
|
|
$ref_enums = array(); |
56
|
|
|
return $ref_enums; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
|
60
|
|
|
public function createAdStudy(array $fields = array(), array $params = array(), $pending = false) { |
61
|
|
|
$this->assureId(); |
62
|
|
|
|
63
|
|
|
$param_types = array( |
64
|
|
|
'cells' => 'list<Object>', |
65
|
|
|
'confidence_level' => 'float', |
66
|
|
|
'cooldown_start_time' => 'int', |
67
|
|
|
'description' => 'string', |
68
|
|
|
'end_time' => 'int', |
69
|
|
|
'name' => 'string', |
70
|
|
|
'objectives' => 'list<Object>', |
71
|
|
|
'observation_end_time' => 'int', |
72
|
|
|
'start_time' => 'int', |
73
|
|
|
'type' => 'type_enum', |
74
|
|
|
'viewers' => 'list<int>', |
75
|
|
|
); |
76
|
|
|
$enums = array( |
77
|
|
|
'type_enum' => AdStudyTypeValues::getInstance()->getValues(), |
78
|
|
|
); |
79
|
|
|
|
80
|
|
|
$request = new ApiRequest( |
81
|
|
|
$this->api, |
82
|
|
|
$this->data['id'], |
83
|
|
|
RequestInterface::METHOD_POST, |
84
|
|
|
'/ad_studies', |
85
|
|
|
new AdStudy(), |
86
|
|
|
'EDGE', |
87
|
|
|
AdStudy::getFieldsEnum()->getValues(), |
88
|
|
|
new TypeChecker($param_types, $enums) |
89
|
|
|
); |
90
|
|
|
$request->addParams($params); |
91
|
|
|
$request->addFields($fields); |
92
|
|
|
return $pending ? $request : $request->execute(); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function createAdAccount(array $fields = array(), array $params = array(), $pending = false) { |
96
|
|
|
$this->assureId(); |
97
|
|
|
|
98
|
|
|
$param_types = array( |
99
|
|
|
'billing_address_id' => 'string', |
100
|
|
|
'currency' => 'string', |
101
|
|
|
'end_advertiser' => 'Object', |
102
|
|
|
'funding_id' => 'string', |
103
|
|
|
'invoice' => 'bool', |
104
|
|
|
'io' => 'bool', |
105
|
|
|
'media_agency' => 'string', |
106
|
|
|
'name' => 'string', |
107
|
|
|
'partner' => 'string', |
108
|
|
|
'po_number' => 'string', |
109
|
|
|
'timezone_id' => 'unsigned int', |
110
|
|
|
); |
111
|
|
|
$enums = array( |
112
|
|
|
); |
113
|
|
|
|
114
|
|
|
$request = new ApiRequest( |
115
|
|
|
$this->api, |
116
|
|
|
$this->data['id'], |
117
|
|
|
RequestInterface::METHOD_POST, |
118
|
|
|
'/adaccount', |
119
|
|
|
new AdAccount(), |
120
|
|
|
'EDGE', |
121
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
122
|
|
|
new TypeChecker($param_types, $enums) |
123
|
|
|
); |
124
|
|
|
$request->addParams($params); |
125
|
|
|
$request->addFields($fields); |
126
|
|
|
return $pending ? $request : $request->execute(); |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
public function getAdsPixels(array $fields = array(), array $params = array(), $pending = false) { |
130
|
|
|
$this->assureId(); |
131
|
|
|
|
132
|
|
|
$param_types = array( |
133
|
|
|
'id_filter' => 'string', |
134
|
|
|
'name_filter' => 'string', |
135
|
|
|
); |
136
|
|
|
$enums = array( |
137
|
|
|
); |
138
|
|
|
|
139
|
|
|
$request = new ApiRequest( |
140
|
|
|
$this->api, |
141
|
|
|
$this->data['id'], |
142
|
|
|
RequestInterface::METHOD_GET, |
143
|
|
|
'/adspixels', |
144
|
|
|
new AdsPixel(), |
145
|
|
|
'EDGE', |
146
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
147
|
|
|
new TypeChecker($param_types, $enums) |
148
|
|
|
); |
149
|
|
|
$request->addParams($params); |
150
|
|
|
$request->addFields($fields); |
151
|
|
|
return $pending ? $request : $request->execute(); |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
public function createAdsPixel(array $fields = array(), array $params = array(), $pending = false) { |
155
|
|
|
$this->assureId(); |
156
|
|
|
|
157
|
|
|
$param_types = array( |
158
|
|
|
'name' => 'string', |
159
|
|
|
); |
160
|
|
|
$enums = array( |
161
|
|
|
); |
162
|
|
|
|
163
|
|
|
$request = new ApiRequest( |
164
|
|
|
$this->api, |
165
|
|
|
$this->data['id'], |
166
|
|
|
RequestInterface::METHOD_POST, |
167
|
|
|
'/adspixels', |
168
|
|
|
new AdsPixel(), |
169
|
|
|
'EDGE', |
170
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
171
|
|
|
new TypeChecker($param_types, $enums) |
172
|
|
|
); |
173
|
|
|
$request->addParams($params); |
174
|
|
|
$request->addFields($fields); |
175
|
|
|
return $pending ? $request : $request->execute(); |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
public function deleteApps(array $fields = array(), array $params = array(), $pending = false) { |
179
|
|
|
$this->assureId(); |
180
|
|
|
|
181
|
|
|
$param_types = array( |
182
|
|
|
'app_id' => 'int', |
183
|
|
|
); |
184
|
|
|
$enums = array( |
185
|
|
|
); |
186
|
|
|
|
187
|
|
|
$request = new ApiRequest( |
188
|
|
|
$this->api, |
189
|
|
|
$this->data['id'], |
190
|
|
|
RequestInterface::METHOD_DELETE, |
191
|
|
|
'/apps', |
192
|
|
|
new AbstractCrudObject(), |
193
|
|
|
'EDGE', |
194
|
|
|
array(), |
195
|
|
|
new TypeChecker($param_types, $enums) |
196
|
|
|
); |
197
|
|
|
$request->addParams($params); |
198
|
|
|
$request->addFields($fields); |
199
|
|
|
return $pending ? $request : $request->execute(); |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
public function getClientAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
203
|
|
|
$this->assureId(); |
204
|
|
|
|
205
|
|
|
$param_types = array( |
206
|
|
|
); |
207
|
|
|
$enums = array( |
208
|
|
|
); |
209
|
|
|
|
210
|
|
|
$request = new ApiRequest( |
211
|
|
|
$this->api, |
212
|
|
|
$this->data['id'], |
213
|
|
|
RequestInterface::METHOD_GET, |
214
|
|
|
'/client_ad_accounts', |
215
|
|
|
new AdAccount(), |
216
|
|
|
'EDGE', |
217
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
218
|
|
|
new TypeChecker($param_types, $enums) |
219
|
|
|
); |
220
|
|
|
$request->addParams($params); |
221
|
|
|
$request->addFields($fields); |
222
|
|
|
return $pending ? $request : $request->execute(); |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
public function getClientPages(array $fields = array(), array $params = array(), $pending = false) { |
226
|
|
|
$this->assureId(); |
227
|
|
|
|
228
|
|
|
$param_types = array( |
229
|
|
|
); |
230
|
|
|
$enums = array( |
231
|
|
|
); |
232
|
|
|
|
233
|
|
|
$request = new ApiRequest( |
234
|
|
|
$this->api, |
235
|
|
|
$this->data['id'], |
236
|
|
|
RequestInterface::METHOD_GET, |
237
|
|
|
'/client_pages', |
238
|
|
|
new AbstractCrudObject(), |
239
|
|
|
'EDGE', |
240
|
|
|
array(), |
241
|
|
|
new TypeChecker($param_types, $enums) |
242
|
|
|
); |
243
|
|
|
$request->addParams($params); |
244
|
|
|
$request->addFields($fields); |
245
|
|
|
return $pending ? $request : $request->execute(); |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
public function getEventSourceGroups(array $fields = array(), array $params = array(), $pending = false) { |
249
|
|
|
$this->assureId(); |
250
|
|
|
|
251
|
|
|
$param_types = array( |
252
|
|
|
); |
253
|
|
|
$enums = array( |
254
|
|
|
); |
255
|
|
|
|
256
|
|
|
$request = new ApiRequest( |
257
|
|
|
$this->api, |
258
|
|
|
$this->data['id'], |
259
|
|
|
RequestInterface::METHOD_GET, |
260
|
|
|
'/event_source_groups', |
261
|
|
|
new EventSourceGroup(), |
262
|
|
|
'EDGE', |
263
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
264
|
|
|
new TypeChecker($param_types, $enums) |
265
|
|
|
); |
266
|
|
|
$request->addParams($params); |
267
|
|
|
$request->addFields($fields); |
268
|
|
|
return $pending ? $request : $request->execute(); |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
public function createEventSourceGroup(array $fields = array(), array $params = array(), $pending = false) { |
272
|
|
|
$this->assureId(); |
273
|
|
|
|
274
|
|
|
$param_types = array( |
275
|
|
|
'event_sources' => 'list<string>', |
276
|
|
|
'name' => 'string', |
277
|
|
|
); |
278
|
|
|
$enums = array( |
279
|
|
|
); |
280
|
|
|
|
281
|
|
|
$request = new ApiRequest( |
282
|
|
|
$this->api, |
283
|
|
|
$this->data['id'], |
284
|
|
|
RequestInterface::METHOD_POST, |
285
|
|
|
'/event_source_groups', |
286
|
|
|
new EventSourceGroup(), |
287
|
|
|
'EDGE', |
288
|
|
|
EventSourceGroup::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 getGrpPlans(array $fields = array(), array $params = array(), $pending = false) { |
297
|
|
|
$this->assureId(); |
298
|
|
|
|
299
|
|
|
$param_types = array( |
300
|
|
|
'status' => 'status_enum', |
301
|
|
|
); |
302
|
|
|
$enums = array( |
303
|
|
|
'status_enum' => ReachFrequencyPredictionStatusValues::getInstance()->getValues(), |
304
|
|
|
); |
305
|
|
|
|
306
|
|
|
$request = new ApiRequest( |
307
|
|
|
$this->api, |
308
|
|
|
$this->data['id'], |
309
|
|
|
RequestInterface::METHOD_GET, |
310
|
|
|
'/grp_plans', |
311
|
|
|
new ReachFrequencyPrediction(), |
312
|
|
|
'EDGE', |
313
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
314
|
|
|
new TypeChecker($param_types, $enums) |
315
|
|
|
); |
316
|
|
|
$request->addParams($params); |
317
|
|
|
$request->addFields($fields); |
318
|
|
|
return $pending ? $request : $request->execute(); |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
322
|
|
|
$this->assureId(); |
323
|
|
|
|
324
|
|
|
$param_types = array( |
325
|
|
|
); |
326
|
|
|
$enums = array( |
327
|
|
|
); |
328
|
|
|
|
329
|
|
|
$request = new ApiRequest( |
330
|
|
|
$this->api, |
331
|
|
|
$this->data['id'], |
332
|
|
|
RequestInterface::METHOD_GET, |
333
|
|
|
'/instagram_accounts', |
334
|
|
|
new AbstractCrudObject(), |
335
|
|
|
'EDGE', |
336
|
|
|
array(), |
337
|
|
|
new TypeChecker($param_types, $enums) |
338
|
|
|
); |
339
|
|
|
$request->addParams($params); |
340
|
|
|
$request->addFields($fields); |
341
|
|
|
return $pending ? $request : $request->execute(); |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
public function getMeasurementReports(array $fields = array(), array $params = array(), $pending = false) { |
345
|
|
|
$this->assureId(); |
346
|
|
|
|
347
|
|
|
$param_types = array( |
348
|
|
|
'filters' => 'list<Object>', |
349
|
|
|
'report_type' => 'report_type_enum', |
350
|
|
|
); |
351
|
|
|
$enums = array( |
352
|
|
|
'report_type_enum' => array( |
353
|
|
|
'multi_channel_report', |
354
|
|
|
'video_metrics_report', |
355
|
|
|
'fruit_rollup_report', |
356
|
|
|
'third_party_mta_report', |
357
|
|
|
'partner_lift_study_report', |
358
|
|
|
), |
359
|
|
|
); |
360
|
|
|
|
361
|
|
|
$request = new ApiRequest( |
362
|
|
|
$this->api, |
363
|
|
|
$this->data['id'], |
364
|
|
|
RequestInterface::METHOD_GET, |
365
|
|
|
'/measurement_reports', |
366
|
|
|
new AbstractCrudObject(), |
367
|
|
|
'EDGE', |
368
|
|
|
array(), |
369
|
|
|
new TypeChecker($param_types, $enums) |
370
|
|
|
); |
371
|
|
|
$request->addParams($params); |
372
|
|
|
$request->addFields($fields); |
373
|
|
|
return $pending ? $request : $request->execute(); |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
public function createMeasurementReport(array $fields = array(), array $params = array(), $pending = false) { |
377
|
|
|
$this->assureId(); |
378
|
|
|
|
379
|
|
|
$param_types = array( |
380
|
|
|
'metadata' => 'string', |
381
|
|
|
'report_type' => 'report_type_enum', |
382
|
|
|
); |
383
|
|
|
$enums = array( |
384
|
|
|
'report_type_enum' => array( |
385
|
|
|
'multi_channel_report', |
386
|
|
|
'video_metrics_report', |
387
|
|
|
'fruit_rollup_report', |
388
|
|
|
'third_party_mta_report', |
389
|
|
|
'partner_lift_study_report', |
390
|
|
|
), |
391
|
|
|
); |
392
|
|
|
|
393
|
|
|
$request = new ApiRequest( |
394
|
|
|
$this->api, |
395
|
|
|
$this->data['id'], |
396
|
|
|
RequestInterface::METHOD_POST, |
397
|
|
|
'/measurement_reports', |
398
|
|
|
new AbstractCrudObject(), |
399
|
|
|
'EDGE', |
400
|
|
|
array(), |
401
|
|
|
new TypeChecker($param_types, $enums) |
402
|
|
|
); |
403
|
|
|
$request->addParams($params); |
404
|
|
|
$request->addFields($fields); |
405
|
|
|
return $pending ? $request : $request->execute(); |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) { |
409
|
|
|
$this->assureId(); |
410
|
|
|
|
411
|
|
|
$param_types = array( |
412
|
|
|
); |
413
|
|
|
$enums = array( |
414
|
|
|
); |
415
|
|
|
|
416
|
|
|
$request = new ApiRequest( |
417
|
|
|
$this->api, |
418
|
|
|
$this->data['id'], |
419
|
|
|
RequestInterface::METHOD_GET, |
420
|
|
|
'/offline_conversion_data_sets', |
421
|
|
|
new OfflineConversionDataSet(), |
422
|
|
|
'EDGE', |
423
|
|
|
OfflineConversionDataSet::getFieldsEnum()->getValues(), |
424
|
|
|
new TypeChecker($param_types, $enums) |
425
|
|
|
); |
426
|
|
|
$request->addParams($params); |
427
|
|
|
$request->addFields($fields); |
428
|
|
|
return $pending ? $request : $request->execute(); |
429
|
|
|
} |
430
|
|
|
|
431
|
|
|
public function createOfflineConversionDataSet(array $fields = array(), array $params = array(), $pending = false) { |
432
|
|
|
$this->assureId(); |
433
|
|
|
|
434
|
|
|
$param_types = array( |
435
|
|
|
'auto_assign_to_new_accounts_only' => 'bool', |
436
|
|
|
'description' => 'string', |
437
|
|
|
'enable_auto_assign_to_accounts' => 'bool', |
438
|
|
|
'name' => 'string', |
439
|
|
|
); |
440
|
|
|
$enums = array( |
441
|
|
|
); |
442
|
|
|
|
443
|
|
|
$request = new ApiRequest( |
444
|
|
|
$this->api, |
445
|
|
|
$this->data['id'], |
446
|
|
|
RequestInterface::METHOD_POST, |
447
|
|
|
'/offline_conversion_data_sets', |
448
|
|
|
new OfflineConversionDataSet(), |
449
|
|
|
'EDGE', |
450
|
|
|
OfflineConversionDataSet::getFieldsEnum()->getValues(), |
451
|
|
|
new TypeChecker($param_types, $enums) |
452
|
|
|
); |
453
|
|
|
$request->addParams($params); |
454
|
|
|
$request->addFields($fields); |
455
|
|
|
return $pending ? $request : $request->execute(); |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
public function getOwnedAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
459
|
|
|
$this->assureId(); |
460
|
|
|
|
461
|
|
|
$param_types = array( |
462
|
|
|
); |
463
|
|
|
$enums = array( |
464
|
|
|
); |
465
|
|
|
|
466
|
|
|
$request = new ApiRequest( |
467
|
|
|
$this->api, |
468
|
|
|
$this->data['id'], |
469
|
|
|
RequestInterface::METHOD_GET, |
470
|
|
|
'/owned_ad_accounts', |
471
|
|
|
new AdAccount(), |
472
|
|
|
'EDGE', |
473
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
474
|
|
|
new TypeChecker($param_types, $enums) |
475
|
|
|
); |
476
|
|
|
$request->addParams($params); |
477
|
|
|
$request->addFields($fields); |
478
|
|
|
return $pending ? $request : $request->execute(); |
479
|
|
|
} |
480
|
|
|
|
481
|
|
|
public function getOwnedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
482
|
|
|
$this->assureId(); |
483
|
|
|
|
484
|
|
|
$param_types = array( |
485
|
|
|
); |
486
|
|
|
$enums = array( |
487
|
|
|
); |
488
|
|
|
|
489
|
|
|
$request = new ApiRequest( |
490
|
|
|
$this->api, |
491
|
|
|
$this->data['id'], |
492
|
|
|
RequestInterface::METHOD_GET, |
493
|
|
|
'/owned_instagram_accounts', |
494
|
|
|
new AbstractCrudObject(), |
495
|
|
|
'EDGE', |
496
|
|
|
array(), |
497
|
|
|
new TypeChecker($param_types, $enums) |
498
|
|
|
); |
499
|
|
|
$request->addParams($params); |
500
|
|
|
$request->addFields($fields); |
501
|
|
|
return $pending ? $request : $request->execute(); |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
public function getOwnedPages(array $fields = array(), array $params = array(), $pending = false) { |
505
|
|
|
$this->assureId(); |
506
|
|
|
|
507
|
|
|
$param_types = array( |
508
|
|
|
); |
509
|
|
|
$enums = array( |
510
|
|
|
); |
511
|
|
|
|
512
|
|
|
$request = new ApiRequest( |
513
|
|
|
$this->api, |
514
|
|
|
$this->data['id'], |
515
|
|
|
RequestInterface::METHOD_GET, |
516
|
|
|
'/owned_pages', |
517
|
|
|
new AbstractCrudObject(), |
518
|
|
|
'EDGE', |
519
|
|
|
array(), |
520
|
|
|
new TypeChecker($param_types, $enums) |
521
|
|
|
); |
522
|
|
|
$request->addParams($params); |
523
|
|
|
$request->addFields($fields); |
524
|
|
|
return $pending ? $request : $request->execute(); |
525
|
|
|
} |
526
|
|
|
|
527
|
|
|
public function getOwnedPixels(array $fields = array(), array $params = array(), $pending = false) { |
528
|
|
|
$this->assureId(); |
529
|
|
|
|
530
|
|
|
$param_types = array( |
531
|
|
|
); |
532
|
|
|
$enums = array( |
533
|
|
|
); |
534
|
|
|
|
535
|
|
|
$request = new ApiRequest( |
536
|
|
|
$this->api, |
537
|
|
|
$this->data['id'], |
538
|
|
|
RequestInterface::METHOD_GET, |
539
|
|
|
'/owned_pixels', |
540
|
|
|
new AdsPixel(), |
541
|
|
|
'EDGE', |
542
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
543
|
|
|
new TypeChecker($param_types, $enums) |
544
|
|
|
); |
545
|
|
|
$request->addParams($params); |
546
|
|
|
$request->addFields($fields); |
547
|
|
|
return $pending ? $request : $request->execute(); |
548
|
|
|
} |
549
|
|
|
|
550
|
|
|
public function getPendingClientAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
551
|
|
|
$this->assureId(); |
552
|
|
|
|
553
|
|
|
$param_types = array( |
554
|
|
|
); |
555
|
|
|
$enums = array( |
556
|
|
|
); |
557
|
|
|
|
558
|
|
|
$request = new ApiRequest( |
559
|
|
|
$this->api, |
560
|
|
|
$this->data['id'], |
561
|
|
|
RequestInterface::METHOD_GET, |
562
|
|
|
'/pending_client_ad_accounts', |
563
|
|
|
new BusinessAdAccountRequest(), |
564
|
|
|
'EDGE', |
565
|
|
|
BusinessAdAccountRequest::getFieldsEnum()->getValues(), |
566
|
|
|
new TypeChecker($param_types, $enums) |
567
|
|
|
); |
568
|
|
|
$request->addParams($params); |
569
|
|
|
$request->addFields($fields); |
570
|
|
|
return $pending ? $request : $request->execute(); |
571
|
|
|
} |
572
|
|
|
|
573
|
|
|
public function getPendingOwnedAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
574
|
|
|
$this->assureId(); |
575
|
|
|
|
576
|
|
|
$param_types = array( |
577
|
|
|
); |
578
|
|
|
$enums = array( |
579
|
|
|
); |
580
|
|
|
|
581
|
|
|
$request = new ApiRequest( |
582
|
|
|
$this->api, |
583
|
|
|
$this->data['id'], |
584
|
|
|
RequestInterface::METHOD_GET, |
585
|
|
|
'/pending_owned_ad_accounts', |
586
|
|
|
new LegacyBusinessAdAccountRequest(), |
587
|
|
|
'EDGE', |
588
|
|
|
LegacyBusinessAdAccountRequest::getFieldsEnum()->getValues(), |
589
|
|
|
new TypeChecker($param_types, $enums) |
590
|
|
|
); |
591
|
|
|
$request->addParams($params); |
592
|
|
|
$request->addFields($fields); |
593
|
|
|
return $pending ? $request : $request->execute(); |
594
|
|
|
} |
595
|
|
|
|
596
|
|
|
public function getPicture(array $fields = array(), array $params = array(), $pending = false) { |
597
|
|
|
$this->assureId(); |
598
|
|
|
|
599
|
|
|
$param_types = array( |
600
|
|
|
'height' => 'int', |
601
|
|
|
'redirect' => 'bool', |
602
|
|
|
'type' => 'type_enum', |
603
|
|
|
'width' => 'int', |
604
|
|
|
); |
605
|
|
|
$enums = array( |
606
|
|
|
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(), |
607
|
|
|
); |
608
|
|
|
|
609
|
|
|
$request = new ApiRequest( |
610
|
|
|
$this->api, |
611
|
|
|
$this->data['id'], |
612
|
|
|
RequestInterface::METHOD_GET, |
613
|
|
|
'/picture', |
614
|
|
|
new ProfilePictureSource(), |
615
|
|
|
'EDGE', |
616
|
|
|
ProfilePictureSource::getFieldsEnum()->getValues(), |
617
|
|
|
new TypeChecker($param_types, $enums) |
618
|
|
|
); |
619
|
|
|
$request->addParams($params); |
620
|
|
|
$request->addFields($fields); |
621
|
|
|
return $pending ? $request : $request->execute(); |
622
|
|
|
} |
623
|
|
|
|
624
|
|
|
public function getReceivedAudiencePermissions(array $fields = array(), array $params = array(), $pending = false) { |
625
|
|
|
$this->assureId(); |
626
|
|
|
|
627
|
|
|
$param_types = array( |
628
|
|
|
'partner_id' => 'string', |
629
|
|
|
); |
630
|
|
|
$enums = array( |
631
|
|
|
); |
632
|
|
|
|
633
|
|
|
$request = new ApiRequest( |
634
|
|
|
$this->api, |
635
|
|
|
$this->data['id'], |
636
|
|
|
RequestInterface::METHOD_GET, |
637
|
|
|
'/received_audience_permissions', |
638
|
|
|
new AbstractCrudObject(), |
639
|
|
|
'EDGE', |
640
|
|
|
array(), |
641
|
|
|
new TypeChecker($param_types, $enums) |
642
|
|
|
); |
643
|
|
|
$request->addParams($params); |
644
|
|
|
$request->addFields($fields); |
645
|
|
|
return $pending ? $request : $request->execute(); |
646
|
|
|
} |
647
|
|
|
|
648
|
|
|
public function getSharedAudiencePermissions(array $fields = array(), array $params = array(), $pending = false) { |
649
|
|
|
$this->assureId(); |
650
|
|
|
|
651
|
|
|
$param_types = array( |
652
|
|
|
'partner_id' => 'string', |
653
|
|
|
); |
654
|
|
|
$enums = array( |
655
|
|
|
); |
656
|
|
|
|
657
|
|
|
$request = new ApiRequest( |
658
|
|
|
$this->api, |
659
|
|
|
$this->data['id'], |
660
|
|
|
RequestInterface::METHOD_GET, |
661
|
|
|
'/shared_audience_permissions', |
662
|
|
|
new AbstractCrudObject(), |
663
|
|
|
'EDGE', |
664
|
|
|
array(), |
665
|
|
|
new TypeChecker($param_types, $enums) |
666
|
|
|
); |
667
|
|
|
$request->addParams($params); |
668
|
|
|
$request->addFields($fields); |
669
|
|
|
return $pending ? $request : $request->execute(); |
670
|
|
|
} |
671
|
|
|
|
672
|
|
|
public function createUserPermission(array $fields = array(), array $params = array(), $pending = false) { |
673
|
|
|
$this->assureId(); |
674
|
|
|
|
675
|
|
|
$param_types = array( |
676
|
|
|
'email' => 'string', |
677
|
|
|
'role' => 'role_enum', |
678
|
|
|
'user' => 'int', |
679
|
|
|
); |
680
|
|
|
$enums = array( |
681
|
|
|
'role_enum' => array( |
682
|
|
|
'FINANCE_EDITOR', |
683
|
|
|
'FINANCE_ANALYST', |
684
|
|
|
'ADS_RIGHTS_REVIEWER', |
685
|
|
|
'ADMIN', |
686
|
|
|
'EMPLOYEE', |
687
|
|
|
'FB_EMPLOYEE_SALES_REP', |
688
|
|
|
), |
689
|
|
|
); |
690
|
|
|
|
691
|
|
|
$request = new ApiRequest( |
692
|
|
|
$this->api, |
693
|
|
|
$this->data['id'], |
694
|
|
|
RequestInterface::METHOD_POST, |
695
|
|
|
'/userpermissions', |
696
|
|
|
new AbstractCrudObject(), |
697
|
|
|
'EDGE', |
698
|
|
|
array(), |
699
|
|
|
new TypeChecker($param_types, $enums) |
700
|
|
|
); |
701
|
|
|
$request->addParams($params); |
702
|
|
|
$request->addFields($fields); |
703
|
|
|
return $pending ? $request : $request->execute(); |
704
|
|
|
} |
705
|
|
|
|
706
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
707
|
|
|
$this->assureId(); |
708
|
|
|
|
709
|
|
|
$param_types = array( |
710
|
|
|
); |
711
|
|
|
$enums = array( |
712
|
|
|
); |
713
|
|
|
|
714
|
|
|
$request = new ApiRequest( |
715
|
|
|
$this->api, |
716
|
|
|
$this->data['id'], |
717
|
|
|
RequestInterface::METHOD_GET, |
718
|
|
|
'/', |
719
|
|
|
new Business(), |
720
|
|
|
'NODE', |
721
|
|
|
Business::getFieldsEnum()->getValues(), |
722
|
|
|
new TypeChecker($param_types, $enums) |
723
|
|
|
); |
724
|
|
|
$request->addParams($params); |
725
|
|
|
$request->addFields($fields); |
726
|
|
|
return $pending ? $request : $request->execute(); |
727
|
|
|
} |
728
|
|
|
|
729
|
|
|
} |
730
|
|
|
|