1
0

CalendarShareUpdatedEvent.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\Events;
  8. use OCP\EventDispatcher\Event;
  9. use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp;
  10. use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet;
  11. /**
  12. * Class CalendarShareUpdatedEvent
  13. *
  14. * @package OCA\DAV\Events
  15. * @since 20.0.0
  16. */
  17. class CalendarShareUpdatedEvent extends Event {
  18. /**
  19. * CalendarShareUpdatedEvent constructor.
  20. *
  21. * @param int $calendarId
  22. * @param array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string } $calendarData
  23. * @param list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}> $oldShares
  24. * @param list<array{href: string, commonName: string, readOnly: bool}> $added
  25. * @param list<string> $removed
  26. * @since 20.0.0
  27. */
  28. public function __construct(
  29. private int $calendarId,
  30. private array $calendarData,
  31. private array $oldShares,
  32. private array $added,
  33. private array $removed,
  34. ) {
  35. parent::__construct();
  36. }
  37. /**
  38. * @since 20.0.0
  39. */
  40. public function getCalendarId(): int {
  41. return $this->calendarId;
  42. }
  43. /**
  44. * @return array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string }
  45. * @since 20.0.0
  46. */
  47. public function getCalendarData(): array {
  48. return $this->calendarData;
  49. }
  50. /**
  51. * @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
  52. * @since 20.0.0
  53. */
  54. public function getOldShares(): array {
  55. return $this->oldShares;
  56. }
  57. /**
  58. * @return list<array{href: string, commonName: string, readOnly: bool}>
  59. * @since 20.0.0
  60. */
  61. public function getAdded(): array {
  62. return $this->added;
  63. }
  64. /**
  65. * @return list<string>
  66. * @since 20.0.0
  67. */
  68. public function getRemoved(): array {
  69. return $this->removed;
  70. }
  71. }