| @@ 16-69 (lines=54) @@ | ||
| 13 | * |
|
| 14 | * @version 1 |
|
| 15 | */ |
|
| 16 | class Members extends Api |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * List members (permission needed: #organization:read) |
|
| 20 | * List all members of a organization |
|
| 21 | * |
|
| 22 | * @param string $organization_identifier |
|
| 23 | */ |
|
| 24 | public function members($organization_identifier) |
|
| 25 | { |
|
| 26 | return $this->get('/organizations/'.$organization_identifier.'/members'); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Member details (permission needed: #organization:read) |
|
| 31 | * Get information about a specific member of an organization |
|
| 32 | * |
|
| 33 | * @param string $organization_identifier |
|
| 34 | * @param string $identifier |
|
| 35 | */ |
|
| 36 | public function details($organization_identifier, $identifier) |
|
| 37 | { |
|
| 38 | return $this->get('/organizations/'.$organization_identifier.'/members/'.$identifier); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Update member roles (permission needed: #organization:edit) |
|
| 43 | * Change the Roles of an Organization's Member |
|
| 44 | * |
|
| 45 | * @param string $organization_identifier |
|
| 46 | * @param string $identifier |
|
| 47 | * @param array|null $roles Array of Roles associated with this Member |
|
| 48 | */ |
|
| 49 | public function update($organization_identifier, $identifier, array $roles = null) |
|
| 50 | { |
|
| 51 | $data = [ |
|
| 52 | 'roles' => $roles, |
|
| 53 | ]; |
|
| 54 | ||
| 55 | return $this->patch('/organizations/'.$organization_identifier.'/members/'.$identifier, $data); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * Remove member (permission needed: #organization:edit) |
|
| 60 | * Remove a member from an organization |
|
| 61 | * |
|
| 62 | * @param string $organization_identifier |
|
| 63 | * @param string $identifier |
|
| 64 | */ |
|
| 65 | public function delete_member($organization_identifier, $identifier) |
|
| 66 | { |
|
| 67 | return $this->delete('/organizations/'.$organization_identifier.'/members/'.$identifier); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| @@ 16-69 (lines=54) @@ | ||
| 13 | * |
|
| 14 | * @version 1 |
|
| 15 | */ |
|
| 16 | class Railgun extends Api |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * Get available Railguns (permission needed: #zone_settings:read) |
|
| 20 | * A list of available Railguns the zone can use |
|
| 21 | * |
|
| 22 | * @param string $zone_identifier API item identifier tag |
|
| 23 | */ |
|
| 24 | public function railguns($zone_identifier) |
|
| 25 | { |
|
| 26 | return $this->get('zones/'.$zone_identifier.'/railguns'); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Get Railgun details (permission needed: #zone_settings:read) |
|
| 31 | * Details about a specific Railgun |
|
| 32 | * |
|
| 33 | * @param string $zone_identifier API item identifier tag |
|
| 34 | * @param string $identifier |
|
| 35 | */ |
|
| 36 | public function details($zone_identifier, $identifier) |
|
| 37 | { |
|
| 38 | return $this->get('zones/'.$zone_identifier.'/railguns/'.$identifier); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Test Railgun connection (permission needed: #zone_settings:read) |
|
| 43 | * Test Railgun connection to the Zone |
|
| 44 | * |
|
| 45 | * @param string $zone_identifier API item identifier tag |
|
| 46 | * @param string $identifier |
|
| 47 | */ |
|
| 48 | public function diagnose($zone_identifier, $identifier) |
|
| 49 | { |
|
| 50 | return $this->get('zones/'.$zone_identifier.'/railguns/'.$identifier.'/diagnose'); |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * Connect or disconnect a Railgun (permission needed: #zone_settings:edit) |
|
| 55 | * Connect or disconnect a Railgun |
|
| 56 | * |
|
| 57 | * @param string $zone_identifier |
|
| 58 | * @param string $identifier API item identifier tag |
|
| 59 | * @param bool $connected A flag indicating whether the given zone is connected to the Railgun [valid values: (true,false)] |
|
| 60 | */ |
|
| 61 | public function connected($zone_identifier, $identifier, $connected) |
|
| 62 | { |
|
| 63 | $data = [ |
|
| 64 | 'connected' => $connected, |
|
| 65 | ]; |
|
| 66 | ||
| 67 | return $this->get('zones/'.$zone_identifier.'/railguns/'.$identifier, $data); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||