Passed
Push — master ( bfa63a...41a424 )
by Artem
01:47
created

Region::__get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 5
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\Regions;
13
14
use Linode\Entity;
15
16
/**
17
 * An area where Linode services are available.
18
 *
19
 * @property string    $id           The unique ID of this Region.
20
 * @property string    $country      The country where this Region resides.
21
 * @property string[]  $capabilities A list of capabilities of this region.
22
 * @property string    $status       This region's current operational status.
23
 * @property Resolvers $resolvers    Region's DNS resolvers.
24
 */
25
class Region extends Entity
26
{
27
    // Available fields.
28
    public const FIELD_ID           = 'id';
29
    public const FIELD_COUNTRY      = 'country';
30
    public const FIELD_CAPABILITIES = 'capabilities';
31
    public const FIELD_STATUS       = 'status';
32
    public const FIELD_RESOLVERS    = 'resolvers';
33
34
    // `FIELD_STATUS` values.
35
    public const STATUS_OK     = 'ok';
36
    public const STATUS_OUTAGE = 'outage';
37
38
    /**
39
     * @codeCoverageIgnore This method was autogenerated.
40
     */
41
    public function __get(string $name): mixed
42
    {
43
        return match ($name) {
44
            self::FIELD_RESOLVERS => new Resolvers($this->client, $this->data[$name]),
45
            default               => parent::__get($name),
46
        };
47
    }
48
}
49