Skip to content

Commit 649e637

Browse files
committed
feat(Teams): Add quota management to TeamFolder and ITeamFolderProvider
Signed-off-by: Fin Clausen <Fin.Clausen@dataport.de>
1 parent ff26c8b commit 649e637

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

lib/public/Teams/ITeamFolderProvider.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ public function getTeamFolder(string $teamId): ?TeamFolder;
3939
*/
4040
public function createTeamFolder(Team $team, int $quota = 0): TeamFolder;
4141

42+
/**
43+
* Update the storage quota of the team folder.
44+
*
45+
* @param string $teamId The team single id.
46+
* @param int $quota Quota in bytes; zero means unlimited.
47+
* @return TeamFolder The updated folder.
48+
* @since 35.0.0
49+
*/
50+
public function updateTeamFolderQuota(string $teamId, int $quota): TeamFolder;
51+
4252
/**
4353
* Remove the exclusive relationship but retain the folder and its contents.
4454
*

lib/public/Teams/TeamFolder.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class TeamFolder implements \JsonSerializable {
2424
public function __construct(
2525
private int $id,
2626
private string $mountPoint,
27+
private ?int $quota = null,
2728
) {
2829
}
2930

@@ -42,13 +43,24 @@ public function getMountPoint(): string {
4243
}
4344

4445
/**
45-
* @return array{id: int, mountPoint: string}
46+
* The storage quota in bytes, zero for unlimited, or null if the active
47+
* provider does not expose a quota for this folder.
48+
*
49+
* @since 35.0.0
50+
*/
51+
public function getQuota(): ?int {
52+
return $this->quota;
53+
}
54+
55+
/**
56+
* @return array{id: int, mountPoint: string, quota: int|null}
4657
* @since 35.0.0
4758
*/
4859
#[\Override]
4960
public function jsonSerialize(): array {
5061
return [
5162
'id' => $this->id,
63+
'quota' => $this->quota,
5264
'mountPoint' => $this->mountPoint,
5365
];
5466
}

0 commit comments

Comments
 (0)