1 | <?php declare(strict_types=1); |
||
15 | class Token extends OperatorResource implements Creatable, Retrievable, \OpenStack\Common\Auth\Token |
||
16 | { |
||
17 | /** @var array */ |
||
18 | public $methods; |
||
19 | |||
20 | /** @var Role[] */ |
||
21 | public $roles; |
||
22 | |||
23 | /** @var \DateTimeImmutable */ |
||
24 | public $expires; |
||
25 | |||
26 | /** @var Project */ |
||
27 | public $project; |
||
28 | |||
29 | /** @var Catalog */ |
||
30 | public $catalog; |
||
31 | |||
32 | /** @var mixed */ |
||
33 | public $extras; |
||
34 | |||
35 | /** @var User */ |
||
36 | public $user; |
||
37 | |||
38 | /** @var \DateTimeImmutable */ |
||
39 | public $issued; |
||
40 | |||
41 | /** @var string */ |
||
42 | public $id; |
||
43 | |||
44 | protected $resourceKey = 'token'; |
||
45 | protected $resourcesKey = 'tokens'; |
||
46 | |||
47 | protected $cachedToken; |
||
48 | |||
49 | /** |
||
50 | * @inheritdoc |
||
51 | */ |
||
52 | protected function getAliases(): array |
||
63 | |||
64 | /** |
||
65 | 1 | * {@inheritDoc} |
|
66 | */ |
||
67 | 1 | public function populateFromResponse(ResponseInterface $response) |
|
73 | 1 | ||
74 | /** |
||
75 | 1 | * @return string |
|
76 | */ |
||
77 | public function getId(): string |
||
81 | 1 | ||
82 | /** |
||
83 | 1 | * @return bool TRUE if the token has expired (and is invalid); FALSE otherwise. |
|
84 | */ |
||
85 | 1 | public function hasExpired(): bool |
|
89 | |||
90 | /** |
||
91 | * {@inheritDoc} |
||
92 | */ |
||
93 | 10 | public function retrieve() |
|
98 | 1 | ||
99 | /** |
||
100 | * {@inheritDoc} |
||
101 | 1 | * |
|
102 | 1 | * @param array $data {@see \OpenStack\Identity\v3\Api::postTokens} |
|
103 | */ |
||
104 | 9 | public function create(array $data): Creatable |
|
131 | |||
132 | /** |
||
133 | * Returns a serialized representation of an authentication token. |
||
134 | * |
||
135 | * Initialize OpenStack object using $params['cachedToken'] to reduce the amount of HTTP calls. |
||
136 | * |
||
137 | * This array is a modified version of response from `/auth/tokens`. Do not manually modify this array. |
||
138 | * |
||
139 | * @return array |
||
140 | */ |
||
141 | public function export(): array |
||
145 | } |
||
146 |