Passed
Push — master ( 0676a7...01ab94 )
by Artem
11:54
created

LongviewClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 19
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __get() 0 5 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
16
/**
17
 * A LongviewClient is a single monitor set up to track statistics about one of your
18
 * servers.
19
 *
20
 * @property int          $id           This Client's unique ID.
21
 * @property string       $label        This Client's unique label. This is for display purposes only.
22
 * @property string       $api_key      The API key for this Client, used when configuring the Longview Client application
23
 *                                      on your Linode.
24
 * @property string       $install_code The install code for this Client, used when configuring the Longview Client
25
 *                                      application on your Linode.
26
 * @property string       $created      When this Longview Client was created.
27
 * @property string       $updated      When this Longview Client was last updated.
28
 * @property LongviewApps $apps         The apps this Client is monitoring on your Linode. This is configured when you
29
 *                                      install the Longview Client application, and is present here for information
30
 *                                      purposes only.
31
 */
32
class LongviewClient extends Entity
33
{
34
    // Available fields.
35
    public const FIELD_ID           = 'id';
36
    public const FIELD_LABEL        = 'label';
37
    public const FIELD_API_KEY      = 'api_key';
38
    public const FIELD_INSTALL_CODE = 'install_code';
39
    public const FIELD_CREATED      = 'created';
40
    public const FIELD_UPDATED      = 'updated';
41
    public const FIELD_APPS         = 'apps';
42
43
    /**
44
     * @codeCoverageIgnore This method was autogenerated.
45
     */
46
    public function __get(string $name): mixed
47
    {
48
        return match ($name) {
49
            self::FIELD_APPS => new LongviewApps($this->client, $this->data[$name]),
50
            default          => parent::__get($name),
51
        };
52
    }
53
}
54