1 | <?php declare(strict_types=1); |
||
18 | class Keypair extends OperatorResource implements Listable, Retrievable, Deletable, Creatable |
||
19 | { |
||
20 | /** @var string */ |
||
21 | public $fingerprint; |
||
22 | |||
23 | /** @var string */ |
||
24 | public $name; |
||
25 | |||
26 | /** @var string */ |
||
27 | public $publicKey; |
||
28 | |||
29 | /** @var string */ |
||
30 | public $privateKey; |
||
31 | |||
32 | /** @var boolean */ |
||
33 | public $deleted; |
||
34 | |||
35 | /** @var string */ |
||
36 | public $userId; |
||
37 | |||
38 | /** @var string */ |
||
39 | public $id; |
||
40 | |||
41 | /** @var \DateTimeImmutable */ |
||
42 | public $createdAt; |
||
43 | |||
44 | protected $aliases = [ |
||
45 | 'public_key' => 'publicKey', |
||
46 | 'private_key' => 'privateKey', |
||
47 | 'user_id' => 'userId', |
||
48 | ]; |
||
49 | |||
50 | protected $resourceKey = 'keypair'; |
||
51 | protected $resourcesKey = 'keypairs'; |
||
52 | |||
53 | /** |
||
54 | * @inheritdoc |
||
55 | */ |
||
56 | protected function getAliases(): array |
||
57 | { |
||
58 | return parent::getAliases() + [ |
||
59 | 'created_at' => new Alias('createdAt', \DateTimeImmutable::class) |
||
60 | ]; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * {@inheritDoc} |
||
65 | */ |
||
66 | public function retrieve() |
||
71 | |||
72 | public function create(array $userOptions): Creatable |
||
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | public function populateFromArray(array $array): self |
||
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | */ |
||
89 | public function delete() |
||
93 | } |
||
94 |