UpcomingEvent.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\CalDAV;
  8. use JsonSerializable;
  9. use OCA\DAV\ResponseDefinitions;
  10. class UpcomingEvent implements JsonSerializable {
  11. public function __construct(
  12. private string $uri,
  13. private ?int $recurrenceId,
  14. private string $calendarUri,
  15. private ?int $start,
  16. private ?string $summary,
  17. private ?string $location,
  18. private ?string $calendarAppUrl,
  19. ) {
  20. }
  21. public function getUri(): string {
  22. return $this->uri;
  23. }
  24. public function getRecurrenceId(): ?int {
  25. return $this->recurrenceId;
  26. }
  27. public function getCalendarUri(): string {
  28. return $this->calendarUri;
  29. }
  30. public function getStart(): ?int {
  31. return $this->start;
  32. }
  33. public function getSummary(): ?string {
  34. return $this->summary;
  35. }
  36. public function getLocation(): ?string {
  37. return $this->location;
  38. }
  39. public function getCalendarAppUrl(): ?string {
  40. return $this->calendarAppUrl;
  41. }
  42. /**
  43. * @see ResponseDefinitions
  44. */
  45. public function jsonSerialize(): array {
  46. return [
  47. 'uri' => $this->uri,
  48. 'recurrenceId' => $this->recurrenceId,
  49. 'calendarUri' => $this->calendarUri,
  50. 'start' => $this->start,
  51. 'summary' => $this->summary,
  52. 'location' => $this->location,
  53. 'calendarAppUrl' => $this->calendarAppUrl,
  54. ];
  55. }
  56. }