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\Account\Repository; |
13
|
|
|
|
14
|
|
|
use Linode\Account\BetaProgramEnrolled; |
15
|
|
|
use Linode\Account\BetaProgramEnrolledRepositoryInterface; |
16
|
|
|
use Linode\Entity; |
17
|
|
|
use Linode\Internal\AbstractRepository; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @codeCoverageIgnore This class was autogenerated. |
21
|
|
|
*/ |
22
|
|
|
class BetaProgramEnrolledRepository extends AbstractRepository implements BetaProgramEnrolledRepositoryInterface |
23
|
|
|
{ |
24
|
|
|
public function enrollBetaProgram(array $parameters = []): void |
25
|
|
|
{ |
26
|
|
|
$this->client->post($this->getBaseUri(), $parameters); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
protected function getBaseUri(): string |
30
|
|
|
{ |
31
|
|
|
return '/account/betas'; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
protected function getSupportedFields(): array |
35
|
|
|
{ |
36
|
|
|
return [ |
37
|
|
|
BetaProgramEnrolled::FIELD_ID, |
38
|
|
|
BetaProgramEnrolled::FIELD_LABEL, |
39
|
|
|
BetaProgramEnrolled::FIELD_DESCRIPTION, |
40
|
|
|
BetaProgramEnrolled::FIELD_STARTED, |
41
|
|
|
BetaProgramEnrolled::FIELD_ENDED, |
42
|
|
|
BetaProgramEnrolled::FIELD_ENROLLED, |
43
|
|
|
]; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
protected function jsonToEntity(array $json): Entity |
47
|
|
|
{ |
48
|
|
|
return new BetaProgramEnrolled($this->client, $json); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|