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.

Network   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 83
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A retrieve() 0 5 1
A update() 0 5 1
A delete() 0 4 1
A bulkCreate() 0 5 1
A create() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Networking\v2\Models;
4
5
use OpenStack\Common\Resource\OperatorResource;
6
use OpenStack\Common\Resource\HasWaiterTrait;
7
use OpenStack\Common\Resource\Listable;
8
use OpenStack\Common\Resource\Creatable;
9
use OpenStack\Common\Resource\Deletable;
10
use OpenStack\Common\Resource\Retrievable;
11
12
/**
13
 * Represents a Networking v2 Network.
14
 *
15
 * @property \OpenStack\Networking\v2\Api $api
16
 */
17
class Network extends OperatorResource implements Listable, Retrievable, Creatable, Deletable
18
{
19
    use HasWaiterTrait;
20
21
    /** @var string */
22
    public $id;
23
24
    /** @var string */
25
    public $name;
26
27
    /** @var bool */
28
    public $shared;
29
30
    /** @var string */
31
    public $status;
32
33
    /** @var array */
34
    public $subnets;
35
36
    /** @var string */
37
    public $adminStateUp;
38
39
    /** @var string */
40
    public $tenantId;
41
42
    protected $aliases = [
43
        'admin_state_up' => 'adminStateUp',
44
        'tenant_id'      => 'tenantId',
45
    ];
46
47 1
    protected $resourceKey = 'network';
48
    protected $resourcesKey = 'networks';
49 1
50 1
    /**
51 1
     * {@inheritDoc}
52
     */
53
    public function retrieve()
54
    {
55
        $response = $this->execute($this->api->getNetwork(), ['id' => (string)$this->id]);
56
        $this->populateFromResponse($response);
57
    }
58
59
    /**
60 2
     * Creates multiple networks in a single request.
61
     *
62 2
     * @param array $data {@see \OpenStack\Networking\v2\Api::postNetworks}
63 2
     *
64
     * @return Network[]
65
     */
66
    public function bulkCreate(array $data): array
67
    {
68
        $response = $this->execute($this->api->postNetworks(), ['networks' => $data]);
69
        return $this->extractMultipleInstances($response);
70
    }
71 2
72
    /**
73 2
     * {@inheritDoc}
74 2
     *
75
     * @param array $data {@see \OpenStack\Networking\v2\Api::postNetwork}
76
     */
77
    public function create(array $data): Creatable
78
    {
79
        $response = $this->execute($this->api->postNetwork(), $data);
80 1
        return $this->populateFromResponse($response);
81
    }
82 1
83 1
    /**
84
     * {@inheritDoc}
85
     */
86
    public function update()
87
    {
88
        $response = $this->executeWithState($this->api->putNetwork());
89 1
        $this->populateFromResponse($response);
90
    }
91 1
92 1
    /**
93
     * {@inheritDoc}
94
     */
95
    public function delete()
96
    {
97
        $this->executeWithState($this->api->deleteNetwork());
98
    }
99
}
100