/**
  * @param array $options
  * @return Model\SentMessagesPage
  */
 public function loadMessages(array $options)
 {
     $uri = Http\UriBuilder::serviceUri(self::SENT_MESSAGES_SERVICE_VERSION, self::SENT_MESSAGES_SERVICE, null, $this->httpClient->isSecure());
     $options['accountreference'] = $this->authentication->accountReference();
     $uri .= "?" . Http\UriBuilder::buildQuery($options);
     $data = $this->httpClient->get($uri, $this->authentication);
     return $this->parser->parse($data);
 }
Esempio n. 2
0
 /**
  * @param int $startIndex
  * @param int $count
  * @return Model\InboxPage
  */
 public function latest($startIndex = null, $count = null)
 {
     $uri = Http\UriBuilder::serviceUri(self::INBOX_SERVICE_VERSION, self::INBOX_SERVICE, array($this->authentication->accountReference(), "messages"), $this->httpClient->isSecure());
     $query = array();
     if ($startIndex != null && is_int($startIndex)) {
         $query["startIndex"] = $startIndex;
     }
     if ($count != null && is_int($count)) {
         $query["count"] = $count;
     }
     if (count($query) > 0) {
         $uri .= "?" . Http\UriBuilder::buildQuery($query);
     }
     $data = $this->httpClient->get($uri, $this->authentication);
     return $this->parser->parse($data);
 }