/**
*
* Get User Info
*
* @param string|API\Response\Model\User $userId User or User Id to get Info of
* @return API\Response\InfoUserResponse
* @throws Exception
*/
public function getUserInfo($userId)
{
if (!$this->isLoggedIn()) {
throw new InstagramException("You must be logged in to call getUserInfo().");
}
if ($userId instanceof User) {
$userId = $userId->getPk();
}
$request = new InfoUserRequest($this, $userId);
$response = $request->execute();
if (!$response->isOk()) {
throw new InstagramException(sprintf("Failed to getUserInfo: [%s] %s", $response->getStatus(), $response->getMessage()));
}
return $response;
}