1 | <?php |
||
6 | class Bucket extends Base |
||
7 | { |
||
8 | /** |
||
9 | * Private constructor so only the client can create this |
||
10 | * @param Client $client |
||
11 | */ |
||
12 | 20 | public function __construct(Client $client) |
|
17 | |||
18 | /** |
||
19 | * Get one or multiple buckets |
||
20 | * @param string bucket id, leave null for list of buckets |
||
21 | * @param object Containing query arguments |
||
22 | * @return object Result of the request |
||
23 | */ |
||
24 | public function Get($bucketId = null, $args = array("limit" => 50)) |
||
31 | |||
32 | /** |
||
33 | * Get one or multiple buckets |
||
34 | * @param string bucket id |
||
35 | * @param string object id, leave null for list of objects |
||
36 | * @param object Containing query arguments |
||
37 | * @return object Result of the request |
||
38 | */ |
||
39 | public function GetObject($bucketId, $objectId, $args = array("limit" => 50)) |
||
46 | |||
47 | /** |
||
48 | * Create new bucket |
||
49 | * @param object Containing all the information of a bucket |
||
50 | * @return object Result of the request |
||
51 | */ |
||
52 | public function Create($bucket) |
||
56 | |||
57 | /** |
||
58 | * Create new bucket |
||
59 | * @param string bucket id |
||
60 | * @param object Containing all the information of a bucket |
||
61 | * @return object Result of the request |
||
62 | */ |
||
63 | public function CreateObject($bucketId, $object) |
||
67 | |||
68 | /** |
||
69 | * Delete a bucket object by bucket id |
||
70 | * @param string Id of the bucket |
||
71 | * @return object Result of the request |
||
72 | */ |
||
73 | public function Delete($bucketId) |
||
77 | |||
78 | /** |
||
79 | * List fields of a bucket |
||
80 | * @param string Id of the bucket |
||
81 | * @return object Result of the request |
||
82 | */ |
||
83 | public function Fields($bucketId) |
||
87 | |||
88 | /** |
||
89 | * Updates a maximum of 50 object at a time |
||
90 | * @param array Containing objects with a maximum of 50 |
||
91 | * @throws \Exception When more that 50 objects are provided |
||
92 | * @return object Result of the request |
||
93 | */ |
||
94 | public function Bulk($bucketId, $items) |
||
101 | } |
||
102 |