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 createAdAccountCreationRequest(array $fields = array(), array $params = array(), $pending = false) { |
98
|
|
|
$this->assureId(); |
99
|
|
|
|
100
|
|
|
$param_types = array( |
101
|
|
|
'account_type' => 'string', |
102
|
|
|
'additional_comment' => 'string', |
103
|
|
|
'address_in_chinese' => 'string', |
104
|
|
|
'address_in_english' => 'Object', |
105
|
|
|
'billing_party_name' => 'string', |
106
|
|
|
'business_registration' => 'file', |
107
|
|
|
'business_registration_id' => 'unsigned int', |
108
|
|
|
'chinese_legal_entity_name' => 'string', |
109
|
|
|
'contact' => 'Object', |
110
|
|
|
'currency' => 'string', |
111
|
|
|
'english_legal_entity_name' => 'string', |
112
|
|
|
'fb_page_url' => 'string', |
113
|
|
|
'fb_sales_rep_email' => 'string', |
114
|
|
|
'has_planning_agency' => 'bool', |
115
|
|
|
'is_targeting_outside_china' => 'bool', |
116
|
|
|
'planning_agency_name' => 'string', |
117
|
|
|
); |
118
|
|
|
$enums = array( |
119
|
|
|
); |
120
|
|
|
|
121
|
|
|
$request = new ApiRequest( |
122
|
|
|
$this->api, |
123
|
|
|
$this->data['id'], |
124
|
|
|
RequestInterface::METHOD_POST, |
125
|
|
|
'/adaccountcreationrequests', |
126
|
|
|
new AbstractCrudObject(), |
127
|
|
|
'EDGE', |
128
|
|
|
array(), |
129
|
|
|
new TypeChecker($param_types, $enums) |
130
|
|
|
); |
131
|
|
|
$request->addParams($params); |
132
|
|
|
$request->addFields($fields); |
133
|
|
|
return $pending ? $request : $request->execute(); |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
public function createAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
137
|
|
|
$this->assureId(); |
138
|
|
|
|
139
|
|
|
$param_types = array( |
140
|
|
|
'access_type' => 'access_type_enum', |
141
|
|
|
'adaccount_id' => 'string', |
142
|
|
|
'permitted_roles' => 'list<permitted_roles_enum>', |
143
|
|
|
); |
144
|
|
|
$enums = array( |
145
|
|
|
'access_type_enum' => AdAccountAccessTypeValues::getInstance()->getValues(), |
146
|
|
|
'permitted_roles_enum' => AdAccountPermittedRolesValues::getInstance()->getValues(), |
147
|
|
|
); |
148
|
|
|
|
149
|
|
|
$request = new ApiRequest( |
150
|
|
|
$this->api, |
151
|
|
|
$this->data['id'], |
152
|
|
|
RequestInterface::METHOD_POST, |
153
|
|
|
'/adaccounts', |
154
|
|
|
new AdAccount(), |
155
|
|
|
'EDGE', |
156
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
157
|
|
|
new TypeChecker($param_types, $enums) |
158
|
|
|
); |
159
|
|
|
$request->addParams($params); |
160
|
|
|
$request->addFields($fields); |
161
|
|
|
return $pending ? $request : $request->execute(); |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
public function getAdsPixels(array $fields = array(), array $params = array(), $pending = false) { |
165
|
|
|
$this->assureId(); |
166
|
|
|
|
167
|
|
|
$param_types = array( |
168
|
|
|
); |
169
|
|
|
$enums = array( |
170
|
|
|
); |
171
|
|
|
|
172
|
|
|
$request = new ApiRequest( |
173
|
|
|
$this->api, |
174
|
|
|
$this->data['id'], |
175
|
|
|
RequestInterface::METHOD_GET, |
176
|
|
|
'/adspixels', |
177
|
|
|
new AdsPixel(), |
178
|
|
|
'EDGE', |
179
|
|
|
AdsPixel::getFieldsEnum()->getValues(), |
180
|
|
|
new TypeChecker($param_types, $enums) |
181
|
|
|
); |
182
|
|
|
$request->addParams($params); |
183
|
|
|
$request->addFields($fields); |
184
|
|
|
return $pending ? $request : $request->execute(); |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
public function deleteApps(array $fields = array(), array $params = array(), $pending = false) { |
188
|
|
|
$this->assureId(); |
189
|
|
|
|
190
|
|
|
$param_types = array( |
191
|
|
|
'app_id' => 'int', |
192
|
|
|
); |
193
|
|
|
$enums = array( |
194
|
|
|
); |
195
|
|
|
|
196
|
|
|
$request = new ApiRequest( |
197
|
|
|
$this->api, |
198
|
|
|
$this->data['id'], |
199
|
|
|
RequestInterface::METHOD_DELETE, |
200
|
|
|
'/apps', |
201
|
|
|
new AbstractCrudObject(), |
202
|
|
|
'EDGE', |
203
|
|
|
array(), |
204
|
|
|
new TypeChecker($param_types, $enums) |
205
|
|
|
); |
206
|
|
|
$request->addParams($params); |
207
|
|
|
$request->addFields($fields); |
208
|
|
|
return $pending ? $request : $request->execute(); |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
public function getAssignedAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
212
|
|
|
$this->assureId(); |
213
|
|
|
|
214
|
|
|
$param_types = array( |
215
|
|
|
'email' => 'string', |
216
|
|
|
'user_id' => 'int', |
217
|
|
|
); |
218
|
|
|
$enums = array( |
219
|
|
|
); |
220
|
|
|
|
221
|
|
|
$request = new ApiRequest( |
222
|
|
|
$this->api, |
223
|
|
|
$this->data['id'], |
224
|
|
|
RequestInterface::METHOD_GET, |
225
|
|
|
'/assigned_ad_accounts', |
226
|
|
|
new AdAccount(), |
227
|
|
|
'EDGE', |
228
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
229
|
|
|
new TypeChecker($param_types, $enums) |
230
|
|
|
); |
231
|
|
|
$request->addParams($params); |
232
|
|
|
$request->addFields($fields); |
233
|
|
|
return $pending ? $request : $request->execute(); |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
public function getAssignedPages(array $fields = array(), array $params = array(), $pending = false) { |
237
|
|
|
$this->assureId(); |
238
|
|
|
|
239
|
|
|
$param_types = array( |
240
|
|
|
'email' => 'string', |
241
|
|
|
'user_id' => 'int', |
242
|
|
|
); |
243
|
|
|
$enums = array( |
244
|
|
|
); |
245
|
|
|
|
246
|
|
|
$request = new ApiRequest( |
247
|
|
|
$this->api, |
248
|
|
|
$this->data['id'], |
249
|
|
|
RequestInterface::METHOD_GET, |
250
|
|
|
'/assigned_pages', |
251
|
|
|
new AbstractCrudObject(), |
252
|
|
|
'EDGE', |
253
|
|
|
array(), |
254
|
|
|
new TypeChecker($param_types, $enums) |
255
|
|
|
); |
256
|
|
|
$request->addParams($params); |
257
|
|
|
$request->addFields($fields); |
258
|
|
|
return $pending ? $request : $request->execute(); |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
public function getAssignedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) { |
262
|
|
|
$this->assureId(); |
263
|
|
|
|
264
|
|
|
$param_types = array( |
265
|
|
|
'email' => 'string', |
266
|
|
|
'user_id' => 'int', |
267
|
|
|
); |
268
|
|
|
$enums = array( |
269
|
|
|
); |
270
|
|
|
|
271
|
|
|
$request = new ApiRequest( |
272
|
|
|
$this->api, |
273
|
|
|
$this->data['id'], |
274
|
|
|
RequestInterface::METHOD_GET, |
275
|
|
|
'/assigned_product_catalogs', |
276
|
|
|
new ProductCatalog(), |
277
|
|
|
'EDGE', |
278
|
|
|
ProductCatalog::getFieldsEnum()->getValues(), |
279
|
|
|
new TypeChecker($param_types, $enums) |
280
|
|
|
); |
281
|
|
|
$request->addParams($params); |
282
|
|
|
$request->addFields($fields); |
283
|
|
|
return $pending ? $request : $request->execute(); |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
public function getClientAdAccountRequests(array $fields = array(), array $params = array(), $pending = false) { |
287
|
|
|
$this->assureId(); |
288
|
|
|
|
289
|
|
|
$param_types = array( |
290
|
|
|
); |
291
|
|
|
$enums = array( |
292
|
|
|
); |
293
|
|
|
|
294
|
|
|
$request = new ApiRequest( |
295
|
|
|
$this->api, |
296
|
|
|
$this->data['id'], |
297
|
|
|
RequestInterface::METHOD_GET, |
298
|
|
|
'/client_ad_account_requests', |
299
|
|
|
new BusinessAdAccountRequest(), |
300
|
|
|
'EDGE', |
301
|
|
|
BusinessAdAccountRequest::getFieldsEnum()->getValues(), |
302
|
|
|
new TypeChecker($param_types, $enums) |
303
|
|
|
); |
304
|
|
|
$request->addParams($params); |
305
|
|
|
$request->addFields($fields); |
306
|
|
|
return $pending ? $request : $request->execute(); |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
public function getClientAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
310
|
|
|
$this->assureId(); |
311
|
|
|
|
312
|
|
|
$param_types = array( |
313
|
|
|
); |
314
|
|
|
$enums = array( |
315
|
|
|
); |
316
|
|
|
|
317
|
|
|
$request = new ApiRequest( |
318
|
|
|
$this->api, |
319
|
|
|
$this->data['id'], |
320
|
|
|
RequestInterface::METHOD_GET, |
321
|
|
|
'/client_ad_accounts', |
322
|
|
|
new AdAccount(), |
323
|
|
|
'EDGE', |
324
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
325
|
|
|
new TypeChecker($param_types, $enums) |
326
|
|
|
); |
327
|
|
|
$request->addParams($params); |
328
|
|
|
$request->addFields($fields); |
329
|
|
|
return $pending ? $request : $request->execute(); |
330
|
|
|
} |
331
|
|
|
|
332
|
|
|
public function getClientPageRequests(array $fields = array(), array $params = array(), $pending = false) { |
333
|
|
|
$this->assureId(); |
334
|
|
|
|
335
|
|
|
$param_types = array( |
336
|
|
|
); |
337
|
|
|
$enums = array( |
338
|
|
|
); |
339
|
|
|
|
340
|
|
|
$request = new ApiRequest( |
341
|
|
|
$this->api, |
342
|
|
|
$this->data['id'], |
343
|
|
|
RequestInterface::METHOD_GET, |
344
|
|
|
'/client_page_requests', |
345
|
|
|
new BusinessPageRequest(), |
346
|
|
|
'EDGE', |
347
|
|
|
BusinessPageRequest::getFieldsEnum()->getValues(), |
348
|
|
|
new TypeChecker($param_types, $enums) |
349
|
|
|
); |
350
|
|
|
$request->addParams($params); |
351
|
|
|
$request->addFields($fields); |
352
|
|
|
return $pending ? $request : $request->execute(); |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
public function getClientPages(array $fields = array(), array $params = array(), $pending = false) { |
356
|
|
|
$this->assureId(); |
357
|
|
|
|
358
|
|
|
$param_types = array( |
359
|
|
|
); |
360
|
|
|
$enums = array( |
361
|
|
|
); |
362
|
|
|
|
363
|
|
|
$request = new ApiRequest( |
364
|
|
|
$this->api, |
365
|
|
|
$this->data['id'], |
366
|
|
|
RequestInterface::METHOD_GET, |
367
|
|
|
'/client_pages', |
368
|
|
|
new AbstractCrudObject(), |
369
|
|
|
'EDGE', |
370
|
|
|
array(), |
371
|
|
|
new TypeChecker($param_types, $enums) |
372
|
|
|
); |
373
|
|
|
$request->addParams($params); |
374
|
|
|
$request->addFields($fields); |
375
|
|
|
return $pending ? $request : $request->execute(); |
376
|
|
|
} |
377
|
|
|
|
378
|
|
|
public function createEventSourceGroup(array $fields = array(), array $params = array(), $pending = false) { |
379
|
|
|
$this->assureId(); |
380
|
|
|
|
381
|
|
|
$param_types = array( |
382
|
|
|
'event_sources' => 'list<string>', |
383
|
|
|
'name' => 'string', |
384
|
|
|
); |
385
|
|
|
$enums = array( |
386
|
|
|
); |
387
|
|
|
|
388
|
|
|
$request = new ApiRequest( |
389
|
|
|
$this->api, |
390
|
|
|
$this->data['id'], |
391
|
|
|
RequestInterface::METHOD_POST, |
392
|
|
|
'/event_source_groups', |
393
|
|
|
new EventSourceGroup(), |
394
|
|
|
'EDGE', |
395
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
396
|
|
|
new TypeChecker($param_types, $enums) |
397
|
|
|
); |
398
|
|
|
$request->addParams($params); |
399
|
|
|
$request->addFields($fields); |
400
|
|
|
return $pending ? $request : $request->execute(); |
401
|
|
|
} |
402
|
|
|
|
403
|
|
|
public function getGrpPlans(array $fields = array(), array $params = array(), $pending = false) { |
404
|
|
|
$this->assureId(); |
405
|
|
|
|
406
|
|
|
$param_types = array( |
407
|
|
|
'status' => 'status_enum', |
408
|
|
|
); |
409
|
|
|
$enums = array( |
410
|
|
|
'status_enum' => ReachFrequencyPredictionStatusValues::getInstance()->getValues(), |
411
|
|
|
); |
412
|
|
|
|
413
|
|
|
$request = new ApiRequest( |
414
|
|
|
$this->api, |
415
|
|
|
$this->data['id'], |
416
|
|
|
RequestInterface::METHOD_GET, |
417
|
|
|
'/grp_plans', |
418
|
|
|
new ReachFrequencyPrediction(), |
419
|
|
|
'EDGE', |
420
|
|
|
ReachFrequencyPrediction::getFieldsEnum()->getValues(), |
421
|
|
|
new TypeChecker($param_types, $enums) |
422
|
|
|
); |
423
|
|
|
$request->addParams($params); |
424
|
|
|
$request->addFields($fields); |
425
|
|
|
return $pending ? $request : $request->execute(); |
426
|
|
|
} |
427
|
|
|
|
428
|
|
|
public function getInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) { |
429
|
|
|
$this->assureId(); |
430
|
|
|
|
431
|
|
|
$param_types = array( |
432
|
|
|
); |
433
|
|
|
$enums = array( |
434
|
|
|
); |
435
|
|
|
|
436
|
|
|
$request = new ApiRequest( |
437
|
|
|
$this->api, |
438
|
|
|
$this->data['id'], |
439
|
|
|
RequestInterface::METHOD_GET, |
440
|
|
|
'/instagram_accounts', |
441
|
|
|
new AbstractCrudObject(), |
442
|
|
|
'EDGE', |
443
|
|
|
array(), |
444
|
|
|
new TypeChecker($param_types, $enums) |
445
|
|
|
); |
446
|
|
|
$request->addParams($params); |
447
|
|
|
$request->addFields($fields); |
448
|
|
|
return $pending ? $request : $request->execute(); |
449
|
|
|
} |
450
|
|
|
|
451
|
|
|
public function getMeasurementReports(array $fields = array(), array $params = array(), $pending = false) { |
452
|
|
|
$this->assureId(); |
453
|
|
|
|
454
|
|
|
$param_types = array( |
455
|
|
|
'filters' => 'list<Object>', |
456
|
|
|
'report_type' => 'report_type_enum', |
457
|
|
|
); |
458
|
|
|
$enums = array( |
459
|
|
|
'report_type_enum' => array( |
460
|
|
|
'multi_channel_report', |
461
|
|
|
'video_metrics_report', |
462
|
|
|
'fruit_rollup_report', |
463
|
|
|
'third_party_mta_report', |
464
|
|
|
), |
465
|
|
|
); |
466
|
|
|
|
467
|
|
|
$request = new ApiRequest( |
468
|
|
|
$this->api, |
469
|
|
|
$this->data['id'], |
470
|
|
|
RequestInterface::METHOD_GET, |
471
|
|
|
'/measurement_reports', |
472
|
|
|
new AbstractCrudObject(), |
473
|
|
|
'EDGE', |
474
|
|
|
array(), |
475
|
|
|
new TypeChecker($param_types, $enums) |
476
|
|
|
); |
477
|
|
|
$request->addParams($params); |
478
|
|
|
$request->addFields($fields); |
479
|
|
|
return $pending ? $request : $request->execute(); |
480
|
|
|
} |
481
|
|
|
|
482
|
|
|
public function createMeasurementReport(array $fields = array(), array $params = array(), $pending = false) { |
483
|
|
|
$this->assureId(); |
484
|
|
|
|
485
|
|
|
$param_types = array( |
486
|
|
|
'metadata' => 'string', |
487
|
|
|
'report_type' => 'report_type_enum', |
488
|
|
|
); |
489
|
|
|
$enums = array( |
490
|
|
|
'report_type_enum' => array( |
491
|
|
|
'multi_channel_report', |
492
|
|
|
'video_metrics_report', |
493
|
|
|
'fruit_rollup_report', |
494
|
|
|
'third_party_mta_report', |
495
|
|
|
), |
496
|
|
|
); |
497
|
|
|
|
498
|
|
|
$request = new ApiRequest( |
499
|
|
|
$this->api, |
500
|
|
|
$this->data['id'], |
501
|
|
|
RequestInterface::METHOD_POST, |
502
|
|
|
'/measurement_reports', |
503
|
|
|
new AbstractCrudObject(), |
504
|
|
|
'EDGE', |
505
|
|
|
array(), |
506
|
|
|
new TypeChecker($param_types, $enums) |
507
|
|
|
); |
508
|
|
|
$request->addParams($params); |
509
|
|
|
$request->addFields($fields); |
510
|
|
|
return $pending ? $request : $request->execute(); |
511
|
|
|
} |
512
|
|
|
|
513
|
|
|
public function getOfflineConversionDataSets(array $fields = array(), array $params = array(), $pending = false) { |
514
|
|
|
$this->assureId(); |
515
|
|
|
|
516
|
|
|
$param_types = array( |
517
|
|
|
); |
518
|
|
|
$enums = array( |
519
|
|
|
); |
520
|
|
|
|
521
|
|
|
$request = new ApiRequest( |
522
|
|
|
$this->api, |
523
|
|
|
$this->data['id'], |
524
|
|
|
RequestInterface::METHOD_GET, |
525
|
|
|
'/offline_conversion_data_sets', |
526
|
|
|
new AbstractCrudObject(), |
527
|
|
|
'EDGE', |
528
|
|
|
array(), |
529
|
|
|
new TypeChecker($param_types, $enums) |
530
|
|
|
); |
531
|
|
|
$request->addParams($params); |
532
|
|
|
$request->addFields($fields); |
533
|
|
|
return $pending ? $request : $request->execute(); |
534
|
|
|
} |
535
|
|
|
|
536
|
|
|
public function createOfflineConversionDataSet(array $fields = array(), array $params = array(), $pending = false) { |
537
|
|
|
$this->assureId(); |
538
|
|
|
|
539
|
|
|
$param_types = array( |
540
|
|
|
'description' => 'string', |
541
|
|
|
'name' => 'string', |
542
|
|
|
); |
543
|
|
|
$enums = array( |
544
|
|
|
); |
545
|
|
|
|
546
|
|
|
$request = new ApiRequest( |
547
|
|
|
$this->api, |
548
|
|
|
$this->data['id'], |
549
|
|
|
RequestInterface::METHOD_POST, |
550
|
|
|
'/offline_conversion_data_sets', |
551
|
|
|
new AbstractCrudObject(), |
552
|
|
|
'EDGE', |
553
|
|
|
array(), |
554
|
|
|
new TypeChecker($param_types, $enums) |
555
|
|
|
); |
556
|
|
|
$request->addParams($params); |
557
|
|
|
$request->addFields($fields); |
558
|
|
|
return $pending ? $request : $request->execute(); |
559
|
|
|
} |
560
|
|
|
|
561
|
|
|
public function getOwnedAdAccountRequests(array $fields = array(), array $params = array(), $pending = false) { |
562
|
|
|
$this->assureId(); |
563
|
|
|
|
564
|
|
|
$param_types = array( |
565
|
|
|
); |
566
|
|
|
$enums = array( |
567
|
|
|
); |
568
|
|
|
|
569
|
|
|
$request = new ApiRequest( |
570
|
|
|
$this->api, |
571
|
|
|
$this->data['id'], |
572
|
|
|
RequestInterface::METHOD_GET, |
573
|
|
|
'/owned_ad_account_requests', |
574
|
|
|
new BusinessAdAccountRequest(), |
575
|
|
|
'EDGE', |
576
|
|
|
BusinessAdAccountRequest::getFieldsEnum()->getValues(), |
577
|
|
|
new TypeChecker($param_types, $enums) |
578
|
|
|
); |
579
|
|
|
$request->addParams($params); |
580
|
|
|
$request->addFields($fields); |
581
|
|
|
return $pending ? $request : $request->execute(); |
582
|
|
|
} |
583
|
|
|
|
584
|
|
|
public function getOwnedAdAccounts(array $fields = array(), array $params = array(), $pending = false) { |
585
|
|
|
$this->assureId(); |
586
|
|
|
|
587
|
|
|
$param_types = array( |
588
|
|
|
); |
589
|
|
|
$enums = array( |
590
|
|
|
); |
591
|
|
|
|
592
|
|
|
$request = new ApiRequest( |
593
|
|
|
$this->api, |
594
|
|
|
$this->data['id'], |
595
|
|
|
RequestInterface::METHOD_GET, |
596
|
|
|
'/owned_ad_accounts', |
597
|
|
|
new AdAccount(), |
598
|
|
|
'EDGE', |
599
|
|
|
AdAccount::getFieldsEnum()->getValues(), |
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 getOwnedInstagramAccounts(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_instagram_accounts', |
620
|
|
|
new AbstractCrudObject(), |
621
|
|
|
'EDGE', |
622
|
|
|
array(), |
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 getOwnedPageRequests(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_page_requests', |
643
|
|
|
new BusinessPageRequest(), |
644
|
|
|
'EDGE', |
645
|
|
|
BusinessPageRequest::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 getOwnedPages(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_pages', |
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 getOwnedPixels(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_pixels', |
689
|
|
|
new AdsPixel(), |
690
|
|
|
'EDGE', |
691
|
|
|
AdsPixel::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 getPicture(array $fields = array(), array $params = array(), $pending = false) { |
700
|
|
|
$this->assureId(); |
701
|
|
|
|
702
|
|
|
$param_types = array( |
703
|
|
|
'height' => 'int', |
704
|
|
|
'redirect' => 'bool', |
705
|
|
|
'type' => 'type_enum', |
706
|
|
|
'width' => 'int', |
707
|
|
|
); |
708
|
|
|
$enums = array( |
709
|
|
|
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(), |
710
|
|
|
); |
711
|
|
|
|
712
|
|
|
$request = new ApiRequest( |
713
|
|
|
$this->api, |
714
|
|
|
$this->data['id'], |
715
|
|
|
RequestInterface::METHOD_GET, |
716
|
|
|
'/picture', |
717
|
|
|
new ProfilePictureSource(), |
718
|
|
|
'EDGE', |
719
|
|
|
ProfilePictureSource::getFieldsEnum()->getValues(), |
720
|
|
|
new TypeChecker($param_types, $enums) |
721
|
|
|
); |
722
|
|
|
$request->addParams($params); |
723
|
|
|
$request->addFields($fields); |
724
|
|
|
return $pending ? $request : $request->execute(); |
725
|
|
|
} |
726
|
|
|
|
727
|
|
|
public function getProductCatalogs(array $fields = array(), array $params = array(), $pending = false) { |
728
|
|
|
$this->assureId(); |
729
|
|
|
|
730
|
|
|
$param_types = array( |
731
|
|
|
); |
732
|
|
|
$enums = array( |
733
|
|
|
); |
734
|
|
|
|
735
|
|
|
$request = new ApiRequest( |
736
|
|
|
$this->api, |
737
|
|
|
$this->data['id'], |
738
|
|
|
RequestInterface::METHOD_GET, |
739
|
|
|
'/product_catalogs', |
740
|
|
|
new ProductCatalog(), |
741
|
|
|
'EDGE', |
742
|
|
|
ProductCatalog::getFieldsEnum()->getValues(), |
743
|
|
|
new TypeChecker($param_types, $enums) |
744
|
|
|
); |
745
|
|
|
$request->addParams($params); |
746
|
|
|
$request->addFields($fields); |
747
|
|
|
return $pending ? $request : $request->execute(); |
748
|
|
|
} |
749
|
|
|
|
750
|
|
|
public function createProductCatalog(array $fields = array(), array $params = array(), $pending = false) { |
751
|
|
|
$this->assureId(); |
752
|
|
|
|
753
|
|
|
$param_types = array( |
754
|
|
|
'name' => 'string', |
755
|
|
|
'vertical' => 'vertical_enum', |
756
|
|
|
); |
757
|
|
|
$enums = array( |
758
|
|
|
'vertical_enum' => ProductCatalogVerticalValues::getInstance()->getValues(), |
759
|
|
|
); |
760
|
|
|
|
761
|
|
|
$request = new ApiRequest( |
762
|
|
|
$this->api, |
763
|
|
|
$this->data['id'], |
764
|
|
|
RequestInterface::METHOD_POST, |
765
|
|
|
'/product_catalogs', |
766
|
|
|
new ProductCatalog(), |
767
|
|
|
'EDGE', |
768
|
|
|
ProductCatalog::getFieldsEnum()->getValues(), |
769
|
|
|
new TypeChecker($param_types, $enums) |
770
|
|
|
); |
771
|
|
|
$request->addParams($params); |
772
|
|
|
$request->addFields($fields); |
773
|
|
|
return $pending ? $request : $request->execute(); |
774
|
|
|
} |
775
|
|
|
|
776
|
|
|
public function getReceivedAudiencePermissions(array $fields = array(), array $params = array(), $pending = false) { |
777
|
|
|
$this->assureId(); |
778
|
|
|
|
779
|
|
|
$param_types = array( |
780
|
|
|
'partner_id' => 'string', |
781
|
|
|
); |
782
|
|
|
$enums = array( |
783
|
|
|
); |
784
|
|
|
|
785
|
|
|
$request = new ApiRequest( |
786
|
|
|
$this->api, |
787
|
|
|
$this->data['id'], |
788
|
|
|
RequestInterface::METHOD_GET, |
789
|
|
|
'/received_audience_permissions', |
790
|
|
|
new AbstractCrudObject(), |
791
|
|
|
'EDGE', |
792
|
|
|
array(), |
793
|
|
|
new TypeChecker($param_types, $enums) |
794
|
|
|
); |
795
|
|
|
$request->addParams($params); |
796
|
|
|
$request->addFields($fields); |
797
|
|
|
return $pending ? $request : $request->execute(); |
798
|
|
|
} |
799
|
|
|
|
800
|
|
|
public function getSharedAudiencePermissions(array $fields = array(), array $params = array(), $pending = false) { |
801
|
|
|
$this->assureId(); |
802
|
|
|
|
803
|
|
|
$param_types = array( |
804
|
|
|
'partner_id' => 'string', |
805
|
|
|
); |
806
|
|
|
$enums = array( |
807
|
|
|
); |
808
|
|
|
|
809
|
|
|
$request = new ApiRequest( |
810
|
|
|
$this->api, |
811
|
|
|
$this->data['id'], |
812
|
|
|
RequestInterface::METHOD_GET, |
813
|
|
|
'/shared_audience_permissions', |
814
|
|
|
new AbstractCrudObject(), |
815
|
|
|
'EDGE', |
816
|
|
|
array(), |
817
|
|
|
new TypeChecker($param_types, $enums) |
818
|
|
|
); |
819
|
|
|
$request->addParams($params); |
820
|
|
|
$request->addFields($fields); |
821
|
|
|
return $pending ? $request : $request->execute(); |
822
|
|
|
} |
823
|
|
|
|
824
|
|
|
public function getSystemUsers(array $fields = array(), array $params = array(), $pending = false) { |
825
|
|
|
$this->assureId(); |
826
|
|
|
|
827
|
|
|
$param_types = array( |
828
|
|
|
); |
829
|
|
|
$enums = array( |
830
|
|
|
); |
831
|
|
|
|
832
|
|
|
$request = new ApiRequest( |
833
|
|
|
$this->api, |
834
|
|
|
$this->data['id'], |
835
|
|
|
RequestInterface::METHOD_GET, |
836
|
|
|
'/system_users', |
837
|
|
|
new AbstractCrudObject(), |
838
|
|
|
'EDGE', |
839
|
|
|
array(), |
840
|
|
|
new TypeChecker($param_types, $enums) |
841
|
|
|
); |
842
|
|
|
$request->addParams($params); |
843
|
|
|
$request->addFields($fields); |
844
|
|
|
return $pending ? $request : $request->execute(); |
845
|
|
|
} |
846
|
|
|
|
847
|
|
|
public function createUserPermission(array $fields = array(), array $params = array(), $pending = false) { |
848
|
|
|
$this->assureId(); |
849
|
|
|
|
850
|
|
|
$param_types = array( |
851
|
|
|
'email' => 'string', |
852
|
|
|
'role' => 'role_enum', |
853
|
|
|
'user' => 'int', |
854
|
|
|
); |
855
|
|
|
$enums = array( |
856
|
|
|
'role_enum' => array( |
857
|
|
|
'ADMIN', |
858
|
|
|
'EMPLOYEE', |
859
|
|
|
'SYSTEM_USER', |
860
|
|
|
'ADMIN_SYSTEM_USER', |
861
|
|
|
'INSTAGRAM_ADMIN', |
862
|
|
|
'INSTAGRAM_EMPLOYEE', |
863
|
|
|
'FB_EMPLOYEE_ACCOUNT_MANAGER', |
864
|
|
|
'FB_EMPLOYEE_SALES_REP', |
865
|
|
|
), |
866
|
|
|
); |
867
|
|
|
|
868
|
|
|
$request = new ApiRequest( |
869
|
|
|
$this->api, |
870
|
|
|
$this->data['id'], |
871
|
|
|
RequestInterface::METHOD_POST, |
872
|
|
|
'/userpermissions', |
873
|
|
|
new AbstractCrudObject(), |
874
|
|
|
'EDGE', |
875
|
|
|
array(), |
876
|
|
|
new TypeChecker($param_types, $enums) |
877
|
|
|
); |
878
|
|
|
$request->addParams($params); |
879
|
|
|
$request->addFields($fields); |
880
|
|
|
return $pending ? $request : $request->execute(); |
881
|
|
|
} |
882
|
|
|
|
883
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
884
|
|
|
$this->assureId(); |
885
|
|
|
|
886
|
|
|
$param_types = array( |
887
|
|
|
); |
888
|
|
|
$enums = array( |
889
|
|
|
); |
890
|
|
|
|
891
|
|
|
$request = new ApiRequest( |
892
|
|
|
$this->api, |
893
|
|
|
$this->data['id'], |
894
|
|
|
RequestInterface::METHOD_GET, |
895
|
|
|
'/', |
896
|
|
|
new Business(), |
897
|
|
|
'NODE', |
898
|
|
|
Business::getFieldsEnum()->getValues(), |
899
|
|
|
new TypeChecker($param_types, $enums) |
900
|
|
|
); |
901
|
|
|
$request->addParams($params); |
902
|
|
|
$request->addFields($fields); |
903
|
|
|
return $pending ? $request : $request->execute(); |
904
|
|
|
} |
905
|
|
|
|
906
|
|
|
} |
907
|
|
|
|