1
0

IAction.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Joas Schilling <coding@schilljs.com>
  7. *
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCP\Notification;
  24. /**
  25. * Interface IAction
  26. *
  27. * @since 9.0.0
  28. */
  29. interface IAction {
  30. /**
  31. * @since 17.0.0
  32. */
  33. public const TYPE_GET = 'GET';
  34. /**
  35. * @since 17.0.0
  36. */
  37. public const TYPE_POST = 'POST';
  38. /**
  39. * @since 17.0.0
  40. */
  41. public const TYPE_PUT = 'PUT';
  42. /**
  43. * @since 17.0.0
  44. */
  45. public const TYPE_DELETE = 'DELETE';
  46. /**
  47. * @since 17.0.0
  48. */
  49. public const TYPE_WEB = 'WEB';
  50. /**
  51. * @param string $label
  52. * @return $this
  53. * @throws \InvalidArgumentException if the label is invalid
  54. * @since 9.0.0
  55. */
  56. public function setLabel(string $label): IAction;
  57. /**
  58. * @return string
  59. * @since 9.0.0
  60. */
  61. public function getLabel(): string;
  62. /**
  63. * @param string $label
  64. * @return $this
  65. * @throws \InvalidArgumentException if the label is invalid
  66. * @since 9.0.0
  67. */
  68. public function setParsedLabel(string $label): IAction;
  69. /**
  70. * @return string
  71. * @since 9.0.0
  72. */
  73. public function getParsedLabel(): string;
  74. /**
  75. * @param bool $primary
  76. * @return $this
  77. * @throws \InvalidArgumentException if $primary is invalid
  78. * @since 9.0.0
  79. */
  80. public function setPrimary(bool $primary): IAction;
  81. /**
  82. * @return bool
  83. * @since 9.0.0
  84. */
  85. public function isPrimary(): bool;
  86. /**
  87. * @param string $link
  88. * @param string $requestType
  89. * @return $this
  90. * @throws \InvalidArgumentException if the link is invalid
  91. * @since 9.0.0
  92. */
  93. public function setLink(string $link, string $requestType): IAction;
  94. /**
  95. * @return string
  96. * @since 9.0.0
  97. */
  98. public function getLink(): string;
  99. /**
  100. * @return string
  101. * @since 9.0.0
  102. */
  103. public function getRequestType(): string;
  104. /**
  105. * @return bool
  106. * @since 9.0.0
  107. */
  108. public function isValid(): bool;
  109. /**
  110. * @return bool
  111. * @since 9.0.0
  112. */
  113. public function isValidParsed(): bool;
  114. }