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