Skip to content

Commit f88429d

Browse files
author
John Chavez
committed
DX-1163 Added the Emergency Notification methods
1 parent f767994 commit f88429d

File tree

6 files changed

+1086
-1
lines changed

6 files changed

+1086
-1
lines changed

README.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,3 +925,194 @@ catch (e) {
925925
// }
926926
}
927927
```
928+
929+
## Emergency Notification
930+
931+
### List Recipients
932+
933+
```js
934+
try {
935+
const response = await EmergencyNotification.listRecipients(client, {"Size": "20"} );
936+
console.log(response.emergencyNotificationRecipients.emergencyNotificationRecipient.length);
937+
//4
938+
}
939+
catch (e) {
940+
console.log(e);
941+
}
942+
```
943+
### Get Recipient
944+
945+
```js
946+
try {
947+
const response = await EmergencyNotification.getRecipient(client, "enrid" );
948+
console.log(response.emergencyNotificationRecipient.identifier);
949+
//63865500-0904-46b1-9b4f-7bd237a26363
950+
}
951+
catch (e) {
952+
console.log(e);
953+
}
954+
```
955+
### Replace Recipient
956+
957+
```js
958+
var en = new EmergencyNotification();
959+
en.enrid = 123;
960+
961+
try {
962+
const response = await en.replaceRecipient(client, recipient);
963+
console.log(response.emergencyNotificationRecipient.identifier);
964+
//63865500-0904-46b1-9b4f-7bd237a26363
965+
}
966+
catch (e) {
967+
console.log(e);
968+
}
969+
```
970+
### Create Recipient
971+
972+
```js
973+
try {
974+
const response = await EmergencyNotification.createRecipient(client, recipient);
975+
console.log(response.emergencyNotificationRecipient.identifier);
976+
//63865500-0904-46b1-9b4f-7bd237a26363
977+
}
978+
catch (e) {
979+
console.log(e);
980+
}
981+
```
982+
### Delete Recipient
983+
984+
```js
985+
var en = new EmergencyNotification();
986+
en.enrid = 123;
987+
988+
try {
989+
const response = await en.deleteRecipient(client);
990+
}
991+
catch (e) {
992+
console.log(e);
993+
}
994+
```
995+
### List Group Orders
996+
997+
```js
998+
try {
999+
const response = await EmergencyNotification.listGroupOrders(helper.createClient(), {Size: "20"});
1000+
console.log(response.emergencyNotificationGroupOrders.emergencyNotificationGroupOrder.length);
1001+
//20
1002+
}
1003+
catch (e) {
1004+
console.log(e);
1005+
}
1006+
```
1007+
### Get Group Order
1008+
1009+
```js
1010+
try {
1011+
const response = await EmergencyNotification.getGroupOrder(helper.createClient(), "orderId");
1012+
console.log(response.emergencyNotificationGroup.orderId);
1013+
//orderId
1014+
}
1015+
catch (e) {
1016+
console.log(e);
1017+
}
1018+
```
1019+
### Create Group Order
1020+
1021+
```js
1022+
try {
1023+
const response = EmergencyNotification.createGroupOrder(helper.createClient(), groupOrder);
1024+
console.log(response.OrderId);
1025+
//900b3646-18df-4626-b237-3a8de648ebf6
1026+
}
1027+
catch (e) {
1028+
console.log(e);
1029+
}
1030+
```
1031+
### List Group
1032+
1033+
```js
1034+
try {
1035+
const response = await EmergencyNotification.listGroups(client, {"Size": "20"} );
1036+
console.log(response.emergencyNotificationGroups.emergencyNotificationGroup.length);
1037+
//20
1038+
}
1039+
catch (e) {
1040+
console.log(e);
1041+
}
1042+
```
1043+
### Get Group
1044+
1045+
```js
1046+
try {
1047+
const response = await EmergencyNotification.getGroup(client, "engid");
1048+
console.log(response.emergencyNotificationGroup.identifier);
1049+
//63865500-0904-46b1-9b4f-7bd237a26363
1050+
}
1051+
catch (e) {
1052+
console.log(e);
1053+
}
1054+
```
1055+
### List Endpoint Orders
1056+
1057+
```js
1058+
try {
1059+
const response = await EmergencyNotification.listEnpointOrders(client, {"Size": "20"} );
1060+
console.log(response.emergencyNotificationEndpointOrders.emergencyNotificationEndpointOrder.length);
1061+
//20
1062+
}
1063+
catch (e) {
1064+
console.log(e);
1065+
}
1066+
```
1067+
### Get Endpoint Order
1068+
1069+
```js
1070+
try {
1071+
const response = await EmergencyNotification.getEndpointOrder(client, "orderId" );
1072+
console.log(response.emergencyNotificationEndpointOrder.orderId);
1073+
//orderId
1074+
}
1075+
catch (e) {
1076+
console.log(e);
1077+
}
1078+
```
1079+
### Create Endpoint Orders
1080+
1081+
```js
1082+
try {
1083+
const response = await EmergencyNotification.createEndpointOrder(client, endpoint );
1084+
console.log(response.emergencyNotificationEndpointOrder.orderId);
1085+
//3e9a852e-2d1d-4e2d-84c3-87223a78cb70
1086+
}
1087+
catch (e) {
1088+
console.log(e);
1089+
}
1090+
```
1091+
1092+
## Aeuis
1093+
1094+
### List Aeuis's
1095+
1096+
```js
1097+
try {
1098+
const response = await Aeuis.list(client, {Size: 20} );
1099+
console.log(response.AlternateEndUserIdentifiers.AlternateEndUserIdentifier.length);
1100+
//20
1101+
}
1102+
catch (e) {
1103+
console.log(e);
1104+
}
1105+
```
1106+
1107+
### Get Aeuis's
1108+
1109+
```js
1110+
try {
1111+
const response = await Aeuis.get(client, "acid" );
1112+
console.log(response.AlternateEndUserIdentifier.Identifier);
1113+
//acid
1114+
}
1115+
catch (e) {
1116+
console.log(e);
1117+
}
1118+
```

lib/aeuis.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
var Client = require("./client");
2+
var AEUIS_PATH = "aeuis";
3+
4+
function Aeuis(){
5+
}
6+
7+
Aeuis.list = function(client, query, callback){
8+
if(arguments.length === 2){
9+
callback = query;
10+
query = client;
11+
client = new Client();
12+
}
13+
client.makeRequest("get", client.concatAccountPath(AEUIS_PATH), query, function(err, res){
14+
if(err){
15+
return callback(err);
16+
}
17+
res.client = client;
18+
res.__proto__ = Aeuis.prototype;
19+
callback(null, res);
20+
});
21+
};
22+
23+
Aeuis.get = function(client, acid, callback){
24+
if(arguments.length === 2){
25+
callback = acid;
26+
acid = client;
27+
client = new Client();
28+
}
29+
client.makeRequest("get", client.concatAccountPath(AEUIS_PATH) + `/${acid}`, function(err, res){
30+
if(err){
31+
return callback(err);
32+
}
33+
res.client = client;
34+
res.__proto__ = Aeuis.prototype;
35+
callback(null, res);
36+
});
37+
};
38+
39+
module.exports = Aeuis;

0 commit comments

Comments
 (0)