private function setAuth(&$ch)
    {
        if ($this->apiUsername !== null && $this->apiPassword !== null) {
            curl_setopt($ch, CURLAUTH_BASIC, CURLAUTH_DIGEST);
            curl_setopt(
                $ch,
                CURLOPT_USERPWD,
                $this->apiUsername . ':' . $this->apiPassword
            );
        }
    }