IAccountProperty.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
  5. *
  6. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  7. * @author Julius Härtl <jus@bitgrid.net>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. namespace OCP\Accounts;
  26. use InvalidArgumentException;
  27. /**
  28. * Interface IAccountProperty
  29. *
  30. * @since 15.0.0
  31. */
  32. interface IAccountProperty extends \JsonSerializable {
  33. /**
  34. * Set the value of a property
  35. *
  36. * @since 15.0.0
  37. *
  38. * @param string $value
  39. * @return IAccountProperty
  40. */
  41. public function setValue(string $value): IAccountProperty;
  42. /**
  43. * Set the scope of a property
  44. *
  45. * @since 15.0.0
  46. *
  47. * @param string $scope
  48. * @return IAccountProperty
  49. * @throws InvalidArgumentException (since 22.0.0)
  50. */
  51. public function setScope(string $scope): IAccountProperty;
  52. /**
  53. * Set the verification status of a property
  54. *
  55. * @since 15.0.0
  56. *
  57. * @param string $verified
  58. * @return IAccountProperty
  59. */
  60. public function setVerified(string $verified): IAccountProperty;
  61. /**
  62. * Get the name of a property
  63. *
  64. * @since 15.0.0
  65. *
  66. * @return string
  67. */
  68. public function getName(): string;
  69. /**
  70. * Get the value of a property
  71. *
  72. * @since 15.0.0
  73. *
  74. * @return string
  75. */
  76. public function getValue(): string;
  77. /**
  78. * Get the scope of a property
  79. *
  80. * @since 15.0.0
  81. *
  82. * @return string
  83. */
  84. public function getScope(): string;
  85. /**
  86. * Get the verification status of a property
  87. *
  88. * @since 15.0.0
  89. *
  90. * @return string
  91. */
  92. public function getVerified(): string;
  93. /**
  94. * Sets data for verification purposes.
  95. *
  96. * @since 22.0.0
  97. */
  98. public function setVerificationData(string $verificationData): IAccountProperty;
  99. /**
  100. * Retrieves data for verification purposes.
  101. *
  102. * @since 22.0.0
  103. */
  104. public function getVerificationData(): string;
  105. /**
  106. * Set the instance-based verification status of a property
  107. *
  108. * @since 23.0.0
  109. *
  110. * @param string $verified must be one of the verification constants of IAccountManager
  111. * @return IAccountProperty
  112. * @throws InvalidArgumentException
  113. */
  114. public function setLocallyVerified(string $verified): IAccountProperty;
  115. /**
  116. * Get the instance-based verification status of a property
  117. *
  118. * @since 23.0.0
  119. *
  120. * @return string
  121. */
  122. public function getLocallyVerified(): string;
  123. }