Skip to content

Commit

Permalink
Dx 1165 (Bandwidth#60)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jmulford-bw authored Jun 9, 2020
1 parent ac7170b commit ffa1a02
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 193 deletions.
125 changes: 125 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PHP Client library for Bandwidth's Phone Number Dashboard (AKA: Dashboard, Iris)
| 2.1.0 | Added `importTnOrders`, `removeImportedTnOrders`, `inserviceNumbers`, and `importTnChecker` endpoints |
| 2.2.0 | Added `csrs` endpoints |
| 2.3.0 | Added `loas` endpoints for ImportTnOrders |
| 2.4.0 | Added Emergency Calling Notification, Emergeny Notification Group, Emergency Notification Endpoint, and Alternate End User Identity methods |

## Supported PHP Versions

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

$account->updateCsrOrderNote("order_id", "note_id", $note);
```

## Emergency Notification Recipients

### Create Emergency Notification Recipient

```php
$data = array(
"Description" => "Email to Bldg. 3 Front Desk",
"Type" => "EMAIL",
"EmailAddress" => "[email protected]"
);
$response = $account->createEmergencyNotificationRecipient($data);
```

### Get Emergency Notification Recipients

```php
$response = $account->getEmergencyNotificationRecipients();
```

### Get Emergency Notification Recipient

```php
$response = $account->getEmergencyNotificationRecipient("id");
```

### Replace Emergency Notification Recipient

```php
$data = array(
"Description" => "Email to Bldg. 3 Front Desk",
"Type" => "EMAIL",
"EmailAddress" => "[email protected]"
);
$response = $account->replaceEmergencyNotificationRecipient("id", $data);
```

### Delete Emergency Notification Recipient

```php
$account->deleteEmergencyNotificationRecipient("id");
```

## Emergeny Notification Group

### Create Emergency Notification Group Order

```php
$data = array(
"CustomerOrderId" => "value",
"AddedEmergenyNotificationGroup" => array(
"EmergencyNotificationRecipient" => array(
"Identifier" => "123"
)
)
);
$response = $account->createEmergencyNotificationGroupOrder($data);
```

### Get Emergency Notification Group Orders

```php
$response = $account->getEmergencyNotificationGroupOrders();
```

### Get Emergency Notification Group Order

```php
$response = $account->getEmergencyNotificationGroupOrder("id");
```

### Get Emergency Notification Groups

```php
$response = $account->getEmergencyNotificationGroups();
```

### Get Emergency Notification Group

```php
$response = $account->getEmergencyNotificationGroup("id");
```

## Emergency Notification Endpoint

### Create Emergency Notification Endpoint Order

```php
$data = array(
"CustomerOrderId" => "123",
"EmergencyNotificationEndpointAssociations" => array(
"EmergenyNotificationGroup" => array(
"Identifier" => "456"
)
)
);
$response = $account->createEmergencyNotificationEndpointOrder($data);
```

### Get Emergency Notification Endpoint Orders

```php
$response = $account->getEmergencyNotificationEndpointOrders();
```

### Get Emergency Notification Endpoint Order

```php
$response = $account->getEmergencyNotificationEndpointOrder("id");
```

## Alternate End User Identiy

### Get Alternate End User Information

```php
$response = $account->getAlternateEndUserInformation();
```

### Get Alternate Caller Information

```php
$response = $account->getAlternateCallerInformation("id");
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Bandwidth's Iris SDK for PHP",
"keywords": ["iris","sdk","php"],
"homepage": "http://dev.bandwidth.com",
"reference": "v2.3.0",
"reference": "v2.4.0",
"license": "MIT",
"authors": [
],
Expand Down
89 changes: 89 additions & 0 deletions src/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,93 @@ public function updateCsrOrderNote($orderId, $noteId, CsrNote $note) {
$data = parent::put($url, 'Note', $note->to_array());
return $data;
}

public function getAlternateEndUserInformation($filters = array()) {
$url = sprintf('%s/%s', $this->account_id, 'aeuis');
$data = parent::_get($url, $filters);
return $data;
}

public function getAlternateCallerInformation($acid) {
$url = sprintf('%s/%s/%s', $this->account_id, 'aeuis', $acid);
$data = parent::_get($url);
return $data['AlternateEndUserIdentifier'];
}

public function createEmergencyNotificationEndpointOrder($order) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationEndpointOrders');
$data = parent::post($url, 'EmergencyNotificationEndpointOrder', $order);
return $data['EmergencyNotificationEndpointOrder'];
}

public function getEmergencyNotificationEndpointOrders($filters = array()) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationEndpointOrders');
$data = parent::_get($url, $filters);
return $data;
}

public function getEmergencyNotificationEndpointOrder($id) {
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationEndpointOrders', $id);
$data = parent::_get($url);
return $data['EmergencyNotificationEndpointOrder'];
}

public function createEmergencyNotificationGroupOrder($order) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationGroupOrders');
$data = parent::post($url, 'EmergencyNotificationGroupOrder', $order);
return $data['EmergencyNotificationGroup'];
}

public function getEmergencyNotificationGroupOrders($filters = array()) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationGroupOrders');
$data = parent::_get($url, $filters);
return $data;
}

public function getEmergencyNotificationGroupOrder($id) {
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationGroupOrders', $id);
$data = parent::_get($url);
return $data['EmergencyNotificationGroup'];
}

public function getEmergencyNotificationGroups($filters = array()) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationGroups');
$data = parent::_get($url, $filters);
return $data;
}

public function getEmergencyNotificationGroup($id) {
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationGroups', $id);
$data = parent::_get($url);
return $data['EmergencyNotificationGroup'];
}

public function createEmergencyNotificationRecipient($recipient) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationRecipients');
$data = parent::post($url, 'EmergencyNotificationRecipient', $recipient);
return $data['EmergencyNotificationRecipient'];
}

public function getEmergencyNotificationRecipients($filters = array()) {
$url = sprintf('%s/%s', $this->account_id, 'emergencyNotificationRecipients');
$data = parent::_get($url, $filters);
return $data;
}

public function getEmergencyNotificationRecipient($id) {
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationRecipients', $id);
$data = parent::_get($url);
return $data['EmergencyNotificationRecipient'];
}

public function replaceEmergencyNotificationRecipient($id, $recipient) {
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationRecipients', $id);
$data = parent::put($url, 'EmergencyNotificationRecipient', $recipient);
return $data['EmergencyNotificationRecipient'];
}

public function deleteEmergencyNotificationRecipient($id) {
$url = sprintf('%s/%s/%s', $this->account_id, 'emergencyNotificationRecipients', $id);
parent::_delete($url);
}
}
Loading

0 comments on commit ffa1a02

Please sign in to comment.