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 (#50)
by Ha
05:50
created

SecurityGroup::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php declare (strict_types=1);
2
3
namespace OpenStack\Networking\v2\Extensions\SecurityGroups\Models;
4
5
use OpenCloud\Common\Resource\OperatorResource;
6
use OpenCloud\Common\Resource\Creatable;
7
use OpenCloud\Common\Resource\Deletable;
8
use OpenCloud\Common\Resource\Listable;
9
use OpenCloud\Common\Resource\Retrievable;
10
use OpenCloud\Common\Resource\Updateable;
11
12
/**
13
 * Represents a SecurityGroup resource in the Network v2 service
14
 *
15
 * @property \OpenStack\Networking\v2\Extensions\SecurityGroups\Api $api
16
 */
17
class SecurityGroup extends OperatorResource implements Creatable, Listable, Deletable, Retrievable, Updateable
18
{
19
    /**
20
     * @var string
21
     */
22
    public $description;
23
24
    /**
25
     * @var string
26
     */
27
    public $id;
28
29
    /**
30
     * @var string
31
     */
32
    public $name;
33
34
    /**
35
     * @var []SecurityGroupRule
36
     */
37
    public $securityGroupRules;
38
39
    /**
40
     * @var string
41
     */
42
    public $tenantId;
43
44
    protected $aliases = [
45
        'security_group_rules' => 'securityGroupRules',
46
        'rules'                => 'securityGroupRules',
47
        'tenant_id'            => 'tenantId',
48
    ];
49
50
    protected $resourceKey  = 'security_group';
51
    protected $resourcesKey = 'security_groups';
52
53
    /**
54
     * {@inheritDoc}
55
     */
56
    public function create(array $userOptions): Creatable
57
    {
58
        $response = $this->execute($this->api->postSecurityGroups(), $userOptions);
59
        return $this->populateFromResponse($response);
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65
    public function delete()
66
    {
67
        $this->executeWithState($this->api->deleteSecurityGroup());
68
    }
69
70
    /**
71
     * {@inheritDoc}
72
     */
73
    public function retrieve()
74
    {
75
        $response = $this->executeWithState($this->api->getSecurityGroup());
76
        $this->populateFromResponse($response);
77
    }
78
79
    public function update()
80
    {
81
        $response = $this->executeWithState($this->api->putSecurityGroups());
82
        $this->populateFromResponse($response);
83
    }
84
}
85