2017-10-04 10:21:50 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2017-10-04 10:21:50 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-10-04 10:21:50 -04:00
|
|
|
*/
|
|
|
|
|
namespace OC\Remote\Api;
|
|
|
|
|
|
|
|
|
|
use OCP\Http\Client\IClientService;
|
|
|
|
|
use OCP\Remote\Api\IApiFactory;
|
|
|
|
|
use OCP\Remote\ICredentials;
|
|
|
|
|
use OCP\Remote\IInstance;
|
|
|
|
|
|
|
|
|
|
class ApiFactory implements IApiFactory {
|
2017-10-19 07:50:27 -04:00
|
|
|
/** @var IClientService */
|
2017-10-04 10:21:50 -04:00
|
|
|
private $clientService;
|
|
|
|
|
|
|
|
|
|
public function __construct(IClientService $clientService) {
|
|
|
|
|
$this->clientService = $clientService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getApiCollection(IInstance $instance, ICredentials $credentials) {
|
|
|
|
|
return new ApiCollection($instance, $credentials, $this->clientService);
|
|
|
|
|
}
|
|
|
|
|
}
|