3declare(strict_types=1);
5namespace Bitrix\Rest\Service;
7use Bitrix\Main\DI\ServiceLocator;
8use Bitrix\Main\ObjectNotFoundException;
9use Bitrix\Rest\Repository\AppRepository;
10use Bitrix\Rest\Repository\IntegrationRepository;
11use Psr\Container\ContainerInterface;
12use Psr\Container\NotFoundExceptionInterface;
13use Bitrix\Rest\Contract;
19 private string $prefix;
21 private function __construct()
23 $this->serviceLocator = ServiceLocator::getInstance();
24 $this->prefix =
'rest.service.';
27 private function __clone()
32 if (!isset(self::$instance))
34 self::$instance =
new self();
37 return self::$instance;
40 public function has(
string $id): bool
42 return $this->serviceLocator->has($this->prefix . $id);
49 public function get(
string $id): mixed
51 return $this->serviceLocator->get($this->prefix . $id);
56 return $this->
get(
'apauth.password');
61 return $this->
get(
'app');
66 return $this->
get(
'integration');
71 return $this->
get(
'apauth.permission');
getAPAuthPasswordService()
getAPAuthPermissionService()