diff options
author | Joas Schilling <coding@schilljs.com> | 2023-10-12 12:25:54 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-10-13 08:38:19 +0200 |
commit | fc445a2eaa2f93ae7f55b3af8800a87a69480a66 (patch) | |
tree | e946fcdf356f133b7a8bfa23eaa1d57c135c5615 /apps/cloud_federation_api | |
parent | b246d51cbc5105b9c4e85867297ee19f6d2459e5 (diff) | |
download | nextcloud-server-fc445a2eaa2f93ae7f55b3af8800a87a69480a66.tar.gz nextcloud-server-fc445a2eaa2f93ae7f55b3af8800a87a69480a66.zip |
feat(OCM): Add a way for apps to create a new IOCMResource
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/cloud_federation_api')
-rw-r--r-- | apps/cloud_federation_api/lib/Capabilities.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/cloud_federation_api/lib/Capabilities.php b/apps/cloud_federation_api/lib/Capabilities.php index cd44d13117a..9b04145caa2 100644 --- a/apps/cloud_federation_api/lib/Capabilities.php +++ b/apps/cloud_federation_api/lib/Capabilities.php @@ -28,14 +28,12 @@ declare(strict_types=1); namespace OCA\CloudFederationAPI; -use OC\OCM\Model\OCMResource; use OCP\Capabilities\ICapability; use OCP\IURLGenerator; use OCP\OCM\Exceptions\OCMArgumentException; use OCP\OCM\IOCMProvider; class Capabilities implements ICapability { - public const API_VERSION = '1.0-proposal1'; public function __construct( @@ -74,12 +72,12 @@ class Capabilities implements ICapability { $this->provider->setEndPoint(substr($url, 0, $pos)); - $resource = new OCMResource(); + $resource = $this->provider->createNewResourceType(); $resource->setName('file') ->setShareTypes(['user', 'group']) ->setProtocols(['webdav' => '/public.php/webdav/']); - $this->provider->setResourceTypes([$resource]); + $this->provider->addResourceType($resource); return ['ocm' => $this->provider->jsonSerialize()]; } |