UpcomingEvent.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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(private string $uri,
  12. private ?int $recurrenceId,
  13. private string $calendarUri,
  14. private ?int $start,
  15. private ?string $summary,
  16. private ?string $location,
  17. private ?string $calendarAppUrl) {
  18. }
  19. public function getUri(): string {
  20. return $this->uri;
  21. }
  22. public function getRecurrenceId(): ?int {
  23. return $this->recurrenceId;
  24. }
  25. public function getCalendarUri(): string {
  26. return $this->calendarUri;
  27. }
  28. public function getStart(): ?int {
  29. return $this->start;
  30. }
  31. public function getSummary(): ?string {
  32. return $this->summary;
  33. }
  34. public function getLocation(): ?string {
  35. return $this->location;
  36. }
  37. public function getCalendarAppUrl(): ?string {
  38. return $this->calendarAppUrl;
  39. }
  40. /**
  41. * @see ResponseDefinitions
  42. */
  43. public function jsonSerialize(): array {
  44. return [
  45. 'uri' => $this->uri,
  46. 'recurrenceId' => $this->recurrenceId,
  47. 'calendarUri' => $this->calendarUri,
  48. 'start' => $this->start,
  49. 'summary' => $this->summary,
  50. 'location' => $this->location,
  51. 'calendarAppUrl' => $this->calendarAppUrl,
  52. ];
  53. }
  54. }