Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,8 @@ $account->getImportTnOrder("some_id_value");
```PHP
$account->getImportTnOrderHistory("some_id_value");
```

### Check TNs Portability
```PHP
$account->checkTnsPortability(array("+15554443333", "+15553334444"));
```
14 changes: 14 additions & 0 deletions src/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,21 @@ public function get_rest_client() {
public function getImportTnOrders($filters = array()) {
$url = sprintf('%s/%s', $this->account_id, 'importTnOrders');
$response = parent::_get($url, $filters);
//TODO: Confirm the actual response object
return new ImportTnOrderResponse($response);
}

public function createImportTnOrder(ImportTnOrder $order) {
$url = sprintf('%s/%s', $this->account_id, 'importTnOrders');
$data = parent::post($url, 'ImportTnOrder', $order->to_array());
//TODO: Confirm the actual response object
return new ImportTnOrderResponse($data);
}

public function getImportTnOrder($id) {
$url = sprintf('%s/%s/%s', $this->account_id, 'importTnOrders', $id);
$response = parent::_get($url);
//TODO: Confirm the actual response object
return new ImportTnOrderResponse($response);
}

Expand All @@ -275,4 +278,15 @@ public function getImportTnOrderHistory($id) {
//TODO: Figure out the actual response object
return $response;
}

public function checkTnsPortability($tns) {
$url = sprintf('%s/%s', $this->account_id, 'importTnChecker');
$payload = new ImportTnCheckerPayload(array(
"TelephoneNumbers" => array(
"TelephoneNumber" => $tns
)));
$data = parent::post($url, 'ImportTnCheckerPayload', $payload->to_array());
//TODO: Confirm the actual response object
return new ImportTnCheckerResponse($data);
}
}
16 changes: 16 additions & 0 deletions src/simpleModels/ImportTnCheckerPayload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Iris;

class ImportTnCheckerPayload {
use BaseModel;

protected $fields = array(
"TelephoneNumbers" => array("type" => "\Iris\Phones"),
"ImportTnErrors" => array("type" => "\Iris\ImportTnError")
);

public function __construct($data) {
$this->set_data($data);
}
}
16 changes: 16 additions & 0 deletions src/simpleModels/ImportTnCheckerResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Iris;

class ImportTnCheckerResponse {
use BaseModel;

protected $fields = array(
"ImportTnCheckerPayload" => array("type" => "\Iris\ImportTnCheckerPayload"),
"Errors" => array("type" => "\Iris\Error")
);

public function __construct($data) {
$this->set_data($data);
}
}
17 changes: 17 additions & 0 deletions src/simpleModels/ImportTnError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Iris;

class ImportTnError {
use BaseModel;

protected $fields = array(
"TelephoneNumbers" => array("type" => "\Iris\Phones"),
"Code" => array("type" => "string"),
"Description" => array("type" => "string")
);

public function __construct($data) {
$this->set_data($data);
}
}