ApiCollection.php 939 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Remote\Api;
  7. use OCP\Http\Client\IClientService;
  8. use OCP\Remote\Api\IApiCollection;
  9. use OCP\Remote\ICredentials;
  10. use OCP\Remote\IInstance;
  11. class ApiCollection implements IApiCollection {
  12. /** @var IInstance */
  13. private $instance;
  14. /** @var ICredentials */
  15. private $credentials;
  16. /** @var IClientService */
  17. private $clientService;
  18. public function __construct(IInstance $instance, ICredentials $credentials, IClientService $clientService) {
  19. $this->instance = $instance;
  20. $this->credentials = $credentials;
  21. $this->clientService = $clientService;
  22. }
  23. public function getCapabilitiesApi() {
  24. return new OCS($this->instance, $this->credentials, $this->clientService);
  25. }
  26. public function getUserApi() {
  27. return new OCS($this->instance, $this->credentials, $this->clientService);
  28. }
  29. }