Passed
Push — master ( 41a424...f04d85 )
by Artem
01:57
created

DatabaseRepository::jsonToEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
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\Databases\Repository;
13
14
use Linode\Databases\Database;
15
use Linode\Databases\DatabaseRepositoryInterface;
16
use Linode\Entity;
17
use Linode\Internal\AbstractRepository;
18
19
/**
20
 * @codeCoverageIgnore This class was autogenerated.
21
 */
22
class DatabaseRepository extends AbstractRepository implements DatabaseRepositoryInterface
23
{
24
    protected function getBaseUri(): string
25
    {
26
        return 'beta/databases/instances';
27
    }
28
29
    protected function getSupportedFields(): array
30
    {
31
        return [
32
            Database::FIELD_ID,
33
            Database::FIELD_LABEL,
34
            Database::FIELD_REGION,
35
            Database::FIELD_TYPE,
36
            Database::FIELD_CLUSTER_SIZE,
37
            Database::FIELD_ENGINE,
38
            Database::FIELD_VERSION,
39
            Database::FIELD_STATUS,
40
            Database::FIELD_ENCRYPTED,
41
            Database::FIELD_ALLOW_LIST,
42
            Database::FIELD_HOSTS,
43
            Database::FIELD_CREATED,
44
            Database::FIELD_UPDATED,
45
            Database::FIELD_INSTANCE_URI,
46
        ];
47
    }
48
49
    protected function jsonToEntity(array $json): Entity
50
    {
51
        return new Database($this->client, $json);
52
    }
53
}
54