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\EventSourceGroupFields; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* This class is auto-genereated. |
35
|
|
|
* |
36
|
|
|
* For any issues or feature requests related to this class, please let us know |
37
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
38
|
|
|
* pull request for this class. |
39
|
|
|
* |
40
|
|
|
*/ |
41
|
|
|
|
42
|
|
|
class EventSourceGroup extends AbstractCrudObject { |
43
|
|
|
|
44
|
|
|
protected function getEndpoint() { |
45
|
|
|
return 'event_source_groups'; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return EventSourceGroupFields |
50
|
|
|
*/ |
51
|
|
|
public static function getFieldsEnum() { |
52
|
|
|
return EventSourceGroupFields::getInstance(); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
protected static function getReferencedEnums() { |
56
|
|
|
$ref_enums = array(); |
57
|
|
|
return $ref_enums; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
|
61
|
|
|
public function createSharedAccount(array $fields = array(), array $params = array(), $pending = false) { |
62
|
|
|
$this->assureId(); |
63
|
|
|
|
64
|
|
|
$param_types = array( |
65
|
|
|
'accounts' => 'list<string>', |
66
|
|
|
); |
67
|
|
|
$enums = array( |
68
|
|
|
); |
69
|
|
|
|
70
|
|
|
$request = new ApiRequest( |
71
|
|
|
$this->api, |
72
|
|
|
$this->data['id'], |
73
|
|
|
RequestInterface::METHOD_POST, |
74
|
|
|
'/shared_accounts', |
75
|
|
|
new EventSourceGroup(), |
76
|
|
|
'EDGE', |
77
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
78
|
|
|
new TypeChecker($param_types, $enums) |
79
|
|
|
); |
80
|
|
|
$request->addParams($params); |
81
|
|
|
$request->addFields($fields); |
82
|
|
|
return $pending ? $request : $request->execute(); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
86
|
|
|
$this->assureId(); |
87
|
|
|
|
88
|
|
|
$param_types = array( |
89
|
|
|
); |
90
|
|
|
$enums = array( |
91
|
|
|
); |
92
|
|
|
|
93
|
|
|
$request = new ApiRequest( |
94
|
|
|
$this->api, |
95
|
|
|
$this->data['id'], |
96
|
|
|
RequestInterface::METHOD_GET, |
97
|
|
|
'/', |
98
|
|
|
new EventSourceGroup(), |
99
|
|
|
'NODE', |
100
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
101
|
|
|
new TypeChecker($param_types, $enums) |
102
|
|
|
); |
103
|
|
|
$request->addParams($params); |
104
|
|
|
$request->addFields($fields); |
105
|
|
|
return $pending ? $request : $request->execute(); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) { |
109
|
|
|
$this->assureId(); |
110
|
|
|
|
111
|
|
|
$param_types = array( |
112
|
|
|
'event_sources' => 'list<string>', |
113
|
|
|
'name' => 'string', |
114
|
|
|
); |
115
|
|
|
$enums = array( |
116
|
|
|
); |
117
|
|
|
|
118
|
|
|
$request = new ApiRequest( |
119
|
|
|
$this->api, |
120
|
|
|
$this->data['id'], |
121
|
|
|
RequestInterface::METHOD_POST, |
122
|
|
|
'/', |
123
|
|
|
new EventSourceGroup(), |
124
|
|
|
'NODE', |
125
|
|
|
EventSourceGroup::getFieldsEnum()->getValues(), |
126
|
|
|
new TypeChecker($param_types, $enums) |
127
|
|
|
); |
128
|
|
|
$request->addParams($params); |
129
|
|
|
$request->addFields($fields); |
130
|
|
|
return $pending ? $request : $request->execute(); |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
} |
134
|
|
|
|