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