Team.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\Teams;
  7. /**
  8. * Simple abstraction to represent a team in the public API
  9. *
  10. * In the backend a team is a circle identified by the circles singleId
  11. *
  12. * @since 29.0.0
  13. */
  14. class Team implements \JsonSerializable {
  15. /**
  16. * @since 29.0.0
  17. */
  18. public function __construct(private string $teamId, private string $displayName, private ?string $link) {
  19. }
  20. /**
  21. * Unique identifier of the team (singleId of the circle)
  22. *
  23. * @since 29.0.0
  24. */
  25. public function getId(): string {
  26. return $this->teamId;
  27. }
  28. /**
  29. * @since 29.0.0
  30. */
  31. public function getDisplayName(): string {
  32. return $this->displayName;
  33. }
  34. /**
  35. * @since 29.0.0
  36. */
  37. public function getLink(): ?string {
  38. return $this->link;
  39. }
  40. /**
  41. * @since 29.0.0
  42. */
  43. public function jsonSerialize(): array {
  44. return [
  45. 'teamId' => $this->teamId,
  46. 'displayName' => $this->displayName,
  47. 'link' => $this->link,
  48. ];
  49. }
  50. }