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