Feature: add pause

This commit is contained in:
Kyle Yee
2019-06-06 15:00:57 +08:00
parent 44eb77f9ca
commit b04abe73bc
3 changed files with 46 additions and 0 deletions

View File

@@ -58,6 +58,21 @@ class Zones implements API
return false;
}
public function pause(string $zoneID, bool $paused = true): bool
{
$options = [
'paused' => $paused,
];
$user = $this->adapter->patch('zones/' . $zoneID, $options);
$this->body = json_decode($user->getBody());
if (isset($this->body->result->id)) {
return true;
}
return false;
}
public function listZones(
string $name = '',
string $status = '',