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 createAdsPixel(array $fields = array(), array $params = array(), $pending = false) { |
149
|
|
|
$this->assureId(); |
150
|
|
|
|
151
|
|
|
$param_types = array( |
152
|
|
|
'name' => 'string', |
153
|
|
|
); |
154
|
|
|
$enums = array( |
155
|
|
|
); |
156
|
|
|
|
157
|
|
|
$request = new ApiRequest( |
158
|
|
|
$this->api, |
159
|
|
|
$this->data['id'], |
160
|
|
|
RequestInterface::METHOD_POST, |
161
|
|
|
'/adspixels', |
162
|
|
|
new AdsPixel(), |
163
|
|
|
'EDGE', |
164
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
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 deleteApps(array $fields = array(), array $params = array(), $pending = false) { |
173
|
|
|
$this->assureId(); |
174
|
|
|
|
175
|
|
|
$param_types = array( |
176
|
|
|
'app_id' => 'int', |
177
|
|
|
); |
178
|
|
|
$enums = array( |
179
|
|
|
); |
180
|
|
|
|
181
|
|
|
$request = new ApiRequest( |
182
|
|
|
$this->api, |
183
|
|
|
$this->data['id'], |
184
|
|
|
RequestInterface::METHOD_DELETE, |
185
|
|
|
'/apps', |
186
|
|
|
new AbstractCrudObject(), |
187
|
|
|
'EDGE', |
188
|
|
|
array(), |
189
|
|
|
new TypeChecker($param_types, $enums) |
190
|
|
|
); |
191
|
|
|
$request->addParams($params); |
192
|
|
|
$request->addFields($fields); |
193
|
|
|
return $pending ? $request : $request->execute(); |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
public function getAssignedAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
197
|
|
|
$this->assureId(); |
198
|
|
|
|
199
|
|
|
$param_types = array( |
200
|
|
|
'email' => 'string', |
201
|
|
|
'user_id' => 'int', |
202
|
|
|
); |
203
|
|
|
$enums = array( |
204
|
|
|
); |
205
|
|
|
|
206
|
|
|
$request = new ApiRequest( |
207
|
|
|
$this->api, |
208
|
|
|
$this->data['id'], |
209
|
|
|
RequestInterface::METHOD_GET, |
210
|
|
|
'/assigned_ad_accounts', |
211
|
|
|
new AdAccount(), |
212
|
|
|
'EDGE', |
213
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
214
|
|
|
new TypeChecker($param_types, $enums) |
215
|
|
|
); |
216
|
|
|
$request->addParams($params); |
217
|
|
|
$request->addFields($fields); |
218
|
|
|
return $pending ? $request : $request->execute(); |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
public function getAssignedPages(array $fields = array(), array $params = array(), $pending = false) { |
222
|
|
|
$this->assureId(); |
223
|
|
|
|
224
|
|
|
$param_types = array( |
225
|
|
|
'email' => 'string', |
226
|
|
|
'user_id' => 'int', |
227
|
|
|
); |
228
|
|
|
$enums = array( |
229
|
|
|
); |
230
|
|
|
|
231
|
|
|
$request = new ApiRequest( |
232
|
|
|
$this->api, |
233
|
|
|
$this->data['id'], |
234
|
|
|
RequestInterface::METHOD_GET, |
235
|
|
|
'/assigned_pages', |
236
|
|
|
new AbstractCrudObject(), |
237
|
|
|
'EDGE', |
238
|
|
|
array(), |
239
|
|
|
new TypeChecker($param_types, $enums) |
240
|
|
|
); |
241
|
|
|
$request->addParams($params); |
242
|
|
|
$request->addFields($fields); |
243
|
|
|
return $pending ? $request : $request->execute(); |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
public function getAssignedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) { |
247
|
|
|
$this->assureId(); |
248
|
|
|
|
249
|
|
|
$param_types = array( |
250
|
|
|
'email' => 'string', |
251
|
|
|
'user_id' => 'int', |
252
|
|
|
); |
253
|
|
|
$enums = array( |
254
|
|
|
); |
255
|
|
|
|
256
|
|
|
$request = new ApiRequest( |
257
|
|
|
$this->api, |
258
|
|
|
$this->data['id'], |
259
|
|
|
RequestInterface::METHOD_GET, |
260
|
|
|
'/assigned_product_catalogs', |
261
|
|
|
new ProductCatalog(), |
262
|
|
|
'EDGE', |
263
|
|
|
ProductCatalog::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 getClientAdAccountRequests(array $fields = array(), array $params = array(), $pending = false) { |
272
|
|
|
$this->assureId(); |
273
|
|
|
|
274
|
|
|
$param_types = array( |
275
|
|
|
); |
276
|
|
|
$enums = array( |
277
|
|
|
); |
278
|
|
|
|
279
|
|
|
$request = new ApiRequest( |
280
|
|
|
$this->api, |
281
|
|
|
$this->data['id'], |
282
|
|
|
RequestInterface::METHOD_GET, |
283
|
|
|
'/client_ad_account_requests', |
284
|
|
|
new BusinessAdAccountRequest(), |
285
|
|
|
'EDGE', |
286
|
|
|
BusinessAdAccountRequest::getFieldsEnum()->getValues(), |
287
|
|
|
new TypeChecker($param_types, $enums) |
288
|
|
|
); |
289
|
|
|
$request->addParams($params); |
290
|
|
|
$request->addFields($fields); |
291
|
|
|
return $pending ? $request : $request->execute(); |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
public function getClientAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
295
|
|
|
$this->assureId(); |
296
|
|
|
|
297
|
|
|
$param_types = array( |
298
|
|
|
); |
299
|
|
|
$enums = array( |
300
|
|
|
); |
301
|
|
|
|
302
|
|
|
$request = new ApiRequest( |
303
|
|
|
$this->api, |
304
|
|
|
$this->data['id'], |
305
|
|
|
RequestInterface::METHOD_GET, |
306
|
|
|
'/client_ad_accounts', |
307
|
|
|
new AdAccount(), |
308
|
|
|
'EDGE', |
309
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
310
|
|
|
new TypeChecker($param_types, $enums) |
311
|
|
|
); |
312
|
|
|
$request->addParams($params); |
313
|
|
|
$request->addFields($fields); |
314
|
|
|
return $pending ? $request : $request->execute(); |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
public function getClientPageRequests(array $fields = array(), array $params = array(), $pending = false) { |
318
|
|
|
$this->assureId(); |
319
|
|
|
|
320
|
|
|
$param_types = array( |
321
|
|
|
); |
322
|
|
|
$enums = array( |
323
|
|
|
); |
324
|
|
|
|
325
|
|
|
$request = new ApiRequest( |
326
|
|
|
$this->api, |
327
|
|
|
$this->data['id'], |
328
|
|
|
RequestInterface::METHOD_GET, |
329
|
|
|
'/client_page_requests', |
330
|
|
|
new BusinessPageRequest(), |
331
|
|
|
'EDGE', |
332
|
|
|
BusinessPageRequest::getFieldsEnum()->getValues(), |
333
|
|
|
new TypeChecker($param_types, $enums) |
334
|
|
|
); |
335
|
|
|
$request->addParams($params); |
336
|
|
|
$request->addFields($fields); |
337
|
|
|
return $pending ? $request : $request->execute(); |
338
|
|
|
} |
339
|
|
|
|
340
|
|
|
public function getClientPages(array $fields = array(), array $params = array(), $pending = false) { |
341
|
|
|
$this->assureId(); |
342
|
|
|
|
343
|
|
|
$param_types = array( |
344
|
|
|
); |
345
|
|
|
$enums = array( |
346
|
|
|
); |
347
|
|
|
|
348
|
|
|
$request = new ApiRequest( |
349
|
|
|
$this->api, |
350
|
|
|
$this->data['id'], |
351
|
|
|
RequestInterface::METHOD_GET, |
352
|
|
|
'/client_pages', |
353
|
|
|
new AbstractCrudObject(), |
354
|
|
|
'EDGE', |
355
|
|
|
array(), |
356
|
|
|
new TypeChecker($param_types, $enums) |
357
|
|
|
); |
358
|
|
|
$request->addParams($params); |
359
|
|
|
$request->addFields($fields); |
360
|
|
|
return $pending ? $request : $request->execute(); |
361
|
|
|
} |
362
|
|
|
|
363
|
|
|
public function getEventSourceGroups(array $fields = array(), array $params = array(), $pending = false) { |
364
|
|
|
$this->assureId(); |
365
|
|
|
|
366
|
|
|
$param_types = array( |
367
|
|
|
); |
368
|
|
|
$enums = array( |
369
|
|
|
); |
370
|
|
|
|
371
|
|
|
$request = new ApiRequest( |
372
|
|
|
$this->api, |
373
|
|
|
$this->data['id'], |
374
|
|
|
RequestInterface::METHOD_GET, |
375
|
|
|
'/event_source_groups', |
376
|
|
|
new EventSourceGroup(), |
377
|
|
|
'EDGE', |
378
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
379
|
|
|
new TypeChecker($param_types, $enums) |
380
|
|
|
); |
381
|
|
|
$request->addParams($params); |
382
|
|
|
$request->addFields($fields); |
383
|
|
|
return $pending ? $request : $request->execute(); |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
public function createEventSourceGroup(array $fields = array(), array $params = array(), $pending = false) { |
387
|
|
|
$this->assureId(); |
388
|
|
|
|
389
|
|
|
$param_types = array( |
390
|
|
|
'event_sources' => 'list<string>', |
391
|
|
|
'name' => 'string', |
392
|
|
|
); |
393
|
|
|
$enums = array( |
394
|
|
|
); |
395
|
|
|
|
396
|
|
|
$request = new ApiRequest( |
397
|
|
|
$this->api, |
398
|
|
|
$this->data['id'], |
399
|
|
|
RequestInterface::METHOD_POST, |
400
|
|
|
'/event_source_groups', |
401
|
|
|
new EventSourceGroup(), |
402
|
|
|
'EDGE', |
403
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
404
|
|
|
new TypeChecker($param_types, $enums) |
405
|
|
|
); |
406
|
|
|
$request->addParams($params); |
407
|
|
|
$request->addFields($fields); |
408
|
|
|
return $pending ? $request : $request->execute(); |
409
|
|
|
} |
410
|
|
|
|
411
|
|
|
public function getGrpPlans(array $fields = array(), array $params = array(), $pending = false) { |
412
|
|
|
$this->assureId(); |
413
|
|
|
|
414
|
|
|
$param_types = array( |
415
|
|
|
'status' => 'status_enum', |
416
|
|
|
); |
417
|
|
|
$enums = array( |
418
|
|
|
'status_enum' => ReachFrequencyPredictionStatusValues::getInstance()->getValues(), |
419
|
|
|
); |
420
|
|
|
|
421
|
|
|
$request = new ApiRequest( |
422
|
|
|
$this->api, |
423
|
|
|
$this->data['id'], |
424
|
|
|
RequestInterface::METHOD_GET, |
425
|
|
|
'/grp_plans', |
426
|
|
|
new ReachFrequencyPrediction(), |
427
|
|
|
'EDGE', |
428
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
429
|
|
|
new TypeChecker($param_types, $enums) |
430
|
|
|
); |
431
|
|
|
$request->addParams($params); |
432
|
|
|
$request->addFields($fields); |
433
|
|
|
return $pending ? $request : $request->execute(); |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
437
|
|
|
$this->assureId(); |
438
|
|
|
|
439
|
|
|
$param_types = array( |
440
|
|
|
); |
441
|
|
|
$enums = array( |
442
|
|
|
); |
443
|
|
|
|
444
|
|
|
$request = new ApiRequest( |
445
|
|
|
$this->api, |
446
|
|
|
$this->data['id'], |
447
|
|
|
RequestInterface::METHOD_GET, |
448
|
|
|
'/instagram_accounts', |
449
|
|
|
new AbstractCrudObject(), |
450
|
|
|
'EDGE', |
451
|
|
|
array(), |
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 getMeasurementReports(array $fields = array(), array $params = array(), $pending = false) { |
460
|
|
|
$this->assureId(); |
461
|
|
|
|
462
|
|
|
$param_types = array( |
463
|
|
|
'filters' => 'list<Object>', |
464
|
|
|
'report_type' => 'report_type_enum', |
465
|
|
|
); |
466
|
|
|
$enums = array( |
467
|
|
|
'report_type_enum' => array( |
468
|
|
|
'multi_channel_report', |
469
|
|
|
'video_metrics_report', |
470
|
|
|
'fruit_rollup_report', |
471
|
|
|
'third_party_mta_report', |
472
|
|
|
), |
473
|
|
|
); |
474
|
|
|
|
475
|
|
|
$request = new ApiRequest( |
476
|
|
|
$this->api, |
477
|
|
|
$this->data['id'], |
478
|
|
|
RequestInterface::METHOD_GET, |
479
|
|
|
'/measurement_reports', |
480
|
|
|
new AbstractCrudObject(), |
481
|
|
|
'EDGE', |
482
|
|
|
array(), |
483
|
|
|
new TypeChecker($param_types, $enums) |
484
|
|
|
); |
485
|
|
|
$request->addParams($params); |
486
|
|
|
$request->addFields($fields); |
487
|
|
|
return $pending ? $request : $request->execute(); |
488
|
|
|
} |
489
|
|
|
|
490
|
|
|
public function createMeasurementReport(array $fields = array(), array $params = array(), $pending = false) { |
491
|
|
|
$this->assureId(); |
492
|
|
|
|
493
|
|
|
$param_types = array( |
494
|
|
|
'metadata' => 'string', |
495
|
|
|
'report_type' => 'report_type_enum', |
496
|
|
|
); |
497
|
|
|
$enums = array( |
498
|
|
|
'report_type_enum' => array( |
499
|
|
|
'multi_channel_report', |
500
|
|
|
'video_metrics_report', |
501
|
|
|
'fruit_rollup_report', |
502
|
|
|
'third_party_mta_report', |
503
|
|
|
), |
504
|
|
|
); |
505
|
|
|
|
506
|
|
|
$request = new ApiRequest( |
507
|
|
|
$this->api, |
508
|
|
|
$this->data['id'], |
509
|
|
|
RequestInterface::METHOD_POST, |
510
|
|
|
'/measurement_reports', |
511
|
|
|
new AbstractCrudObject(), |
512
|
|
|
'EDGE', |
513
|
|
|
array(), |
514
|
|
|
new TypeChecker($param_types, $enums) |
515
|
|
|
); |
516
|
|
|
$request->addParams($params); |
517
|
|
|
$request->addFields($fields); |
518
|
|
|
return $pending ? $request : $request->execute(); |
519
|
|
|
} |
520
|
|
|
|
521
|
|
|
public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) { |
522
|
|
|
$this->assureId(); |
523
|
|
|
|
524
|
|
|
$param_types = array( |
525
|
|
|
); |
526
|
|
|
$enums = array( |
527
|
|
|
); |
528
|
|
|
|
529
|
|
|
$request = new ApiRequest( |
530
|
|
|
$this->api, |
531
|
|
|
$this->data['id'], |
532
|
|
|
RequestInterface::METHOD_GET, |
533
|
|
|
'/offline_conversion_data_sets', |
534
|
|
|
new AbstractCrudObject(), |
535
|
|
|
'EDGE', |
536
|
|
|
array(), |
537
|
|
|
new TypeChecker($param_types, $enums) |
538
|
|
|
); |
539
|
|
|
$request->addParams($params); |
540
|
|
|
$request->addFields($fields); |
541
|
|
|
return $pending ? $request : $request->execute(); |
542
|
|
|
} |
543
|
|
|
|
544
|
|
|
public function createOfflineConversionDataSet(array $fields = array(), array $params = array(), $pending = false) { |
545
|
|
|
$this->assureId(); |
546
|
|
|
|
547
|
|
|
$param_types = array( |
548
|
|
|
'description' => 'string', |
549
|
|
|
'name' => 'string', |
550
|
|
|
); |
551
|
|
|
$enums = array( |
552
|
|
|
); |
553
|
|
|
|
554
|
|
|
$request = new ApiRequest( |
555
|
|
|
$this->api, |
556
|
|
|
$this->data['id'], |
557
|
|
|
RequestInterface::METHOD_POST, |
558
|
|
|
'/offline_conversion_data_sets', |
559
|
|
|
new AbstractCrudObject(), |
560
|
|
|
'EDGE', |
561
|
|
|
array(), |
562
|
|
|
new TypeChecker($param_types, $enums) |
563
|
|
|
); |
564
|
|
|
$request->addParams($params); |
565
|
|
|
$request->addFields($fields); |
566
|
|
|
return $pending ? $request : $request->execute(); |
567
|
|
|
} |
568
|
|
|
|
569
|
|
|
public function getOwnedAdAccountRequests(array $fields = array(), array $params = array(), $pending = false) { |
570
|
|
|
$this->assureId(); |
571
|
|
|
|
572
|
|
|
$param_types = array( |
573
|
|
|
); |
574
|
|
|
$enums = array( |
575
|
|
|
); |
576
|
|
|
|
577
|
|
|
$request = new ApiRequest( |
578
|
|
|
$this->api, |
579
|
|
|
$this->data['id'], |
580
|
|
|
RequestInterface::METHOD_GET, |
581
|
|
|
'/owned_ad_account_requests', |
582
|
|
|
new BusinessAdAccountRequest(), |
583
|
|
|
'EDGE', |
584
|
|
|
BusinessAdAccountRequest::getFieldsEnum()->getValues(), |
585
|
|
|
new TypeChecker($param_types, $enums) |
586
|
|
|
); |
587
|
|
|
$request->addParams($params); |
588
|
|
|
$request->addFields($fields); |
589
|
|
|
return $pending ? $request : $request->execute(); |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
public function getOwnedAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
593
|
|
|
$this->assureId(); |
594
|
|
|
|
595
|
|
|
$param_types = array( |
596
|
|
|
); |
597
|
|
|
$enums = array( |
598
|
|
|
); |
599
|
|
|
|
600
|
|
|
$request = new ApiRequest( |
601
|
|
|
$this->api, |
602
|
|
|
$this->data['id'], |
603
|
|
|
RequestInterface::METHOD_GET, |
604
|
|
|
'/owned_ad_accounts', |
605
|
|
|
new AdAccount(), |
606
|
|
|
'EDGE', |
607
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
608
|
|
|
new TypeChecker($param_types, $enums) |
609
|
|
|
); |
610
|
|
|
$request->addParams($params); |
611
|
|
|
$request->addFields($fields); |
612
|
|
|
return $pending ? $request : $request->execute(); |
613
|
|
|
} |
614
|
|
|
|
615
|
|
|
public function getOwnedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
616
|
|
|
$this->assureId(); |
617
|
|
|
|
618
|
|
|
$param_types = array( |
619
|
|
|
); |
620
|
|
|
$enums = array( |
621
|
|
|
); |
622
|
|
|
|
623
|
|
|
$request = new ApiRequest( |
624
|
|
|
$this->api, |
625
|
|
|
$this->data['id'], |
626
|
|
|
RequestInterface::METHOD_GET, |
627
|
|
|
'/owned_instagram_accounts', |
628
|
|
|
new AbstractCrudObject(), |
629
|
|
|
'EDGE', |
630
|
|
|
array(), |
631
|
|
|
new TypeChecker($param_types, $enums) |
632
|
|
|
); |
633
|
|
|
$request->addParams($params); |
634
|
|
|
$request->addFields($fields); |
635
|
|
|
return $pending ? $request : $request->execute(); |
636
|
|
|
} |
637
|
|
|
|
638
|
|
|
public function getOwnedPageRequests(array $fields = array(), array $params = array(), $pending = false) { |
639
|
|
|
$this->assureId(); |
640
|
|
|
|
641
|
|
|
$param_types = array( |
642
|
|
|
); |
643
|
|
|
$enums = array( |
644
|
|
|
); |
645
|
|
|
|
646
|
|
|
$request = new ApiRequest( |
647
|
|
|
$this->api, |
648
|
|
|
$this->data['id'], |
649
|
|
|
RequestInterface::METHOD_GET, |
650
|
|
|
'/owned_page_requests', |
651
|
|
|
new BusinessPageRequest(), |
652
|
|
|
'EDGE', |
653
|
|
|
BusinessPageRequest::getFieldsEnum()->getValues(), |
654
|
|
|
new TypeChecker($param_types, $enums) |
655
|
|
|
); |
656
|
|
|
$request->addParams($params); |
657
|
|
|
$request->addFields($fields); |
658
|
|
|
return $pending ? $request : $request->execute(); |
659
|
|
|
} |
660
|
|
|
|
661
|
|
|
public function getOwnedPages(array $fields = array(), array $params = array(), $pending = false) { |
662
|
|
|
$this->assureId(); |
663
|
|
|
|
664
|
|
|
$param_types = array( |
665
|
|
|
); |
666
|
|
|
$enums = array( |
667
|
|
|
); |
668
|
|
|
|
669
|
|
|
$request = new ApiRequest( |
670
|
|
|
$this->api, |
671
|
|
|
$this->data['id'], |
672
|
|
|
RequestInterface::METHOD_GET, |
673
|
|
|
'/owned_pages', |
674
|
|
|
new AbstractCrudObject(), |
675
|
|
|
'EDGE', |
676
|
|
|
array(), |
677
|
|
|
new TypeChecker($param_types, $enums) |
678
|
|
|
); |
679
|
|
|
$request->addParams($params); |
680
|
|
|
$request->addFields($fields); |
681
|
|
|
return $pending ? $request : $request->execute(); |
682
|
|
|
} |
683
|
|
|
|
684
|
|
|
public function getOwnedPixels(array $fields = array(), array $params = array(), $pending = false) { |
685
|
|
|
$this->assureId(); |
686
|
|
|
|
687
|
|
|
$param_types = array( |
688
|
|
|
); |
689
|
|
|
$enums = array( |
690
|
|
|
); |
691
|
|
|
|
692
|
|
|
$request = new ApiRequest( |
693
|
|
|
$this->api, |
694
|
|
|
$this->data['id'], |
695
|
|
|
RequestInterface::METHOD_GET, |
696
|
|
|
'/owned_pixels', |
697
|
|
|
new AdsPixel(), |
698
|
|
|
'EDGE', |
699
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
700
|
|
|
new TypeChecker($param_types, $enums) |
701
|
|
|
); |
702
|
|
|
$request->addParams($params); |
703
|
|
|
$request->addFields($fields); |
704
|
|
|
return $pending ? $request : $request->execute(); |
705
|
|
|
} |
706
|
|
|
|
707
|
|
|
public function getPicture(array $fields = array(), array $params = array(), $pending = false) { |
708
|
|
|
$this->assureId(); |
709
|
|
|
|
710
|
|
|
$param_types = array( |
711
|
|
|
'height' => 'int', |
712
|
|
|
'redirect' => 'bool', |
713
|
|
|
'type' => 'type_enum', |
714
|
|
|
'width' => 'int', |
715
|
|
|
); |
716
|
|
|
$enums = array( |
717
|
|
|
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(), |
718
|
|
|
); |
719
|
|
|
|
720
|
|
|
$request = new ApiRequest( |
721
|
|
|
$this->api, |
722
|
|
|
$this->data['id'], |
723
|
|
|
RequestInterface::METHOD_GET, |
724
|
|
|
'/picture', |
725
|
|
|
new ProfilePictureSource(), |
726
|
|
|
'EDGE', |
727
|
|
|
ProfilePictureSource::getFieldsEnum()->getValues(), |
728
|
|
|
new TypeChecker($param_types, $enums) |
729
|
|
|
); |
730
|
|
|
$request->addParams($params); |
731
|
|
|
$request->addFields($fields); |
732
|
|
|
return $pending ? $request : $request->execute(); |
733
|
|
|
} |
734
|
|
|
|
735
|
|
|
public function getProductCatalogs(array $fields = array(), array $params = array(), $pending = false) { |
736
|
|
|
$this->assureId(); |
737
|
|
|
|
738
|
|
|
$param_types = array( |
739
|
|
|
); |
740
|
|
|
$enums = array( |
741
|
|
|
); |
742
|
|
|
|
743
|
|
|
$request = new ApiRequest( |
744
|
|
|
$this->api, |
745
|
|
|
$this->data['id'], |
746
|
|
|
RequestInterface::METHOD_GET, |
747
|
|
|
'/product_catalogs', |
748
|
|
|
new ProductCatalog(), |
749
|
|
|
'EDGE', |
750
|
|
|
ProductCatalog::getFieldsEnum()->getValues(), |
751
|
|
|
new TypeChecker($param_types, $enums) |
752
|
|
|
); |
753
|
|
|
$request->addParams($params); |
754
|
|
|
$request->addFields($fields); |
755
|
|
|
return $pending ? $request : $request->execute(); |
756
|
|
|
} |
757
|
|
|
|
758
|
|
|
public function createProductCatalog(array $fields = array(), array $params = array(), $pending = false) { |
759
|
|
|
$this->assureId(); |
760
|
|
|
|
761
|
|
|
$param_types = array( |
762
|
|
|
'name' => 'string', |
763
|
|
|
'vertical' => 'vertical_enum', |
764
|
|
|
); |
765
|
|
|
$enums = array( |
766
|
|
|
'vertical_enum' => ProductCatalogVerticalValues::getInstance()->getValues(), |
767
|
|
|
); |
768
|
|
|
|
769
|
|
|
$request = new ApiRequest( |
770
|
|
|
$this->api, |
771
|
|
|
$this->data['id'], |
772
|
|
|
RequestInterface::METHOD_POST, |
773
|
|
|
'/product_catalogs', |
774
|
|
|
new ProductCatalog(), |
775
|
|
|
'EDGE', |
776
|
|
|
ProductCatalog::getFieldsEnum()->getValues(), |
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 getReceivedAudiencePermissions(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
|
|
|
'/received_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 getSharedAudiencePermissions(array $fields = array(), array $params = array(), $pending = false) { |
809
|
|
|
$this->assureId(); |
810
|
|
|
|
811
|
|
|
$param_types = array( |
812
|
|
|
'partner_id' => 'string', |
813
|
|
|
); |
814
|
|
|
$enums = array( |
815
|
|
|
); |
816
|
|
|
|
817
|
|
|
$request = new ApiRequest( |
818
|
|
|
$this->api, |
819
|
|
|
$this->data['id'], |
820
|
|
|
RequestInterface::METHOD_GET, |
821
|
|
|
'/shared_audience_permissions', |
822
|
|
|
new AbstractCrudObject(), |
823
|
|
|
'EDGE', |
824
|
|
|
array(), |
825
|
|
|
new TypeChecker($param_types, $enums) |
826
|
|
|
); |
827
|
|
|
$request->addParams($params); |
828
|
|
|
$request->addFields($fields); |
829
|
|
|
return $pending ? $request : $request->execute(); |
830
|
|
|
} |
831
|
|
|
|
832
|
|
|
public function getSystemUsers(array $fields = array(), array $params = array(), $pending = false) { |
833
|
|
|
$this->assureId(); |
834
|
|
|
|
835
|
|
|
$param_types = array( |
836
|
|
|
); |
837
|
|
|
$enums = array( |
838
|
|
|
); |
839
|
|
|
|
840
|
|
|
$request = new ApiRequest( |
841
|
|
|
$this->api, |
842
|
|
|
$this->data['id'], |
843
|
|
|
RequestInterface::METHOD_GET, |
844
|
|
|
'/system_users', |
845
|
|
|
new AbstractCrudObject(), |
846
|
|
|
'EDGE', |
847
|
|
|
array(), |
848
|
|
|
new TypeChecker($param_types, $enums) |
849
|
|
|
); |
850
|
|
|
$request->addParams($params); |
851
|
|
|
$request->addFields($fields); |
852
|
|
|
return $pending ? $request : $request->execute(); |
853
|
|
|
} |
854
|
|
|
|
855
|
|
|
public function createUserPermission(array $fields = array(), array $params = array(), $pending = false) { |
856
|
|
|
$this->assureId(); |
857
|
|
|
|
858
|
|
|
$param_types = array( |
859
|
|
|
'email' => 'string', |
860
|
|
|
'role' => 'role_enum', |
861
|
|
|
'user' => 'int', |
862
|
|
|
); |
863
|
|
|
$enums = array( |
864
|
|
|
'role_enum' => array( |
865
|
|
|
'ADMIN', |
866
|
|
|
'EMPLOYEE', |
867
|
|
|
'SYSTEM_USER', |
868
|
|
|
'ADMIN_SYSTEM_USER', |
869
|
|
|
'INSTAGRAM_ADMIN', |
870
|
|
|
'INSTAGRAM_EMPLOYEE', |
871
|
|
|
'FB_EMPLOYEE_ACCOUNT_MANAGER', |
872
|
|
|
'FB_EMPLOYEE_SALES_REP', |
873
|
|
|
), |
874
|
|
|
); |
875
|
|
|
|
876
|
|
|
$request = new ApiRequest( |
877
|
|
|
$this->api, |
878
|
|
|
$this->data['id'], |
879
|
|
|
RequestInterface::METHOD_POST, |
880
|
|
|
'/userpermissions', |
881
|
|
|
new AbstractCrudObject(), |
882
|
|
|
'EDGE', |
883
|
|
|
array(), |
884
|
|
|
new TypeChecker($param_types, $enums) |
885
|
|
|
); |
886
|
|
|
$request->addParams($params); |
887
|
|
|
$request->addFields($fields); |
888
|
|
|
return $pending ? $request : $request->execute(); |
889
|
|
|
} |
890
|
|
|
|
891
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
892
|
|
|
$this->assureId(); |
893
|
|
|
|
894
|
|
|
$param_types = array( |
895
|
|
|
); |
896
|
|
|
$enums = array( |
897
|
|
|
); |
898
|
|
|
|
899
|
|
|
$request = new ApiRequest( |
900
|
|
|
$this->api, |
901
|
|
|
$this->data['id'], |
902
|
|
|
RequestInterface::METHOD_GET, |
903
|
|
|
'/', |
904
|
|
|
new Business(), |
905
|
|
|
'NODE', |
906
|
|
|
Business::getFieldsEnum()->getValues(), |
907
|
|
|
new TypeChecker($param_types, $enums) |
908
|
|
|
); |
909
|
|
|
$request->addParams($params); |
910
|
|
|
$request->addFields($fields); |
911
|
|
|
return $pending ? $request : $request->execute(); |
912
|
|
|
} |
913
|
|
|
|
914
|
|
|
} |
915
|
|
|
|