Passed
Push — master ( 0676a7...01ab94 )
by Artem
11:54
created

ObjectStorageClusterRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 21
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBaseUri() 0 3 1
A jsonToEntity() 0 3 1
A getSupportedFields() 0 8 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\ObjectStorage\Repository;
13
14
use Linode\Entity;
15
use Linode\Internal\AbstractRepository;
16
use Linode\ObjectStorage\ObjectStorageCluster;
17
use Linode\ObjectStorage\ObjectStorageClusterRepositoryInterface;
18
19
/**
20
 * @codeCoverageIgnore This class was autogenerated.
21
 */
22
class ObjectStorageClusterRepository extends AbstractRepository implements ObjectStorageClusterRepositoryInterface
23
{
24
    protected function getBaseUri(): string
25
    {
26
        return 'beta/object-storage/clusters';
27
    }
28
29
    protected function getSupportedFields(): array
30
    {
31
        return [
32
            ObjectStorageCluster::FIELD_ID,
33
            ObjectStorageCluster::FIELD_DOMAIN,
34
            ObjectStorageCluster::FIELD_STATUS,
35
            ObjectStorageCluster::FIELD_REGION,
36
            ObjectStorageCluster::FIELD_STATIC_SITE_DOMAIN,
37
        ];
38
    }
39
40
    protected function jsonToEntity(array $json): Entity
41
    {
42
        return new ObjectStorageCluster($this->client, $json);
43
    }
44
}
45