DatabaseEngineRepository::getSupportedFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
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\DatabaseEngine;
15
use Linode\Databases\DatabaseEngineRepositoryInterface;
16
use Linode\Entity;
17
use Linode\Internal\AbstractRepository;
18
19
/**
20
 * @codeCoverageIgnore This class was autogenerated.
21
 */
22
class DatabaseEngineRepository extends AbstractRepository implements DatabaseEngineRepositoryInterface
23
{
24
    protected function getBaseUri(): string
25
    {
26
        return 'beta/databases/engines';
27
    }
28
29
    protected function getSupportedFields(): array
30
    {
31
        return [
32
            DatabaseEngine::FIELD_ID,
33
            DatabaseEngine::FIELD_ENGINE,
34
            DatabaseEngine::FIELD_VERSION,
35
            DatabaseEngine::FIELD_TOTAL_DISK_SIZE_GB,
36
            DatabaseEngine::FIELD_USED_DISK_SIZE_GB,
37
        ];
38
    }
39
40
    protected function jsonToEntity(array $json): Entity
41
    {
42
        return new DatabaseEngine($this->client, $json);
43
    }
44
}
45