LongviewSubscription::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
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\Longview;
13
14
use Linode\Entity;
15
use Linode\Linode\Price;
16
17
/**
18
 * A Longview Subscription represents a tier of Longview service you can subscribe
19
 * to.
20
 *
21
 * @property string $id               The unique ID of this Subscription tier.
22
 * @property string $label            A display name for this Subscription tier.
23
 * @property int    $clients_included The number of Longview Clients that may be created with this Subscription tier.
24
 * @property Price  $price            Pricing information about this Subscription tier.
25
 */
26
class LongviewSubscription extends Entity
27
{
28
    // Available fields.
29
    public const FIELD_ID               = 'id';
30
    public const FIELD_LABEL            = 'label';
31
    public const FIELD_CLIENTS_INCLUDED = 'clients_included';
32
    public const FIELD_PRICE            = 'price';
33
34
    // `FIELD_ID` values.
35
    public const ID_LONGVIEW_3   = 'longview-3';
36
    public const ID_LONGVIEW_10  = 'longview-10';
37
    public const ID_LONGVIEW_40  = 'longview-40';
38
    public const ID_LONGVIEW_100 = 'longview-100';
39
40
    /**
41
     * @codeCoverageIgnore This method was autogenerated.
42
     */
43
    public function __get(string $name): mixed
44
    {
45
        return match ($name) {
46
            self::FIELD_PRICE => new Price($this->client, $this->data[$name]),
47
            default           => parent::__get($name),
48
        };
49
    }
50
}
51