Skip to content

Commit ffa1a02

Browse files
authored
Dx 1165 (#60)
* Added readme template and updated composer * Added code * cleaned up spaces * Added test skeleton * Added xml responses * Added tests with no asserts * Added assert tests and fixed responses * Added most models * fixed some tests * Reverted to array usage * Added readme code * removed old model files
1 parent ac7170b commit ffa1a02

File tree

4 files changed

+343
-193
lines changed

4 files changed

+343
-193
lines changed

README.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PHP Client library for Bandwidth's Phone Number Dashboard (AKA: Dashboard, Iris)
1818
| 2.1.0 | Added `importTnOrders`, `removeImportedTnOrders`, `inserviceNumbers`, and `importTnChecker` endpoints |
1919
| 2.2.0 | Added `csrs` endpoints |
2020
| 2.3.0 | Added `loas` endpoints for ImportTnOrders |
21+
| 2.4.0 | Added Emergency Calling Notification, Emergeny Notification Group, Emergency Notification Endpoint, and Alternate End User Identity methods |
2122

2223
## Supported PHP Versions
2324

@@ -827,3 +828,127 @@ $note = new \Iris\CsrNote(array(
827828

828829
$account->updateCsrOrderNote("order_id", "note_id", $note);
829830
```
831+
832+
## Emergency Notification Recipients
833+
834+
### Create Emergency Notification Recipient
835+
836+
```php
837+
$data = array(
838+
"Description" => "Email to Bldg. 3 Front Desk",
839+
"Type" => "EMAIL",
840+
"EmailAddress" => "[email protected]"
841+
);
842+
$response = $account->createEmergencyNotificationRecipient($data);
843+
```
844+
845+
### Get Emergency Notification Recipients
846+
847+
```php
848+
$response = $account->getEmergencyNotificationRecipients();
849+
```
850+
851+
### Get Emergency Notification Recipient
852+
853+
```php
854+
$response = $account->getEmergencyNotificationRecipient("id");
855+
```
856+
857+
### Replace Emergency Notification Recipient
858+
859+
```php
860+
$data = array(
861+
"Description" => "Email to Bldg. 3 Front Desk",
862+
"Type" => "EMAIL",
863+
"EmailAddress" => "[email protected]"
864+
);
865+
$response = $account->replaceEmergencyNotificationRecipient("id", $data);
866+
```
867+
868+
### Delete Emergency Notification Recipient
869+
870+
```php
871+
$account->deleteEmergencyNotificationRecipient("id");
872+
```
873+
874+
## Emergeny Notification Group
875+
876+
### Create Emergency Notification Group Order
877+
878+
```php
879+
$data = array(
880+
"CustomerOrderId" => "value",
881+
"AddedEmergenyNotificationGroup" => array(
882+
"EmergencyNotificationRecipient" => array(
883+
"Identifier" => "123"
884+
)
885+
)
886+
);
887+
$response = $account->createEmergencyNotificationGroupOrder($data);
888+
```
889+
890+
### Get Emergency Notification Group Orders
891+
892+
```php
893+
$response = $account->getEmergencyNotificationGroupOrders();
894+
```
895+
896+
### Get Emergency Notification Group Order
897+
898+
```php
899+
$response = $account->getEmergencyNotificationGroupOrder("id");
900+
```
901+
902+
### Get Emergency Notification Groups
903+
904+
```php
905+
$response = $account->getEmergencyNotificationGroups();
906+
```
907+
908+
### Get Emergency Notification Group
909+
910+
```php
911+
$response = $account->getEmergencyNotificationGroup("id");
912+
```
913+
914+
## Emergency Notification Endpoint
915+
916+
### Create Emergency Notification Endpoint Order
917+
918+
```php
919+
$data = array(
920+
"CustomerOrderId" => "123",
921+
"EmergencyNotificationEndpointAssociations" => array(
922+
"EmergenyNotificationGroup" => array(
923+
"Identifier" => "456"
924+
)
925+
)
926+
);
927+
$response = $account->createEmergencyNotificationEndpointOrder($data);
928+
```
929+
930+
### Get Emergency Notification Endpoint Orders
931+
932+
```php
933+
$response = $account->getEmergencyNotificationEndpointOrders();
934+
```
935+
936+
### Get Emergency Notification Endpoint Order
937+
938+
```php
939+
$response = $account->getEmergencyNotificationEndpointOrder("id");
940+
```
941+
942+
## Alternate End User Identiy
943+
944+
### Get Alternate End User Information
945+
946+
```php
947+
$response = $account->getAlternateEndUserInformation();
948+
```
949+
950+
### Get Alternate Caller Information
951+
952+
```php
953+
$response = $account->getAlternateCallerInformation("id");
954+
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Bandwidth's Iris SDK for PHP",
55
"keywords": ["iris","sdk","php"],
66
"homepage": "http://dev.bandwidth.com",
7-
"reference": "v2.3.0",
7+
"reference": "v2.4.0",
88
"license": "MIT",
99
"authors": [
1010
],

src/Account.php

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,93 @@ public function updateCsrOrderNote($orderId, $noteId, CsrNote $note) {
400400
$data = parent::put($url, 'Note', $note->to_array());
401401
return $data;
402402
}
403+
404+
public function getAlternateEndUserInformation($filters = array()) {
405+
$url = sprintf('%s/%s', $this->account_id, 'aeuis');
406+
$data = parent::_get($url, $filters);
407+
return $data;
408+
}
409+
410+
public function getAlternateCallerInformation($acid) {
411+
$url = sprintf('%s/%s/%s', $this->account_id, 'aeuis', $acid);
412+
$data = parent::_get($url);
413+
return $data['AlternateEndUserIdentifier'];
414+
}
415+
416+
public function createEmergencyNotificationEndpointOrder($order) {
417+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationEndpointOrders');
418+
$data = parent::post($url, 'EmergencyNotificationEndpointOrder', $order);
419+
return $data['EmergencyNotificationEndpointOrder'];
420+
}
421+
422+
public function getEmergencyNotificationEndpointOrders($filters = array()) {
423+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationEndpointOrders');
424+
$data = parent::_get($url, $filters);
425+
return $data;
426+
}
427+
428+
public function getEmergencyNotificationEndpointOrder($id) {
429+
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationEndpointOrders', $id);
430+
$data = parent::_get($url);
431+
return $data['EmergencyNotificationEndpointOrder'];
432+
}
433+
434+
public function createEmergencyNotificationGroupOrder($order) {
435+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationGroupOrders');
436+
$data = parent::post($url, 'EmergencyNotificationGroupOrder', $order);
437+
return $data['EmergencyNotificationGroup'];
438+
}
439+
440+
public function getEmergencyNotificationGroupOrders($filters = array()) {
441+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationGroupOrders');
442+
$data = parent::_get($url, $filters);
443+
return $data;
444+
}
445+
446+
public function getEmergencyNotificationGroupOrder($id) {
447+
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationGroupOrders', $id);
448+
$data = parent::_get($url);
449+
return $data['EmergencyNotificationGroup'];
450+
}
451+
452+
public function getEmergencyNotificationGroups($filters = array()) {
453+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationGroups');
454+
$data = parent::_get($url, $filters);
455+
return $data;
456+
}
457+
458+
public function getEmergencyNotificationGroup($id) {
459+
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationGroups', $id);
460+
$data = parent::_get($url);
461+
return $data['EmergencyNotificationGroup'];
462+
}
463+
464+
public function createEmergencyNotificationRecipient($recipient) {
465+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationRecipients');
466+
$data = parent::post($url, 'EmergencyNotificationRecipient', $recipient);
467+
return $data['EmergencyNotificationRecipient'];
468+
}
469+
470+
public function getEmergencyNotificationRecipients($filters = array()) {
471+
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationRecipients');
472+
$data = parent::_get($url, $filters);
473+
return $data;
474+
}
475+
476+
public function getEmergencyNotificationRecipient($id) {
477+
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationRecipients', $id);
478+
$data = parent::_get($url);
479+
return $data['EmergencyNotificationRecipient'];
480+
}
481+
482+
public function replaceEmergencyNotificationRecipient($id, $recipient) {
483+
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationRecipients', $id);
484+
$data = parent::put($url, 'EmergencyNotificationRecipient', $recipient);
485+
return $data['EmergencyNotificationRecipient'];
486+
}
487+
488+
public function deleteEmergencyNotificationRecipient($id) {
489+
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationRecipients', $id);
490+
parent::_delete($url);
491+
}
403492
}

0 commit comments

Comments
 (0)