IOutOfOfficeData.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User;
  8. use JsonSerializable;
  9. use OCP\IUser;
  10. /**
  11. * DTO to hold out-of-office information of a user
  12. *
  13. * @psalm-type OutOfOfficeData = array{
  14. * id: string,
  15. * userId: string,
  16. * startDate: int,
  17. * endDate: int,
  18. * shortMessage: string,
  19. * message: string,
  20. * }
  21. *
  22. * @since 28.0.0
  23. */
  24. interface IOutOfOfficeData extends JsonSerializable {
  25. /**
  26. * Get the unique token assigned to the current out-of-office event
  27. *
  28. * @since 28.0.0
  29. */
  30. public function getId(): string;
  31. /**
  32. * @since 28.0.0
  33. */
  34. public function getUser(): IUser;
  35. /**
  36. * Get the accurate out-of-office start date
  37. *
  38. * This event is not guaranteed to be emitted exactly at start date
  39. *
  40. * @since 28.0.0
  41. */
  42. public function getStartDate(): int;
  43. /**
  44. * Get the (preliminary) out-of-office end date
  45. *
  46. * @since 28.0.0
  47. */
  48. public function getEndDate(): int;
  49. /**
  50. * Get the short summary text displayed in the user status and similar
  51. *
  52. * @since 28.0.0
  53. */
  54. public function getShortMessage(): string;
  55. /**
  56. * Get the long out-of-office message for auto responders and similar
  57. *
  58. * @since 28.0.0
  59. */
  60. public function getMessage(): string;
  61. /**
  62. * @return OutOfOfficeData
  63. *
  64. * @since 28.0.0
  65. */
  66. public function jsonSerialize(): array;
  67. }