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