1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
// --------------------------------------------------------------------- |
4
|
|
|
// |
5
|
|
|
// Copyright (C) 2018-2024 Artem Rodygin |
6
|
|
|
// |
7
|
|
|
// You should have received a copy of the MIT License along with |
8
|
|
|
// this file. If not, see <https://opensource.org/licenses/MIT>. |
9
|
|
|
// |
10
|
|
|
// --------------------------------------------------------------------- |
11
|
|
|
|
12
|
|
|
namespace Linode\Account\Repository; |
13
|
|
|
|
14
|
|
|
use Linode\Account\Notification; |
15
|
|
|
use Linode\Account\NotificationRepositoryInterface; |
16
|
|
|
use Linode\Entity; |
17
|
|
|
use Linode\Internal\AbstractRepository; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @codeCoverageIgnore This class was autogenerated. |
21
|
|
|
*/ |
22
|
|
|
class NotificationRepository extends AbstractRepository implements NotificationRepositoryInterface |
23
|
|
|
{ |
24
|
|
|
protected function getBaseUri(): string |
25
|
|
|
{ |
26
|
|
|
return '/account/notifications'; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
protected function getSupportedFields(): array |
30
|
|
|
{ |
31
|
|
|
return [ |
32
|
|
|
Notification::FIELD_LABEL, |
33
|
|
|
Notification::FIELD_MESSAGE, |
34
|
|
|
Notification::FIELD_SEVERITY, |
35
|
|
|
Notification::FIELD_WHEN, |
36
|
|
|
Notification::FIELD_UNTIL, |
37
|
|
|
Notification::FIELD_TYPE, |
38
|
|
|
Notification::FIELD_BODY, |
39
|
|
|
Notification::FIELD_ENTITY, |
40
|
|
|
]; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function jsonToEntity(array $json): Entity |
44
|
|
|
{ |
45
|
|
|
return new Notification($this->client, $json); |
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
|