GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#159)
by Roman
01:49
created

QuotaSet::getAlias()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 17
rs 9.4285
cc 2
eloc 12
nc 2
nop 0
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\BlockStorage\v2\Models;
4
5
use OpenStack\Common\Resource\Alias;
6
use OpenStack\Common\Resource\Deletable;
7
use OpenStack\Common\Resource\OperatorResource;
8
use OpenStack\Common\Resource\Retrievable;
9
use OpenStack\Common\Resource\Updateable;
10
11
/**
12
 * Represents a BlockStorage v2 Quota Set
13
 *
14
 * @property \OpenStack\BlockStorage\v2\Api $api
15
 */
16
class QuotaSet extends OperatorResource implements Retrievable, Updateable, Deletable
17
{
18
    /** @var string */
19
    public $tenantId;
20
21
    /** @var int */
22
    public $backupGigabytes;
23
24
    /** @var int */
25
    public $backups;
26
27
    /** @var int */
28
    public $gigabytes;
29
30
    /** @var int */
31
    public $gigabytesIscsi;
32
33
    /** @var int */
34
    public $perVolumeGigabytes;
35
36
    /** @var int */
37
    public $snapshots;
38
39
    /** @var int */
40
    public $snapshotsIscsi;
41
42
    /** @var int */
43
    public $volumes;
44
45
    /** @var int */
46
    public $volumesIscsi;
47
48
    protected $resourceKey = 'quota_set';
49
50
    /**
51
     * @inheritdoc
52
     */
53
    protected static function getAlias(): Alias
54
    {
55
        $alias = parent::getAlias();
56
57
        if (!$alias->hasAliases(self::class)) {
58
            $alias
59
                ->add(self::class, 'backup_gigabytes', 'backupGigabytes')
60
                ->add(self::class, 'gigabytes', 'gigabytes')
61
                ->add(self::class, 'gigabytes_iscsi', 'gigabytesIscsi')
62
                ->add(self::class, 'per_volume_gigabytes', 'perVolumeGigabytes')
63
                ->add(self::class, 'snapshots_iscsi', 'snapshotsIscsi')
64
                ->add(self::class, 'volumes_iscsi', 'volumesIscsi')
65
                ->add(self::class, 'id', 'tenantId');
66
        }
67
68
        return $alias;
69
    }
70
71
    /**
72
     * @inheritdoc
73
     */
74
    public function retrieve()
75
    {
76
        $response = $this->execute($this->api->getQuotaSet(), ['tenantId' => (string)$this->tenantId]);
77
        $this->populateFromResponse($response);
78
    }
79
80
    /**
81
     * @inheritdoc
82
     */
83
    public function update()
84
    {
85
        $response = $this->executeWithState($this->api->putQuotaSet());
86
        $this->populateFromResponse($response);
87
    }
88
89
    /**
90
     * @inheritdoc
91
     */
92
    public function delete()
93
    {
94
        $response = $this->executeWithState($this->api->deleteQuotaSet());
95
        $this->populateFromResponse($response);
96
    }
97
}
98