public function getAllGroups ()
    {
        $request = new Request("GET", "https://api.weixin.qq.com/cgi-bin/groups/get");
        $response = $this->client->send($request);
        $json = json_decode($response->getBody());
        $groups = [];

        if (isset($json->groups)) {
            foreach ($json->groups as $group) {
                $groups[] = new Group($group->id, $group->name, $group->count);
            }
        } else {
            throw new Exception("bad response: expected property `groups`");
        }

        return $groups;
    }