public function getGroupById($id)
{
if (!$this->connected) {
return Promise\reject(new ConnectionException('Client not connected. Did you forget to call `connect()`?'));
}
if (!isset($this->groups[$id])) {
return Promise\reject(new ApiException("No group exists for ID '{$id}'."));
}
return Promise\resolve($this->groups[$id]);
}