public function __construct(array $options = [], Client $httpClient = null)
{
$this->errorListener = new ErrorListener();
$this->httpClient = $httpClient ?: new Client($options);
$this->httpClient->addListener($this->errorListener);
$this->resultPagerListener = new ResultPagerListener($this->httpClient);
$this->httpClient->addListener($this->resultPagerListener);
$this->options = $options;
}