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

DatabaseRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 18
c 1
b 0
f 0
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonToEntity() 0 3 1
A getBaseUri() 0 3 1
A getSupportedFields() 0 17 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