@@ 23-32 (lines=10) @@ | ||
20 | * @return ManagerModel |
|
21 | * @throws \Speicher210\KontaktIO\Exception\ApiException |
|
22 | */ |
|
23 | public function getManager($id): ManagerModel |
|
24 | { |
|
25 | try { |
|
26 | $response = $this->client->get('/manager/' . $id); |
|
27 | ||
28 | return $this->serializer->deserialize($response->getBody(), ManagerModel::class, 'json'); |
|
29 | } catch (ClientException $e) { |
|
30 | throw $this->createApiException($e); |
|
31 | } |
|
32 | } |
|
33 | ||
34 | /** |
|
35 | * Get the manager for the user owing the API key. |
@@ 25-34 (lines=10) @@ | ||
22 | * @return DeviceModel |
|
23 | * @throws \Speicher210\KontaktIO\Exception\ApiException |
|
24 | */ |
|
25 | public function getDevice(string $uniqueId): DeviceModel |
|
26 | { |
|
27 | try { |
|
28 | $response = $this->client->get('/device/' . $uniqueId); |
|
29 | ||
30 | return $this->serializer->deserialize($response->getBody(), DeviceModel::class, 'json'); |
|
31 | } catch (ClientException $e) { |
|
32 | throw $this->createApiException($e); |
|
33 | } |
|
34 | } |
|
35 | ||
36 | /** |
|
37 | * Get the credentials of a device. |
|
@@ 42-51 (lines=10) @@ | ||
39 | * @param string $uniqueId The device unique ID. |
|
40 | * @return DeviceCredentialsModel |
|
41 | */ |
|
42 | public function getDeviceCredentials(string $uniqueId): DeviceCredentialsModel |
|
43 | { |
|
44 | try { |
|
45 | $response = $this->client->get('/device/' . $uniqueId . '/credentials'); |
|
46 | ||
47 | return $this->serializer->deserialize($response->getBody(), DeviceCredentialsModel::class, 'json'); |
|
48 | } catch (ClientException $e) { |
|
49 | throw $this->createApiException($e); |
|
50 | } |
|
51 | } |
|
52 | ||
53 | /** |
|
54 | * Update devices. |