1 | <?php declare(strict_types = 1); |
||
12 | final class InstallationService |
||
13 | { |
||
14 | /** |
||
15 | * @var Client |
||
16 | */ |
||
17 | private $client; |
||
18 | |||
19 | /** |
||
20 | * @param Client $client |
||
21 | */ |
||
22 | public function __construct(Client $client) |
||
26 | |||
27 | /** |
||
28 | * @param Keypair $keypair |
||
29 | * @return array |
||
30 | * |
||
31 | * Array( |
||
32 | * 'Id' => ... |
||
33 | * 'Token' => ... |
||
34 | * 'ServerPublicKey' ... |
||
35 | * ) |
||
36 | */ |
||
37 | public function createInstallation(Keypair $keypair): array |
||
44 | |||
45 | /** |
||
46 | * @return Id $deviceServerId |
||
47 | */ |
||
48 | public function createDeviceServer($token, string $apiKey, string $description): Id |
||
62 | |||
63 | /** |
||
64 | * @param $token |
||
65 | * @param string $apiKey |
||
66 | * @return array |
||
67 | * |
||
68 | * Array( |
||
69 | * 'Id' => ... |
||
70 | * 'Token' => ... |
||
71 | * 'UserCompany' => ... |
||
72 | * ) |
||
73 | */ |
||
74 | public function createSessionServer($token, string $apiKey): array |
||
82 | |||
83 | /** |
||
84 | * @param Installation $installation |
||
85 | * @return DeviceServer[] |
||
86 | */ |
||
87 | public function listDeviceServers(Installation $installation): array |
||
93 | |||
94 | /** |
||
95 | * @return array |
||
96 | */ |
||
97 | public function listInstallations() |
||
101 | |||
102 | /** |
||
103 | * @param Id $installationId |
||
104 | * @return Installation[] |
||
105 | */ |
||
106 | public function installationById(Id $installationId) |
||
110 | |||
111 | /** |
||
112 | * @param Installation $installation |
||
113 | * @return array |
||
114 | */ |
||
115 | public function serverPublicKey(Installation $installation) |
||
119 | } |
||
120 |