Completed
Push — master ( 2b6298...de1817 )
by Welling
03:36
created

RequestsInterface

Size/Duplication

Total Lines 410
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 410
ccs 0
cts 0
cp 0
c 0
b 0
f 0

44 Methods

Rating   Name   Duplication   Size   Complexity  
getTables() 0 1 ?
getTable() 0 1 ?
getColumns() 0 1 ?
getColumn() 0 1 ?
getUsers() 0 1 ?
getUser() 0 1 ?
getGroups() 0 1 ?
getGroup() 0 1 ?
getGroupPrivileges() 0 1 ?
getFiles() 0 1 ?
getFile() 0 1 ?
getSettings() 0 1 ?
getSettingsByCollection() 0 1 ?
getItems() 0 1 ?
getItem() 0 1 ?
updateSettings() 0 1 ?
getMessage() 0 1 ?
getMessages() 0 1 ?
createItem() 0 1 ?
updateItem() 0 1 ?
deleteItem() 0 1 ?
createUser() 0 1 ?
updateUser() 0 1 ?
deleteUser() 0 1 ?
createFile() 0 1 ?
updateFile() 0 1 ?
deleteFile() 0 1 ?
createBookmark() 0 1 ?
getBookmark() 0 1 ?
getBookmarks() 0 1 ?
createPreferences() 0 1 ?
createColumn() 0 1 ?
createGroup() 0 1 ?
createMessage() 0 1 ?
sendMessage() 0 1 ?
createPrivileges() 0 1 ?
createTable() 0 1 ?
createColumnUIOptions() 0 1 ?
getPreferences() 0 1 ?
deleteBookmark() 0 1 ?
deleteColumn() 0 1 ?
deleteGroup() 0 1 ?
deleteTable() 0 1 ?
getActivity() 0 1 ?
1
<?php
2
3
/**
4
 * Directus – <http://getdirectus.com>
5
 *
6
 * @link      The canonical repository – <https://github.com/directus/directus>
7
 * @copyright Copyright 2006-2016 RANGER Studio, LLC – <http://rangerstudio.com>
8
 * @license   GNU General Public License (v3) – <http://www.gnu.org/copyleft/gpl.html>
9
 */
10
11
namespace Directus\SDK;
12
13
use Directus\SDK\Response\Entry;
14
use Directus\SDK\Response\EntryCollection;
15
16
/**
17
 * Requests Interface
18
 *
19
 * @author Welling Guzmán <[email protected]>
20
 */
21
interface RequestsInterface
22
{
23
    /**
24
     * Gets list of all tables
25
     *
26
     * @param array $params
27
     *
28
     * @return EntryCollection
29
     */
30
    public function getTables(array $params = []);
31
32
    /**
33
     * Gets the details of the given table
34
     *
35
     * @param $tableName
36
     *
37
     * @return Entry
38
     */
39
    public function getTable($tableName);
40
41
    /**
42
     * Gets columns of a given table
43
     *
44
     * @param $tableName
45
     * @param $params
46
     *
47
     * @return EntryCollection
48
     */
49
    public function getColumns($tableName, array $params = []);
50
51
    /**
52
     * Gets the details of a given table's column
53
     *
54
     * @param $tableName
55
     * @param $columnName
56
     *
57
     * @return Entry
58
     */
59
    public function getColumn($tableName, $columnName);
60
61
    /**
62
     * Fetch Items from a given table
63
     *
64
     * @param string $tableName
65
     * @param array $options
66
     *
67
     * @return EntryCollection
68
     */
69
    public function getItems($tableName, array $options = []);
70
71
    /**
72
     * Get an entry in a given table by the given ID
73
     *
74
     * @param mixed $id
75
     * @param string $tableName
76
     * @param array $options
77
     *
78
     * @return Entry
79
     */
80
    public function getItem($tableName, $id, array $options = []);
81
82
    /**
83
     * Gets the list of users
84
     *
85
     * @param array $params
86
     *
87
     * @return EntryCollection
88
     */
89
    public function getUsers(array $params = []);
90
91
    /**
92
     * Gets a user by the given id
93
     *
94
     * @param $id
95
     * @param array $params
96
     *
97
     * @return Entry
98
     */
99
    public function getUser($id, array $params = []);
100
101
    /**
102
     * Gets a list of User groups
103
     *
104
     * @return EntryCollection
105
     */
106
    public function getGroups();
107
108
    /**
109
     * Gets the information of a given user group
110
     *
111
     * @param $groupID
112
     *
113
     * @return Entry
114
     */
115
    public function getGroup($groupID);
116
117
    /**
118
     * Get a given group privileges
119
     *
120
     * @param $groupID
121
     *
122
     * @return EntryCollection
123
     */
124
    public function getGroupPrivileges($groupID);
125
126
    /**
127
     * Gets a list fo files
128
     *
129
     * @return EntryCollection
130
     */
131
    public function getFiles();
132
133
    /**
134
     * Gets the information of a given file ID
135
     *
136
     * @param $fileID
137
     *
138
     * @return Entry
139
     */
140
    public function getFile($fileID);
141
142
    /**
143
     * Gets all settings
144
     *
145
     * @return object
146
     */
147
    public function getSettings();
148
149
    /**
150
     * Gets all settings in a given collection name
151
     *
152
     * @param $collectionName
153
     *
154
     * @return EntryCollection
155
     */
156
    public function getSettingsByCollection($collectionName);
157
158
    /**
159
     * Updates settings in the given collection
160
     *
161
     * @param $collection
162
     * @param $data
163
     *
164
     * @return Entry
165
     */
166
    public function updateSettings($collection, array $data);
167
168
    /**
169
     * Gets messages with the given ID
170
     *
171
     * @param $id
172
     *
173
     * @return Entry
174
     */
175
    public function getMessage($id);
176
177
    /**
178
     * Gets all messages from the given user ID
179
     *
180
     * @param $userId
181
     *
182
     * @return EntryCollection
183
     */
184
    public function getMessages($userId = null);
185
186
    /**
187
     * Create a new item in the given table name
188
     *
189
     * @param $tableName
190
     * @param array $data
191
     *
192
     * @return Entry
193
     */
194
    public function createItem($tableName, array $data);
195
196
    /**
197
     * Update the item of the given table and id
198
     *
199
     * @param $tableName
200
     * @param $id
201
     * @param array $data
202
     *
203
     * @return mixed
204
     */
205
    public function updateItem($tableName, $id, array $data);
206
207
    /**
208
     * Deletes the given item id(s)
209
     *
210
     * @param $tableName
211
     * @param string|array|Entry|EntryCollection $ids
212
     *
213
     * @return int
214
     */
215
    public function deleteItem($tableName, $ids);
216
217
    /**
218
     * Creates a new user
219
     *
220
     * @param array $data
221
     *
222
     * @return Entry
223
     */
224
    public function createUser(array $data);
225
226
    /**
227
     * Updates the given user id
228
     *
229
     * @param $id
230
     * @param array $data
231
     *
232
     * @return mixed
233
     */
234
    public function updateUser($id, array $data);
235
236
    /**
237
     * Deletes the given user id(s)
238
     *
239
     * @param string|array|Entry|EntryCollection $ids
240
     *
241
     * @return int
242
     */
243
    public function deleteUser($ids);
244
245
    /**
246
     * Creates a new file
247
     *
248
     * @param File $file
249
     *
250
     * @return Entry
251
     */
252
    public function createFile(File $file);
253
254
    /**
255
     * Updates the given file id
256
     *
257
     * @param $id
258
     * @param array|File $data
259
     *
260
     * @return mixed
261
     */
262
    public function updateFile($id, $data);
263
264
    /**
265
     * Deletes the given file id(s)
266
     *
267
     * @param string|array|Entry|EntryCollection $ids
268
     *
269
     * @return int
270
     */
271
    public function deleteFile($ids);
272
273
    /**
274
     * Creates a new Bookmark
275
     *
276
     * @param $data
277
     *
278
     * @return Entry
279
     */
280
    public function createBookmark($data);
281
282
    /**
283
     * Gets a Bookmark with the given id
284
     *
285
     * @param int $id
286
     *
287
     * @return Entry
288
     */
289
    public function getBookmark($id);
290
291
    /**
292
     * Gets a Bookmarks
293
     *
294
     * @param int $userId
295
     *
296
     * @return Entry
297
     */
298
    public function getBookmarks($userId = null);
299
300
    /**
301
     * Creates a new Table preferences
302
     *
303
     * @param $data
304
     *
305
     * @return Entry
306
     */
307
    public function createPreferences($data);
308
309
    /**
310
     * Creates a new Column
311
     *
312
     * @param $data
313
     *
314
     * @return Entry
315
     */
316
    public function createColumn($data);
317
318
    /**
319
     * Creates a new group
320
     *
321
     * @param $data
322
     *
323
     * @return Entry
324
     */
325
    public function createGroup(array $data);
326
327
    /**
328
     * Creates new message
329
     *
330
     * @param array $data
331
     *
332
     * @return Entry
333
     */
334
    public function createMessage(array $data);
335
336
    /**
337
     * Sends a new message
338
     *
339
     * Alias of createMessage
340
     *
341
     * @param array $data
342
     *
343
     * @return Entry
344
     */
345
    public function sendMessage(array $data);
346
347
    /**
348
     * Creates a new privileges/permissions
349
     *
350
     * @param array $data
351
     *
352
     * @return Entry
353
     */
354
    public function createPrivileges(array $data);
355
356
    /**
357
     * Creates
358
     *
359
     * @param $name
360
     * @param array $data
361
     *
362
     * @return Entry
363
     */
364
    public function createTable($name, array $data = []);
365
366
    /**
367
     * Creates/Updates column ui options
368
     *
369
     * @param array $data
370
     *
371
     * @return Entry
372
     */
373
    public function createColumnUIOptions(array $data);
374
375
    /**
376
     * Gets preferences
377
     *
378
     * @param $table
379
     * @param $user
380
     *
381
     * @return Entry
382
     */
383
    public function getPreferences($table, $user);
384
385
    /**
386
     * Deletes a bookmark
387
     *
388
     * @param $id
389
     *
390
     * @return Entry
391
     */
392
    public function deleteBookmark($id);
393
394
    /**
395
     * Deletes a column
396
     *
397
     * @param $name
398
     * @param $table
399
     *
400
     * @return Entry
401
     */
402
    public function deleteColumn($name, $table);
403
404
    /**
405
     * Deletes a group
406
     *
407
     * @param $id
408
     *
409
     * @return Entry
410
     */
411
    public function deleteGroup($id);
412
413
    /**
414
     * Deletes a table
415
     *
416
     * @param $name
417
     *
418
     * @return Entry
419
     */
420
    public function deleteTable($name);
421
422
    /**
423
     * Gets activity records
424
     *
425
     * @param array $params
426
     *
427
     * @return Entry
428
     */
429
    public function getActivity(array $params = []);
430
}
431