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
Push — master ( 06de12...30eaeb )
by Jamie
05:16
created

Endpoint::retrieve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Identity\v3\Models;
4
5
use OpenStack\Common\Resource\OperatorResource;
6
use OpenStack\Common\Resource\Creatable;
7
use OpenStack\Common\Resource\Deletable;
8
use OpenStack\Common\Resource\Updateable;
9
use OpenStack\Common\Resource\Retrievable;
10
11
/**
12
 * @property \OpenStack\Identity\v3\Api $api
13
 */
14
class Endpoint extends OperatorResource implements Creatable, Updateable, Deletable, Retrievable
15
{
16
    /** @var string */
17
    public $id;
18
19
    /** @var string */
20
    public $interface;
21
22
    /** @var string */
23
    public $name;
24
25
    /** @var string */
26
    public $serviceId;
27
28
    /** @var string */
29
    public $region;
30
31
    /** @var array */
32
    public $links;
33
34
    /** @var string */
35
    public $url;
36
37
    protected $resourceKey = 'endpoint';
38
    protected $resourcesKey = 'endpoints';
39
    protected $aliases = ['service_id' => 'serviceId'];
40
41
    /**
42
     * {@inheritDoc}
43
     *
44
     * @param array $data {@see \OpenStack\Identity\v3\Api::postEndpoints}
45 2
     */
46
    public function create(array $data): Creatable
47 2
    {
48 2
        $response = $this->execute($this->api->postEndpoints(), $data);
49
        return $this->populateFromResponse($response);
50
    }
51
52
    /**
53
     * {@inheritDoc}
54 1
     */
55
    public function retrieve()
56 1
    {
57 1
        $response = $this->executeWithState($this->api->getEndpoint());
58
        $this->populateFromResponse($response);
59
    }
60
61
    /**
62
     * {@inheritDoc}
63 1
     */
64
    public function update()
65 1
    {
66 1
        $response = $this->executeWithState($this->api->patchEndpoint());
67
        $this->populateFromResponse($response);
68 2
    }
69
70 2
    /**
71
     * {@inheritDoc}
72
     */
73 2
    public function delete()
74
    {
75 2
        $this->execute($this->api->deleteEndpoint(), $this->getAttrs(['id']));
76
    }
77
78
    public function regionMatches(string $value): bool
79
    {
80
        return $this->region && $this->region == $value;
81
    }
82
83
    public function interfaceMatches(string $value): bool
84
    {
85
        return $this->interface && $this->interface == $value;
86
    }
87
}
88