| Total Complexity | 4 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class SshKeys extends CloudApiBase implements CloudApiInterface |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Returns a list of SSL keys. |
||
| 19 | * |
||
| 20 | * @return SshKeysResponse<SshKeyResponse> |
||
| 21 | */ |
||
| 22 | public function getAll(): SshKeysResponse |
||
| 23 | { |
||
| 24 | return new SshKeysResponse( |
||
| 25 | $this->client->request( |
||
|
|
|||
| 26 | 'get', |
||
| 27 | "/account/ssh-keys" |
||
| 28 | ) |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Returns a specific key by key ID. |
||
| 34 | * |
||
| 35 | * @param string $keyId |
||
| 36 | * @return SshKeyResponse |
||
| 37 | */ |
||
| 38 | public function get($keyId): SshKeyResponse |
||
| 39 | { |
||
| 40 | return new SshKeyResponse( |
||
| 41 | $this->client->request( |
||
| 42 | 'get', |
||
| 43 | "/account/ssh-keys/${keyId}" |
||
| 44 | ) |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Create an SSH key. |
||
| 50 | * |
||
| 51 | * @param string $label |
||
| 52 | * @param string $public_key |
||
| 53 | * @return OperationResponse |
||
| 54 | */ |
||
| 55 | public function create($label, $public_key): OperationResponse |
||
| 67 | ); |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Delete a specific key by ID. |
||
| 72 | * |
||
| 73 | * @param string $keyId |
||
| 74 | * @return OperationResponse |
||
| 75 | */ |
||
| 76 | public function delete($keyId): OperationResponse |
||
| 80 | ); |
||
| 81 | } |
||
| 82 | } |
||
| 83 |