/**
  * @return mixed
  * @throws \SMSApi\Exception\ClientException
  * @throws \SMSApi\Exception\ActionException
  * @throws \SMSApi\Exception\HostException
  */
 public function execute()
 {
     try {
         $this->setJson(true);
         $data = $this->proxy->execute($this);
         $this->handleError($data, $this->isContacts);
         if ($this->getMethod() === self::METHOD_HEAD and $data['size']) {
             return $this->response(json_encode(array('size' => $data['size'])));
         } else {
             return $this->response($data['output']);
         }
     } catch (Exception $ex) {
         throw new ActionException($ex->getMessage(), $ex->getCode(), $ex);
     }
 }
 public function __construct(Client $client, Proxy $proxy)
 {
     parent::__construct();
     $this->client($client)->proxy($proxy->setBasicAuthentication($client));
 }