Devices::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
c 0
b 0
f 0
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\LinodeInstances;
13
14
use Linode\Entity;
15
16
/**
17
 * A dictionary of device disks to use as a device map in a Linode's configuration
18
 * profile.
19
 * * An empty device disk dictionary or a dictionary with empty values for device
20
 * slots is allowed.
21
 * * If no devices are specified, booting from this configuration will hold until a
22
 * device exists that allows the boot process to start.
23
 *
24
 * @property Device $sda Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
25
 *                       one type per slot allowed. Can be null.
26
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
27
 * @property Device $sdb Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
28
 *                       one type per slot allowed. Can be null.
29
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
30
 * @property Device $sdc Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
31
 *                       one type per slot allowed. Can be null.
32
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
33
 * @property Device $sdd Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
34
 *                       one type per slot allowed. Can be null.
35
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
36
 * @property Device $sde Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
37
 *                       one type per slot allowed. Can be null.
38
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
39
 * @property Device $sdf Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
40
 *                       one type per slot allowed. Can be null.
41
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
42
 * @property Device $sdg Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
43
 *                       one type per slot allowed. Can be null.
44
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
45
 * @property Device $sdh Device can be either a Disk or Volume identified by `disk_id` or `volume_id`. Only
46
 *                       one type per slot allowed. Can be null.
47
 *                       Devices mapped from _sde_ through _sdh_ are unavailable in `fullvirt` virt_mode.
48
 */
49
class Devices extends Entity
50
{
51
    // Available fields.
52
    public const FIELD_SDA = 'sda';
53
    public const FIELD_SDB = 'sdb';
54
    public const FIELD_SDC = 'sdc';
55
    public const FIELD_SDD = 'sdd';
56
    public const FIELD_SDE = 'sde';
57
    public const FIELD_SDF = 'sdf';
58
    public const FIELD_SDG = 'sdg';
59
    public const FIELD_SDH = 'sdh';
60
61
    /**
62
     * @codeCoverageIgnore This method was autogenerated.
63
     */
64
    public function __get(string $name): mixed
65
    {
66
        return match ($name) {
67
            default => new Device($this->client, $this->data[$name]),
68
        };
69
    }
70
}
71