IOCMResource.php 1.6 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\OCM;
  8. use JsonSerializable;
  9. /**
  10. * Model based on the Open Cloud Mesh Discovery API
  11. *
  12. * @link https://github.com/cs3org/OCM-API/
  13. * @since 28.0.0
  14. */
  15. interface IOCMResource extends JsonSerializable {
  16. /**
  17. * set name of the resource
  18. *
  19. * @param string $name
  20. *
  21. * @return $this
  22. * @since 28.0.0
  23. */
  24. public function setName(string $name): static;
  25. /**
  26. * get name of the resource
  27. *
  28. * @return string
  29. * @since 28.0.0
  30. */
  31. public function getName(): string;
  32. /**
  33. * set share types
  34. *
  35. * @param list<string> $shareTypes
  36. *
  37. * @return $this
  38. * @since 28.0.0
  39. */
  40. public function setShareTypes(array $shareTypes): static;
  41. /**
  42. * get share types
  43. *
  44. * @return list<string>
  45. * @since 28.0.0
  46. */
  47. public function getShareTypes(): array;
  48. /**
  49. * set available protocols
  50. *
  51. * @param array<string, string> $protocols
  52. *
  53. * @return $this
  54. * @since 28.0.0
  55. */
  56. public function setProtocols(array $protocols): static;
  57. /**
  58. * get configured protocols
  59. *
  60. * @return array<string, string>
  61. * @since 28.0.0
  62. */
  63. public function getProtocols(): array;
  64. /**
  65. * import data from an array
  66. *
  67. * @param array $data
  68. *
  69. * @return $this
  70. * @since 28.0.0
  71. */
  72. public function import(array $data): static;
  73. /**
  74. * @return array{
  75. * name: string,
  76. * shareTypes: list<string>,
  77. * protocols: array<string, string>
  78. * }
  79. * @since 28.0.0
  80. */
  81. public function jsonSerialize(): array;
  82. }