public function save()
 {
     $data = parent::post(null, "LidbOrder", $this->to_array());
     if (isset($data["LidbOrder"])) {
         if (isset($data["LidbOrder"]["OrderId"])) {
             $data["LidbOrder"]["orderId"] = $data["LidbOrder"]["OrderId"];
             unset($data["LidbOrder"]["OrderId"]);
         }
         $this->set_data($data["LidbOrder"]);
     } else {
         $this->set_data($data);
     }
 }
 public function getList($filters = array())
 {
     $rcs = [];
     $data = parent::_get('rateCenters', $filters, array(), array("state"));
     if ($data['RateCenters']) {
         $items = $data['RateCenters']['RateCenter'];
         if ($this->is_assoc($items)) {
             $items = [$items];
         }
         foreach ($items as $rc) {
             $rcs[] = new \Iris\CitiesS($rc);
         }
     }
     return $rcs;
 }
 public function getList($filters = array())
 {
     $cities = [];
     $data = parent::_get('cities', $filters, array(), array("state"));
     if ($data['Cities']) {
         $items = $data['Cities']['City'];
         if ($this->is_assoc($items)) {
             $items = [$items];
         }
         foreach ($items as $city) {
             $cities[] = new \Iris\CitiesS($city);
         }
     }
     return $cities;
 }
 public function history()
 {
     $url = sprintf("%s/%s", $this->get_id(), "history");
     $data = parent::_get($url);
     return new History($data);
 }
 public function update()
 {
     parent::put($this->get_id(), "Subscription", $this->to_array());
 }
 public function bdr($id)
 {
     $url = sprintf('%s/%s/%s', $this->account_id, 'bdrs', $id);
     $data = parent::post($url, 'Bdr', $bdr->to_array());
     return new BdrCreationResponse($data);
 }
 public function get()
 {
     if (is_null($this->id)) {
         throw new \Exception('Id should be provided');
     }
     $data = parent::_get($this->id);
     $this->set_data($data['Order']);
 }
 public function totals($filters = array())
 {
     $url = sprintf('%s/%s', $this->get_id(), 'totals');
     $response = parent::_get($url, $filters);
     return $response['Count'];
 }
 public function movetns($data)
 {
     $data = new \Iris\Phones($data);
     $url = sprintf("%s/%s", $this->get_id(), "movetns");
     parent::post($url, "SipPeerTelephoneNumbers", $data);
 }
 public function delete()
 {
     parent::_delete($this->get_id());
 }
 public function save()
 {
     $header = parent::post(null, "Note", $this->to_array());
     $splitted = explode("/", $header['Location']);
     $this->Id = end($splitted);
 }
 public function update()
 {
     $arr = $this->to_array();
     unset($arr['id']);
     unset($arr['orderId']);
     parent::put($this->get_id(), "Order", $arr);
 }
 public function notes()
 {
     $url = sprintf('%s/%s', $this->id, 'notes');
     $data = parent::_get($url);
     return $data;
 }
 /**
  * Make POST request
  */
 public function save()
 {
     $data = parent::post(null, "DisconnectTelephoneNumberOrder", $this->to_array());
     $this->OrderStatus = new OrderRequestStatus($data);
     if (isset($this->OrderStatus->orderRequest)) {
         $this->OrderId = $this->OrderStatus->orderRequest->id;
         $this->set_data($this->OrderStatus->orderRequest->to_array());
     }
 }
 public function totaltns()
 {
     $url = sprintf('%s/%s', $this->get_id(), "totaltns");
     $data = parent::_get($url);
     return $data['SiteTNs']['TotalCount'];
 }
 public function lca()
 {
     $url = sprintf("%s/%s", $this->get_id(), "lca");
     $data = parent::_get($url);
     return new LcaSearch($data);
 }
 public function get()
 {
     $data = parent::_get($this->get_id());
     $data = $data['CoveredRateCenter'];
     $this->set_data($data);
 }
 public function password($password)
 {
     $url = sprintf('%s/%s', $this->get_id(), 'password');
     parent::raw_put($url, "<Password>" . htmlspecialchars($password) . "</Password>", ['Content-Type' => 'application/xml']);
 }