Total Complexity | 3 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class Role implements CloudApi |
||
16 | { |
||
17 | |||
18 | /** @var ClientInterface The API client. */ |
||
19 | protected $client; |
||
20 | |||
21 | /** |
||
22 | * Client constructor. |
||
23 | * |
||
24 | * @param ClientInterface $client |
||
25 | */ |
||
26 | public function __construct(ClientInterface $client) |
||
27 | { |
||
28 | $this->client = $client; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Update the permissions associated with a role. |
||
33 | * |
||
34 | * @param string $roleUuid |
||
35 | * @param array $permissions |
||
36 | * @return OperationResponse |
||
37 | */ |
||
38 | public function updateRole($roleUuid, array $permissions) |
||
39 | { |
||
40 | $options = [ |
||
41 | 'form_params' => [ |
||
42 | 'permissions' => $permissions, |
||
43 | ], |
||
44 | ]; |
||
45 | |||
46 | return new OperationResponse( |
||
47 | $this->client->request('put', "/roles/${roleUuid}", $options) |
||
|
|||
48 | ); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Delete a role. |
||
53 | * |
||
54 | * @param string $roleUuid |
||
55 | * @return OperationResponse |
||
56 | */ |
||
57 | public function deleteRole($roleUuid) |
||
60 | } |
||
61 | } |
||
62 |