1
0

IOCMResource.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2023 Maxence Lange <maxence@artificial-owl.com>
  5. *
  6. * @author Maxence Lange <maxence@artificial-owl.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCP\OCM;
  25. use JsonSerializable;
  26. /**
  27. * Model based on the Open Cloud Mesh Discovery API
  28. *
  29. * @link https://github.com/cs3org/OCM-API/
  30. * @since 28.0.0
  31. */
  32. interface IOCMResource extends JsonSerializable {
  33. /**
  34. * set name of the resource
  35. *
  36. * @param string $name
  37. *
  38. * @return $this
  39. * @since 28.0.0
  40. */
  41. public function setName(string $name): static;
  42. /**
  43. * get name of the resource
  44. *
  45. * @return string
  46. * @since 28.0.0
  47. */
  48. public function getName(): string;
  49. /**
  50. * set share types
  51. *
  52. * @param string[] $shareTypes
  53. *
  54. * @return $this
  55. * @since 28.0.0
  56. */
  57. public function setShareTypes(array $shareTypes): static;
  58. /**
  59. * get share types
  60. *
  61. * @return string[]
  62. * @since 28.0.0
  63. */
  64. public function getShareTypes(): array;
  65. /**
  66. * set available protocols
  67. *
  68. * @param array<string, string> $protocols
  69. *
  70. * @return $this
  71. * @since 28.0.0
  72. */
  73. public function setProtocols(array $protocols): static;
  74. /**
  75. * get configured protocols
  76. *
  77. * @return array<string, string>
  78. * @since 28.0.0
  79. */
  80. public function getProtocols(): array;
  81. /**
  82. * import data from an array
  83. *
  84. * @param array $data
  85. *
  86. * @return $this
  87. * @since 28.0.0
  88. */
  89. public function import(array $data): static;
  90. /**
  91. * @return array{
  92. * name: string,
  93. * shareTypes: string[],
  94. * protocols: array<string, string>
  95. * }
  96. * @since 28.0.0
  97. */
  98. public function jsonSerialize(): array;
  99. }