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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 167
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 167
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAlias() 0 22 2
A retrieve() 0 5 1
A delete() 0 5 1
A update() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Compute\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 Compute v2 Quota Set
13
 *
14
 * @property \OpenStack\Compute\v2\Api $api
15
 */
16
class QuotaSet extends OperatorResource implements Retrievable, Updateable, Deletable
17
{
18
    /**
19
     * The number of allowed instance cores for each tenant.
20
     *
21
     * @var  int|array
22
     */
23
    public $cores;
24
25
    /**
26
     * The number of allowed fixed IP addresses for each tenant.
27
     * Must be equal to or greater than the number of allowed instances.
28
     *
29
     * @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this.
30
     * @var  int|object
31
     */
32
    public $fixedIps;
33
34
    /**
35
     * The number of allowed floating IP addresses for each tenant.
36
     *
37
     * @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this.
38
     * @var  int|array
39
     */
40
    public $floatingIps;
41
42
    /**
43
     * The UUID of the tenant/user the quotas listed for.
44
     *
45
     * @var  string
46
     */
47
    public $tenantId;
48
49
    /**
50
     * The number of allowed bytes of content for each injected file.
51
     *
52
     * @var  int|array
53
     */
54
    public $injectedFileContentBytes;
55
56
    /**
57
     * The number of allowed bytes for each injected file path.
58
     *
59
     * @var  int|array
60
     */
61
    public $injectedFilePathBytes;
62
63
    /**
64
     * The number of allowed injected files for each tenant.
65
     *
66
     * @var  int|array
67
     */
68
    public $injectedFiles;
69
70
    /**
71
     * The number of allowed instances for each tenant.
72
     *
73
     * @var  int|array
74
     */
75
    public $instances;
76
77
    /**
78
     * The number of allowed key pairs for each user.
79
     *
80
     * @var  int|array
81
     */
82
    public $keyPairs;
83
84
    /**
85
     * The number of allowed metadata items for each instance.
86
     *
87
     * @var  int|array
88
     */
89
    public $metadataItems;
90
91
    /**
92
     * The amount of allowed instance RAM, in MB, for each tenant.
93
     *
94
     * @var  int|array
95
     */
96
    public $ram;
97
98
    /**
99
     * The number of allowed rules for each security group.
100
     *
101
     * @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this.
102
     * @var  int|array
103
     */
104
    public $securityGroupRules;
105
106
    /**
107
     * The number of allowed security groups for each tenant.
108
     *
109
     * @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this.
110
     * @var  int|array
111
     */
112
    public $securityGroups;
113
114
    /**
115
     * The number of allowed server groups for each tenant.
116
     *
117
     * @var  int|array
118
     */
119
    public $serverGroups;
120
121
    /**
122
     * The number of allowed members for each server group.
123
     *
124
     * @var  int|object
125
     */
126
    public $serverGroupMembers;
127
128
    protected $resourceKey = 'quota_set';
129
130
    /**
131
     * @inheritdoc
132
     */
133
    protected static function getAlias(): Alias
134
    {
135
        $alias = parent::getAlias();
136
137
        if (!$alias->hasAliases(self::class)) {
138
            $alias
139
                ->add(self::class, 'id', 'tenantId')
140
                ->add(self::class, 'fixed_ips', 'fixedIps')
141
                ->add(self::class, 'floating_ips', 'floatingIps')
142
                ->add(self::class, 'injected_file_content_bytes', 'injectedFileContentBytes')
143
                ->add(self::class, 'injected_file_path_bytes', 'injectedFilePathBytes')
144
                ->add(self::class, 'injected_files', 'injectedFiles')
145
                ->add(self::class, 'key_pairs', 'keyPairs')
146
                ->add(self::class, 'metadata_items', 'metadataItems')
147
                ->add(self::class, 'security_group_rules', 'securityGroupRules')
148
                ->add(self::class, 'security_groups', 'securityGroups')
149
                ->add(self::class, 'server_group_members', 'serverGroupMembers')
150
                ->add(self::class, 'server_groups', 'serverGroups');
151
        }
152
153
        return $alias;
154
    }
155
156
    /**
157
     * @inheritdoc
158
     */
159
    public function retrieve()
160
    {
161
        $response = $this->execute($this->api->getQuotaSet(), ['tenantId' => (string)$this->tenantId]);
162
        $this->populateFromResponse($response);
163
    }
164
165
    /**
166
     * @inheritdoc
167
     */
168
    public function delete()
169
    {
170
        $response = $this->executeWithState($this->api->deleteQuotaSet());
171
        $this->populateFromResponse($response);
172
    }
173
174
    /**
175
     * @inheritdoc
176
     */
177
    public function update()
178
    {
179
        $response = $this->executeWithState($this->api->putQuotaSet());
180
        $this->populateFromResponse($response);
181
    }
182
}
183