|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
// --------------------------------------------------------------------- |
|
4
|
|
|
// |
|
5
|
|
|
// Copyright (C) 2018-2024 Artem Rodygin |
|
6
|
|
|
// |
|
7
|
|
|
// You should have received a copy of the MIT License along with |
|
8
|
|
|
// this file. If not, see <https://opensource.org/licenses/MIT>. |
|
9
|
|
|
// |
|
10
|
|
|
// --------------------------------------------------------------------- |
|
11
|
|
|
|
|
12
|
|
|
namespace Linode\Profile\Repository; |
|
13
|
|
|
|
|
14
|
|
|
use Linode\Entity; |
|
15
|
|
|
use Linode\Internal\AbstractRepository; |
|
16
|
|
|
use Linode\Profile\AuthorizedApp; |
|
17
|
|
|
use Linode\Profile\AuthorizedAppRepositoryInterface; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @codeCoverageIgnore This class was autogenerated. |
|
21
|
|
|
*/ |
|
22
|
|
|
class AuthorizedAppRepository extends AbstractRepository implements AuthorizedAppRepositoryInterface |
|
23
|
|
|
{ |
|
24
|
|
|
public function deleteProfileApp(int $appId): void |
|
25
|
|
|
{ |
|
26
|
|
|
$this->client->delete(sprintf('%s/%s', $this->getBaseUri(), $appId)); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
protected function getBaseUri(): string |
|
30
|
|
|
{ |
|
31
|
|
|
return '/profile/apps'; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
protected function getSupportedFields(): array |
|
35
|
|
|
{ |
|
36
|
|
|
return [ |
|
37
|
|
|
AuthorizedApp::FIELD_ID, |
|
38
|
|
|
AuthorizedApp::FIELD_LABEL, |
|
39
|
|
|
AuthorizedApp::FIELD_SCOPES, |
|
40
|
|
|
AuthorizedApp::FIELD_WEBSITE, |
|
41
|
|
|
AuthorizedApp::FIELD_CREATED, |
|
42
|
|
|
AuthorizedApp::FIELD_EXPIRY, |
|
43
|
|
|
AuthorizedApp::FIELD_THUMBNAIL_URL, |
|
44
|
|
|
]; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
protected function jsonToEntity(array $json): Entity |
|
48
|
|
|
{ |
|
49
|
|
|
return new AuthorizedApp($this->client, $json); |
|
50
|
|
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|