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