client->request(self::BASE_URI . '/' .$username . '/tokens'); return \GuzzleHttp\json_decode($response->getBody(), true); } /** * @param string $username * @param string $name * @return array */ public function addToken(string $username, string $name): array { $options['json'] = [ 'name' => $name ]; $response = $this->client->request(self::BASE_URI . '/' .$username . '/tokens', 'POST', $options); return \GuzzleHttp\json_decode($response->getBody(), true); } /** * @param string $username * @param int $token * @return bool */ public function deleteToken(string $username, int $token): bool { $this->client->request(self::BASE_URI . '/' .$username . '/tokens/' . $token, 'DELETE'); return true; } }