IOutOfOfficeData.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * replacementUserId: ?string,
  21. * replacementUserDisplayName: ?string
  22. * }
  23. *
  24. * @since 28.0.0
  25. */
  26. interface IOutOfOfficeData extends JsonSerializable {
  27. /**
  28. * Get the unique token assigned to the current out-of-office event
  29. *
  30. * @since 28.0.0
  31. */
  32. public function getId(): string;
  33. /**
  34. * @since 28.0.0
  35. */
  36. public function getUser(): IUser;
  37. /**
  38. * Get the accurate out-of-office start date
  39. *
  40. * This event is not guaranteed to be emitted exactly at start date
  41. *
  42. * @since 28.0.0
  43. */
  44. public function getStartDate(): int;
  45. /**
  46. * Get the (preliminary) out-of-office end date
  47. *
  48. * @since 28.0.0
  49. */
  50. public function getEndDate(): int;
  51. /**
  52. * Get the short summary text displayed in the user status and similar
  53. *
  54. * @since 28.0.0
  55. */
  56. public function getShortMessage(): string;
  57. /**
  58. * Get the long out-of-office message for auto responders and similar
  59. *
  60. * @since 28.0.0
  61. */
  62. public function getMessage(): string;
  63. /**
  64. * Get the replacement user id for auto responders and similar
  65. *
  66. * @since 30.0.0
  67. */
  68. public function getReplacementUserId(): ?string;
  69. /**
  70. * Get the replacement user displayName for auto responders and similar
  71. *
  72. * @since 30.0.0
  73. */
  74. public function getReplacementUserDisplayName(): ?string;
  75. /**
  76. * @return OutOfOfficeData
  77. *
  78. * @since 28.0.0
  79. */
  80. public function jsonSerialize(): array;
  81. }