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\AdLabelFields; |
32
|
|
|
use FacebookAds\Object\Values\AdLabelExecutionOptionsValues; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* This class is auto-genereated. |
36
|
|
|
* |
37
|
|
|
* For any issues or feature requests related to this class, please let us know |
38
|
|
|
* on github and we'll fix in our codegen framework. We'll not be able to accept |
39
|
|
|
* pull request for this class. |
40
|
|
|
* |
41
|
|
|
*/ |
42
|
|
|
|
43
|
|
|
class AdLabel extends AbstractCrudObject { |
44
|
|
|
|
45
|
|
|
protected function getEndpoint() { |
46
|
|
|
return 'adlabels'; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @return AdLabelFields |
51
|
|
|
*/ |
52
|
|
|
public static function getFieldsEnum() { |
53
|
|
|
return AdLabelFields::getInstance(); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
protected static function getReferencedEnums() { |
57
|
|
|
$ref_enums = array(); |
58
|
|
|
$ref_enums['ExecutionOptions'] = AdLabelExecutionOptionsValues::getInstance()->getValues(); |
59
|
|
|
return $ref_enums; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
|
63
|
|
|
public function getAdCreatives(array $fields = array(), array $params = array(), $pending = false) { |
64
|
|
|
$this->assureId(); |
65
|
|
|
|
66
|
|
|
$param_types = array( |
67
|
|
|
); |
68
|
|
|
$enums = array( |
69
|
|
|
); |
70
|
|
|
|
71
|
|
|
$request = new ApiRequest( |
72
|
|
|
$this->api, |
73
|
|
|
$this->data['id'], |
74
|
|
|
RequestInterface::METHOD_GET, |
75
|
|
|
'/adcreatives', |
76
|
|
|
new AdCreative(), |
77
|
|
|
'EDGE', |
78
|
|
|
AdCreative::getFieldsEnum()->getValues(), |
79
|
|
|
new TypeChecker($param_types, $enums) |
80
|
|
|
); |
81
|
|
|
$request->addParams($params); |
82
|
|
|
$request->addFields($fields); |
83
|
|
|
return $pending ? $request : $request->execute(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
public function getAds(array $fields = array(), array $params = array(), $pending = false) { |
87
|
|
|
$this->assureId(); |
88
|
|
|
|
89
|
|
|
$param_types = array( |
90
|
|
|
); |
91
|
|
|
$enums = array( |
92
|
|
|
); |
93
|
|
|
|
94
|
|
|
$request = new ApiRequest( |
95
|
|
|
$this->api, |
96
|
|
|
$this->data['id'], |
97
|
|
|
RequestInterface::METHOD_GET, |
98
|
|
|
'/ads', |
99
|
|
|
new Ad(), |
100
|
|
|
'EDGE', |
101
|
|
|
Ad::getFieldsEnum()->getValues(), |
102
|
|
|
new TypeChecker($param_types, $enums) |
103
|
|
|
); |
104
|
|
|
$request->addParams($params); |
105
|
|
|
$request->addFields($fields); |
106
|
|
|
return $pending ? $request : $request->execute(); |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
public function getAdSets(array $fields = array(), array $params = array(), $pending = false) { |
110
|
|
|
$this->assureId(); |
111
|
|
|
|
112
|
|
|
$param_types = array( |
113
|
|
|
); |
114
|
|
|
$enums = array( |
115
|
|
|
); |
116
|
|
|
|
117
|
|
|
$request = new ApiRequest( |
118
|
|
|
$this->api, |
119
|
|
|
$this->data['id'], |
120
|
|
|
RequestInterface::METHOD_GET, |
121
|
|
|
'/adsets', |
122
|
|
|
new AdSet(), |
123
|
|
|
'EDGE', |
124
|
|
|
AdSet::getFieldsEnum()->getValues(), |
125
|
|
|
new TypeChecker($param_types, $enums) |
126
|
|
|
); |
127
|
|
|
$request->addParams($params); |
128
|
|
|
$request->addFields($fields); |
129
|
|
|
return $pending ? $request : $request->execute(); |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
public function getCampaigns(array $fields = array(), array $params = array(), $pending = false) { |
133
|
|
|
$this->assureId(); |
134
|
|
|
|
135
|
|
|
$param_types = array( |
136
|
|
|
); |
137
|
|
|
$enums = array( |
138
|
|
|
); |
139
|
|
|
|
140
|
|
|
$request = new ApiRequest( |
141
|
|
|
$this->api, |
142
|
|
|
$this->data['id'], |
143
|
|
|
RequestInterface::METHOD_GET, |
144
|
|
|
'/campaigns', |
145
|
|
|
new Campaign(), |
146
|
|
|
'EDGE', |
147
|
|
|
Campaign::getFieldsEnum()->getValues(), |
148
|
|
|
new TypeChecker($param_types, $enums) |
149
|
|
|
); |
150
|
|
|
$request->addParams($params); |
151
|
|
|
$request->addFields($fields); |
152
|
|
|
return $pending ? $request : $request->execute(); |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) { |
156
|
|
|
$this->assureId(); |
157
|
|
|
|
158
|
|
|
$param_types = array( |
159
|
|
|
); |
160
|
|
|
$enums = array( |
161
|
|
|
); |
162
|
|
|
|
163
|
|
|
$request = new ApiRequest( |
164
|
|
|
$this->api, |
165
|
|
|
$this->data['id'], |
166
|
|
|
RequestInterface::METHOD_DELETE, |
167
|
|
|
'/', |
168
|
|
|
new AbstractCrudObject(), |
169
|
|
|
'NODE', |
170
|
|
|
array(), |
171
|
|
|
new TypeChecker($param_types, $enums) |
172
|
|
|
); |
173
|
|
|
$request->addParams($params); |
174
|
|
|
$request->addFields($fields); |
175
|
|
|
return $pending ? $request : $request->execute(); |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
public function getSelf(array $fields = array(), array $params = array(), $pending = false) { |
179
|
|
|
$this->assureId(); |
180
|
|
|
|
181
|
|
|
$param_types = array( |
182
|
|
|
); |
183
|
|
|
$enums = array( |
184
|
|
|
); |
185
|
|
|
|
186
|
|
|
$request = new ApiRequest( |
187
|
|
|
$this->api, |
188
|
|
|
$this->data['id'], |
189
|
|
|
RequestInterface::METHOD_GET, |
190
|
|
|
'/', |
191
|
|
|
new AdLabel(), |
192
|
|
|
'NODE', |
193
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
194
|
|
|
new TypeChecker($param_types, $enums) |
195
|
|
|
); |
196
|
|
|
$request->addParams($params); |
197
|
|
|
$request->addFields($fields); |
198
|
|
|
return $pending ? $request : $request->execute(); |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) { |
202
|
|
|
$this->assureId(); |
203
|
|
|
|
204
|
|
|
$param_types = array( |
205
|
|
|
'name' => 'string', |
206
|
|
|
); |
207
|
|
|
$enums = array( |
208
|
|
|
); |
209
|
|
|
|
210
|
|
|
$request = new ApiRequest( |
211
|
|
|
$this->api, |
212
|
|
|
$this->data['id'], |
213
|
|
|
RequestInterface::METHOD_POST, |
214
|
|
|
'/', |
215
|
|
|
new AdLabel(), |
216
|
|
|
'NODE', |
217
|
|
|
AdLabel::getFieldsEnum()->getValues(), |
218
|
|
|
new TypeChecker($param_types, $enums) |
219
|
|
|
); |
220
|
|
|
$request->addParams($params); |
221
|
|
|
$request->addFields($fields); |
222
|
|
|
return $pending ? $request : $request->execute(); |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
} |
226
|
|
|
|