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

LKENodePool   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 12
c 1
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __get() 0 6 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\LKE;
13
14
use Linode\Entity;
15
16
/**
17
 * The set of Node Pools which are members of the Kubernetes cluster. Node Pools
18
 * consist of a Linode type, the number of Linodes to deploy of that type, and
19
 * additional status information.
20
 *
21
 * @property Autoscaler      $autoscaler When enabled, the number of nodes autoscales within the defined minimum and
22
 *                                       maximum values.
23
 * @property string          $type       The Linode Type for all of the nodes in the Node Pool.
24
 * @property int             $count      The number of nodes in the Node Pool.
25
 * @property DiskLayout      $disks      This Node Pool's custom disk layout.
26
 * @property int             $id         This Node Pool's unique ID.
27
 * @property LKENodeStatus[] $nodes      Status information for the Nodes which are members of this Node Pool. If a Linode
28
 *                                       has not been provisioned for a given Node slot, the instance_id will be returned
29
 *                                       as null.
30
 * @property string[]        $tags       An array of tags applied to this object. Tags are for organizational purposes
31
 *                                       only.
32
 */
33
class LKENodePool extends Entity
34
{
35
    // Available fields.
36
    public const FIELD_AUTOSCALER = 'autoscaler';
37
    public const FIELD_TYPE       = 'type';
38
    public const FIELD_COUNT      = 'count';
39
    public const FIELD_DISKS      = 'disks';
40
    public const FIELD_ID         = 'id';
41
    public const FIELD_NODES      = 'nodes';
42
    public const FIELD_TAGS       = 'tags';
43
44
    /**
45
     * @codeCoverageIgnore This method was autogenerated.
46
     */
47
    public function __get(string $name): mixed
48
    {
49
        return match ($name) {
50
            self::FIELD_AUTOSCALER => new Autoscaler($this->client, $this->data[$name]),
51
            self::FIELD_DISKS      => new DiskLayout($this->client, $this->data[$name]),
52
            default                => parent::__get($name),
53
        };
54
    }
55
}
56