123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- namespace OCP\Teams;
- class TeamResource implements \JsonSerializable {
-
- public function __construct(
- private ITeamResourceProvider $teamResourceProvider,
- private string $resourceId,
- private string $label,
- private string $url,
- private ?string $iconSvg = null,
- private ?string $iconURL = null,
- private ?string $iconEmoji = null,
- ) {
- }
-
- public function getProvider(): ITeamResourceProvider {
- return $this->teamResourceProvider;
- }
-
- public function getId(): string {
- return $this->resourceId;
- }
-
- public function getLabel(): string {
- return $this->label;
- }
-
- public function getUrl(): string {
- return $this->url;
- }
-
- public function getIconSvg(): ?string {
- return $this->iconSvg;
- }
-
- public function getIconURL(): ?string {
- return $this->iconURL;
- }
-
- public function getIconEmoji(): ?string {
- return $this->iconEmoji;
- }
-
- public function jsonSerialize(): array {
- return [
- 'id' => $this->resourceId,
- 'label' => $this->label,
- 'url' => $this->url,
- 'iconSvg' => $this->iconSvg,
- 'iconURL' => $this->iconURL,
- 'iconEmoji' => $this->iconEmoji,
- 'provider' => [
- 'id' => $this->teamResourceProvider->getId(),
- 'name' => $this->teamResourceProvider->getName(),
- 'icon' => $this->teamResourceProvider->getIconSvg(),
- ]
- ];
- }
- }
|