Team.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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(
  19. private string $teamId,
  20. private string $displayName,
  21. private ?string $link,
  22. ) {
  23. }
  24. /**
  25. * Unique identifier of the team (singleId of the circle)
  26. *
  27. * @since 29.0.0
  28. */
  29. public function getId(): string {
  30. return $this->teamId;
  31. }
  32. /**
  33. * @since 29.0.0
  34. */
  35. public function getDisplayName(): string {
  36. return $this->displayName;
  37. }
  38. /**
  39. * @since 29.0.0
  40. */
  41. public function getLink(): ?string {
  42. return $this->link;
  43. }
  44. /**
  45. * @since 29.0.0
  46. */
  47. public function jsonSerialize(): array {
  48. return [
  49. 'teamId' => $this->teamId,
  50. 'displayName' => $this->displayName,
  51. 'link' => $this->link,
  52. ];
  53. }
  54. }