@@ -123,16 +123,16 @@ public function __construct(string $appName,
123
123
*
124
124
* create a new share
125
125
*
126
- * @param string|null $remote
127
- * @param string|null $token
128
- * @param string|null $name
129
- * @param string|null $owner
130
- * @param string|null $sharedBy
131
- * @param string|null $shareWith
132
- * @param int|null $remoteId
133
- * @param string|null $sharedByFederatedId
134
- * @param string|null $ownerFederatedId
135
- * @return Http\DataResponse
126
+ * @param string|null $remote Address of the remote
127
+ * @param string|null $token Shared secret between servers
128
+ * @param string|null $name Name of the shared resource
129
+ * @param string|null $owner Display name of the receiver
130
+ * @param string|null $sharedBy Display name of the sender
131
+ * @param string|null $shareWith ID of the user that receives the share
132
+ * @param int|null $remoteId ID of the remote
133
+ * @param string|null $sharedByFederatedId Federated ID of the sender
134
+ * @param string|null $ownerFederatedId Federated ID of the receiver
135
+ * @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
136
136
* @throws OCSException
137
137
*/
138
138
public function createShare (
@@ -194,19 +194,19 @@ public function createShare(
194
194
*
195
195
* create re-share on behalf of another user
196
196
*
197
- * @param int $id
198
- * @param string|null $token
199
- * @param string|null $shareWith
200
- * @param int|null $permission
201
- * @param int|null $remoteId
202
- * @return Http\DataResponse
203
- * @throws OCSBadRequestException
197
+ * @param int $id ID of the share
198
+ * @param string|null $token Shared secret between servers
199
+ * @param string|null $shareWith ID of the user that receives the share
200
+ * @param int|null $remoteId ID of the remote
201
+ * @return Http\DataResponse<Http::STATUS_OK, array{token: string, remoteId: string}, array{}>
202
+ * @throws OCSBadRequestException Re-sharing is not possible
204
203
* @throws OCSException
204
+ *
205
+ * 200: Remote share returned
205
206
*/
206
- public function reShare (int $ id , ?string $ token = null , ?string $ shareWith = null , ?int $ permission = 0 , ? int $ remoteId = 0 ) {
207
+ public function reShare (int $ id , ?string $ token = null , ?string $ shareWith = null , ?int $ remoteId = 0 ) {
207
208
if ($ token === null ||
208
209
$ shareWith === null ||
209
- $ permission === null ||
210
210
$ remoteId === null
211
211
) {
212
212
throw new OCSBadRequestException ();
@@ -244,12 +244,14 @@ public function reShare(int $id, ?string $token = null, ?string $shareWith = nul
244
244
*
245
245
* accept server-to-server share
246
246
*
247
- * @param int $id
248
- * @param string|null $token
249
- * @return Http\DataResponse
247
+ * @param int $id ID of the remote share
248
+ * @param string|null $token Shared secret between servers
249
+ * @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
250
250
* @throws OCSException
251
251
* @throws ShareNotFound
252
252
* @throws \OCP\HintException
253
+ *
254
+ * 200: Share accepted successfully
253
255
*/
254
256
public function acceptShare (int $ id , ?string $ token = null ) {
255
257
$ notification = [
@@ -278,9 +280,9 @@ public function acceptShare(int $id, ?string $token = null) {
278
280
*
279
281
* decline server-to-server share
280
282
*
281
- * @param int $id
282
- * @param string|null $token
283
- * @return Http\DataResponse
283
+ * @param int $id ID of the remote share
284
+ * @param string|null $token Shared secret between servers
285
+ * @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
284
286
* @throws OCSException
285
287
*/
286
288
public function declineShare (int $ id , ?string $ token = null ) {
@@ -310,9 +312,9 @@ public function declineShare(int $id, ?string $token = null) {
310
312
*
311
313
* remove server-to-server share if it was unshared by the owner
312
314
*
313
- * @param int $id
314
- * @param string|null $token
315
- * @return Http\DataResponse
315
+ * @param int $id ID of the share
316
+ * @param string|null $token Shared secret between servers
317
+ * @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
316
318
* @throws OCSException
317
319
*/
318
320
public function unshare (int $ id , ?string $ token = null ) {
@@ -345,10 +347,12 @@ private function cleanupRemote($remote) {
345
347
*
346
348
* federated share was revoked, either by the owner or the re-sharer
347
349
*
348
- * @param int $id
349
- * @param string|null $token
350
- * @return Http\DataResponse
351
- * @throws OCSBadRequestException
350
+ * @param int $id ID of the share
351
+ * @param string|null $token Shared secret between servers
352
+ * @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
353
+ * @throws OCSBadRequestException Revoking the share is not possible
354
+ *
355
+ * 200: Share revoked successfully
352
356
*/
353
357
public function revoke (int $ id , ?string $ token = null ) {
354
358
try {
@@ -385,11 +389,13 @@ private function isS2SEnabled($incoming = false) {
385
389
*
386
390
* update share information to keep federated re-shares in sync
387
391
*
388
- * @param int $id
389
- * @param string|null $token
390
- * @param int|null $permissions
391
- * @return Http\DataResponse
392
- * @throws OCSBadRequestException
392
+ * @param int $id ID of the share
393
+ * @param string|null $token Shared secret between servers
394
+ * @param int|null $permissions New permissions
395
+ * @return Http\DataResponse<Http::STATUS_OK, array<empty>, array{}>
396
+ * @throws OCSBadRequestException Updating permissions is not possible
397
+ *
398
+ * 200: Permissions updated successfully
393
399
*/
394
400
public function updatePermissions (int $ id , ?string $ token = null , ?int $ permissions = null ) {
395
401
$ ncPermissions = $ permissions ;
@@ -439,14 +445,14 @@ protected function ncPermissions2ocmPermissions($ncPermissions) {
439
445
*
440
446
* change the owner of a server-to-server share
441
447
*
442
- * @param int $id
443
- * @param string|null $token
444
- * @param string|null $remote
445
- * @param string|null $remote_id
446
- * @return Http\DataResponse
447
- * @throws OCSBadRequestException
448
- * @throws OCSException
449
- * @throws \OCP\DB\Exception
448
+ * @param int $id ID of the share
449
+ * @param string|null $token Shared secret between servers
450
+ * @param string|null $remote Address of the remote
451
+ * @param string|null $remote_id ID of the remote
452
+ * @return Http\DataResponse<Http::STATUS_OK, array{remote: string, owner: string}, array{}>
453
+ * @throws OCSBadRequestException Moving share is not possible
454
+ *
455
+ * 200: Share moved successfully
450
456
*/
451
457
public function move (int $ id , ?string $ token = null , ?string $ remote = null , ?string $ remote_id = null ) {
452
458
if (!$ this ->isS2SEnabled ()) {
0 commit comments