Completed
Push — master ( 212bcc...86d4f9 )
by
unknown
15:01
created

User   B

Complexity

Total Complexity 20

Size/Duplication

Total Lines 238
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 17

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 20
c 3
b 0
f 0
lcom 1
cbo 17
dl 0
loc 238
rs 7.8571

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getFieldsEnum() 0 3 1
A getReferencedEnums() 0 4 1
B getAccounts() 0 26 2
A getAdAccountGroups() 0 22 2
B createAdAccountGroup() 0 26 2
A getAdAccounts() 0 22 2
A getLeadGenForms() 0 23 2
B getPicture() 0 27 2
A getPromotableDomains() 0 22 2
A getPromotableEvents() 0 23 2
A getSelf() 0 22 2
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\UserFields;
32
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
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 User extends AbstractCrudObject {
44
45
  /**
46
   * @return UserFields
47
   */
48
  public static function getFieldsEnum() {
49
    return UserFields::getInstance();
50
  }
51
52
  protected static function getReferencedEnums() {
53
    $ref_enums = array();
54
    return $ref_enums;
55
  }
56
57
58
  public function getAccounts(array $fields = array(), array $params = array(), $pending = false) {
59
    $this->assureId();
60
61
    $param_types = array(
62
      'business_id' => 'string',
63
      'is_business' => 'bool',
64
      'is_place' => 'bool',
65
      'is_promotable' => 'bool',
66
    );
67
    $enums = array(
68
    );
69
70
    $request = new ApiRequest(
71
      $this->api,
72
      $this->data['id'],
73
      RequestInterface::METHOD_GET,
74
      '/accounts',
75
      new AbstractCrudObject(),
76
      'EDGE',
77
      array(),
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 getAdAccountGroups(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
      '/adaccountgroups',
98
      new AdAccountGroup(),
99
      'EDGE',
100
      AdAccountGroup::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 createAdAccountGroup(array $fields = array(), array $params = array(), $pending = false) {
109
    $this->assureId();
110
111
    $param_types = array(
112
      'accounts' => 'map',
113
      'name' => 'string',
114
      'redownload' => 'bool',
115
      'users' => 'map',
116
    );
117
    $enums = array(
118
    );
119
120
    $request = new ApiRequest(
121
      $this->api,
122
      $this->data['id'],
123
      RequestInterface::METHOD_POST,
124
      '/adaccountgroups',
125
      new AdAccountGroup(),
126
      'EDGE',
127
      AdAccountGroup::getFieldsEnum()->getValues(),
128
      new TypeChecker($param_types, $enums)
129
    );
130
    $request->addParams($params);
131
    $request->addFields($fields);
132
    return $pending ? $request : $request->execute();
133
  }
134
135
  public function getAdAccounts(array $fields = array(), array $params = array(), $pending = false) {
136
    $this->assureId();
137
138
    $param_types = array(
139
    );
140
    $enums = array(
141
    );
142
143
    $request = new ApiRequest(
144
      $this->api,
145
      $this->data['id'],
146
      RequestInterface::METHOD_GET,
147
      '/adaccounts',
148
      new AdAccount(),
149
      'EDGE',
150
      AdAccount::getFieldsEnum()->getValues(),
151
      new TypeChecker($param_types, $enums)
152
    );
153
    $request->addParams($params);
154
    $request->addFields($fields);
155
    return $pending ? $request : $request->execute();
156
  }
157
158
  public function getLeadGenForms(array $fields = array(), array $params = array(), $pending = false) {
159
    $this->assureId();
160
161
    $param_types = array(
162
      'query' => 'string',
163
    );
164
    $enums = array(
165
    );
166
167
    $request = new ApiRequest(
168
      $this->api,
169
      $this->data['id'],
170
      RequestInterface::METHOD_GET,
171
      '/leadgen_forms',
172
      new LeadgenForm(),
173
      'EDGE',
174
      LeadgenForm::getFieldsEnum()->getValues(),
175
      new TypeChecker($param_types, $enums)
176
    );
177
    $request->addParams($params);
178
    $request->addFields($fields);
179
    return $pending ? $request : $request->execute();
180
  }
181
182
  public function getPicture(array $fields = array(), array $params = array(), $pending = false) {
183
    $this->assureId();
184
185
    $param_types = array(
186
      'height' => 'int',
187
      'redirect' => 'bool',
188
      'type' => 'type_enum',
189
      'width' => 'int',
190
    );
191
    $enums = array(
192
      'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
193
    );
194
195
    $request = new ApiRequest(
196
      $this->api,
197
      $this->data['id'],
198
      RequestInterface::METHOD_GET,
199
      '/picture',
200
      new ProfilePictureSource(),
201
      'EDGE',
202
      ProfilePictureSource::getFieldsEnum()->getValues(),
203
      new TypeChecker($param_types, $enums)
204
    );
205
    $request->addParams($params);
206
    $request->addFields($fields);
207
    return $pending ? $request : $request->execute();
208
  }
209
210
  public function getPromotableDomains(array $fields = array(), array $params = array(), $pending = false) {
211
    $this->assureId();
212
213
    $param_types = array(
214
    );
215
    $enums = array(
216
    );
217
218
    $request = new ApiRequest(
219
      $this->api,
220
      $this->data['id'],
221
      RequestInterface::METHOD_GET,
222
      '/promotable_domains',
223
      new Domain(),
224
      'EDGE',
225
      Domain::getFieldsEnum()->getValues(),
226
      new TypeChecker($param_types, $enums)
227
    );
228
    $request->addParams($params);
229
    $request->addFields($fields);
230
    return $pending ? $request : $request->execute();
231
  }
232
233
  public function getPromotableEvents(array $fields = array(), array $params = array(), $pending = false) {
234
    $this->assureId();
235
236
    $param_types = array(
237
      'is_page_event' => 'bool',
238
    );
239
    $enums = array(
240
    );
241
242
    $request = new ApiRequest(
243
      $this->api,
244
      $this->data['id'],
245
      RequestInterface::METHOD_GET,
246
      '/promotable_events',
247
      new Event(),
248
      'EDGE',
249
      Event::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 getSelf(array $fields = array(), array $params = array(), $pending = false) {
258
    $this->assureId();
259
260
    $param_types = array(
261
    );
262
    $enums = array(
263
    );
264
265
    $request = new ApiRequest(
266
      $this->api,
267
      $this->data['id'],
268
      RequestInterface::METHOD_GET,
269
      '/',
270
      new User(),
271
      'NODE',
272
      User::getFieldsEnum()->getValues(),
273
      new TypeChecker($param_types, $enums)
274
    );
275
    $request->addParams($params);
276
    $request->addFields($fields);
277
    return $pending ? $request : $request->execute();
278
  }
279
280
}
281