|
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 $label Detailed location information for this Region, including city, state or region, |
|
21
|
|
|
* and country. |
|
22
|
|
|
* @property string $country The country where this Region resides. |
|
23
|
|
|
* @property string[] $capabilities A list of capabilities of this region. |
|
24
|
|
|
* @property string $status This region's current operational status. |
|
25
|
|
|
* @property Resolvers $resolvers Region's DNS resolvers. |
|
26
|
|
|
*/ |
|
27
|
|
|
class Region extends Entity |
|
28
|
|
|
{ |
|
29
|
|
|
// Available fields. |
|
30
|
|
|
public const FIELD_ID = 'id'; |
|
31
|
|
|
public const FIELD_LABEL = 'label'; |
|
32
|
|
|
public const FIELD_COUNTRY = 'country'; |
|
33
|
|
|
public const FIELD_CAPABILITIES = 'capabilities'; |
|
34
|
|
|
public const FIELD_STATUS = 'status'; |
|
35
|
|
|
public const FIELD_RESOLVERS = 'resolvers'; |
|
36
|
|
|
|
|
37
|
|
|
// `FIELD_STATUS` values. |
|
38
|
|
|
public const STATUS_OK = 'ok'; |
|
39
|
|
|
public const STATUS_OUTAGE = 'outage'; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @codeCoverageIgnore This method was autogenerated. |
|
43
|
|
|
*/ |
|
44
|
|
|
public function __get(string $name): mixed |
|
45
|
|
|
{ |
|
46
|
|
|
return match ($name) { |
|
47
|
|
|
self::FIELD_RESOLVERS => new Resolvers($this->client, $this->data[$name]), |
|
48
|
|
|
default => parent::__get($name), |
|
49
|
|
|
}; |
|
50
|
|
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|