@itentialopensource/adapter-amazon_route53 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/adapter.js CHANGED
@@ -11,6 +11,7 @@ const path = require('path');
11
11
  const aws4 = require('aws4');
12
12
  const AWS = require('aws-sdk');
13
13
  const requestCall = require('request');
14
+ const querystring = require('querystring');
14
15
 
15
16
  /* Fetch in the other needed components for the this Adaptor */
16
17
  const AdapterBaseCl = require(path.join(__dirname, 'adapterBase.js'));
@@ -93,7 +94,8 @@ class AmazonRoute53 extends AdapterBaseCl {
93
94
  'iapVerifyAdapterCapability',
94
95
  'iapUpdateAdapterEntityCache',
95
96
  'hasEntities',
96
- 'getAuthorization'
97
+ 'getAuthorization',
98
+ 'getAuthorizationAndIdentifyRequest'
97
99
  ];
98
100
  if (!inIgnore && Array.isArray(inIgnore)) {
99
101
  myIgnore = inIgnore;
@@ -657,17 +659,32 @@ class AmazonRoute53 extends AdapterBaseCl {
657
659
  }
658
660
  });
659
661
 
660
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
662
+ // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
663
+ let thisHeaderData = null;
664
+ // if the additional headers was passed in as a string parse the json into an object
665
+ if (thisHeaderData !== null && thisHeaderData.constructor === String) {
666
+ try {
667
+ // parse the additional headers object that was passed in
668
+ thisHeaderData = JSON.parse(thisHeaderData);
669
+ } catch (err) {
670
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
671
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
672
+ return callback(null, errorObj);
673
+ }
674
+ } else if (thisHeaderData === null) {
675
+ thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
676
+ }
677
+ // add headers if provided
678
+ if (addlHeaders) {
679
+ Object.assign(thisHeaderData, addlHeaders);
680
+ }
681
+
661
682
  const reqObj = {
662
683
  payload: bodyVars,
663
684
  uriPathVars: pathVars,
664
685
  uriQuery: queryParams,
665
- uriOptions: {}
686
+ addlHeaders: thisHeaderData
666
687
  };
667
- // add headers if provided
668
- if (addlHeaders) {
669
- reqObj.addlHeaders = addlHeaders;
670
- }
671
688
 
672
689
  // determine the call and return flag
673
690
  let action = 'getGenerics';
@@ -686,7 +703,7 @@ class AmazonRoute53 extends AdapterBaseCl {
686
703
  try {
687
704
  // Make the call -
688
705
  // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
689
- return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
706
+ return this.getAuthorizationAndIdentifyRequest('.generic', action, reqObj, returnF, `${this.allProps.base_path}/${this.allProps.version}/${uriPath}/?${querystring.stringify(queryParams)}`, null, null, (irReturnData, irReturnError) => {
690
707
  // if we received an error or their is no response on the results
691
708
  // return an error
692
709
  if (irReturnError) {
@@ -767,17 +784,32 @@ class AmazonRoute53 extends AdapterBaseCl {
767
784
  }
768
785
  });
769
786
 
770
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
787
+ // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
788
+ let thisHeaderData = null;
789
+ // if the additional headers was passed in as a string parse the json into an object
790
+ if (thisHeaderData !== null && thisHeaderData.constructor === String) {
791
+ try {
792
+ // parse the additional headers object that was passed in
793
+ thisHeaderData = JSON.parse(thisHeaderData);
794
+ } catch (err) {
795
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
796
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
797
+ return callback(null, errorObj);
798
+ }
799
+ } else if (thisHeaderData === null) {
800
+ thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
801
+ }
802
+ // add headers if provided
803
+ if (addlHeaders) {
804
+ Object.assign(thisHeaderData, addlHeaders);
805
+ }
806
+
771
807
  const reqObj = {
772
808
  payload: bodyVars,
773
809
  uriPathVars: pathVars,
774
810
  uriQuery: queryParams,
775
- uriOptions: {}
811
+ addlHeaders: thisHeaderData
776
812
  };
777
- // add headers if provided
778
- if (addlHeaders) {
779
- reqObj.addlHeaders = addlHeaders;
780
- }
781
813
 
782
814
  // determine the call and return flag
783
815
  let action = 'getGenericsNoBase';
@@ -796,7 +828,7 @@ class AmazonRoute53 extends AdapterBaseCl {
796
828
  try {
797
829
  // Make the call -
798
830
  // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
799
- return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
831
+ return this.getAuthorizationAndIdentifyRequest('.generic', action, reqObj, returnF, `${uriPath}/?${querystring.stringify(queryParams)}`, null, null, (irReturnData, irReturnError) => {
800
832
  // if we received an error or their is no response on the results
801
833
  // return an error
802
834
  if (irReturnError) {
@@ -854,20 +886,23 @@ class AmazonRoute53 extends AdapterBaseCl {
854
886
  *
855
887
  * @return {Object} the headers to add to the request
856
888
  */
857
- getAuthorization(method, uripath, pathBody, STSParams, roleName, callback) {
889
+ getAuthorization(method, uripath, pathBody, requestHeaders, STSParams, roleName, callback) {
858
890
  const origin = `${this.id}-adapter-getAuthorization`;
859
891
  log.trace(origin);
860
892
 
861
893
  // set up the options for the AWS header
862
894
  const options = {
863
895
  host: this.allProps.host,
864
- path: uripath,
896
+ path: uripath.replace(/\/\//g, '/'),
865
897
  service: 'route53',
866
898
  region: this.allProps.region
867
899
  };
900
+ if (requestHeaders) {
901
+ options.headers = requestHeaders;
902
+ }
868
903
 
869
904
  if (method !== 'GET' && method !== 'DELETE') {
870
- options.body = pathBody;
905
+ options.body = JSON.stringify(pathBody);
871
906
  }
872
907
 
873
908
  // if we are using STS
@@ -965,6 +1000,51 @@ class AmazonRoute53 extends AdapterBaseCl {
965
1000
  });
966
1001
  }
967
1002
 
1003
+ /**
1004
+ * @summary wrapper for identifyRequest which sets up the necessary AWS authentication headers first
1005
+ *
1006
+ * @function getAuthorizationAndIdentifyRequest
1007
+ * @param {string} entity - the name of the entity for this request. (required)
1008
+ * @param {string} action - the name of the action being executed. (required)
1009
+ * @param {object} requestObj - an object that contains all of the possible parts of the request (payload, uriPathVars,
1010
+ * uriQuery, uriOptions and addlHeaders (optional). Can be a stringified Object.
1011
+ * @param {boolean} translate - whether to translate the response. Defaults to true. If no translation will just return
1012
+ * 'success' or an error message
1013
+ * @param {string} uriPath - the path for the call. (required)
1014
+ * @param {object} [stsParams] - STS Parameters to use for authentication.
1015
+ * @param {string} [roleName] - RoleName to authenticate against
1016
+ * @param {Callback} callback - a callback function to return the result Data/Status or the Error
1017
+ */
1018
+ getAuthorizationAndIdentifyRequest(entity, action, requestObj, translate, uriPath, stsParams, roleName, callback) {
1019
+ const meth = 'adapter-getAuthorizationAndIdentifyRequest';
1020
+ const origin = `${this.id}-${meth}`;
1021
+ log.trace(origin);
1022
+
1023
+ try {
1024
+ // using this for method now - would like to use for path in the future
1025
+ const entitySchema = this.requestHandlerInst.propUtil.getEntitySchemaFromFS(entity, action);
1026
+ // thisPath = this.requestHandlerInst.restHandler.buildRequestPath(); - Needs to be exposed
1027
+
1028
+ // Call to get the signature for the call
1029
+ return this.getAuthorization(entitySchema.method, uriPath, requestObj.payload, requestObj.addlHeaders, stsParams, roleName, (signature, sigerr) => {
1030
+ if (sigerr) {
1031
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1032
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1033
+ return callback(null, errorObj);
1034
+ }
1035
+ // Assign the signature to the proper headers
1036
+ Object.assign(requestObj.addlHeaders, signature);
1037
+
1038
+ // make the call with the proper information
1039
+ return this.requestHandlerInst.identifyRequest(entity, action, requestObj, translate, callback);
1040
+ });
1041
+ } catch (ex) {
1042
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1043
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1044
+ return callback(null, errorObj);
1045
+ }
1046
+ }
1047
+
968
1048
  /**
969
1049
  * @function activateKeySigningKey
970
1050
  * @pronghornType method
@@ -1057,42 +1137,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1057
1137
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
1058
1138
  }
1059
1139
 
1140
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1141
+ // see adapter code documentation for more information on the request object's fields
1142
+ const reqObj = {
1143
+ payload: bodyVars,
1144
+ uriPathVars: pathVars,
1145
+ uriQuery: queryParams,
1146
+ addlHeaders: thisHeaderData
1147
+ };
1148
+
1060
1149
  try {
1061
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1062
- // see adapter code documentation for more information on the request object's fields
1063
- return this.getAuthorization('POST', `/${restVer}/keysigningkey/${hostedZoneId}/${name}/activate`, bodyVars, stsParams, roleName, (signature, sigerr) => {
1064
- if (sigerr) {
1065
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1150
+ // Make the call -
1151
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1152
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'activateKeySigningKey', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/keysigningkey/${hostedZoneId}/${name}/activate?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1153
+ // if we received an error or their is no response on the results
1154
+ // return an error
1155
+ if (irReturnError) {
1156
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1157
+ return callback(null, irReturnError);
1158
+ }
1159
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1160
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['activateKeySigningKeySTSRole'], null, null, null);
1066
1161
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1067
1162
  return callback(null, errorObj);
1068
1163
  }
1069
- Object.assign(thisHeaderData, signature);
1070
- const reqObj = {
1071
- payload: bodyVars,
1072
- uriPathVars: pathVars,
1073
- uriQuery: queryParams,
1074
- addlHeaders: thisHeaderData
1075
- };
1076
-
1077
- // Make the call -
1078
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1079
- return this.requestHandlerInst.identifyRequest('Rest', 'activateKeySigningKey', reqObj, true, (irReturnData, irReturnError) => {
1080
- // if we received an error or their is no response on the results
1081
- // return an error
1082
- if (irReturnError) {
1083
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1084
- return callback(null, irReturnError);
1085
- }
1086
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1087
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['activateKeySigningKeySTSRole'], null, null, null);
1088
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1089
- return callback(null, errorObj);
1090
- }
1091
1164
 
1092
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1093
- // return the response
1094
- return callback(irReturnData, null);
1095
- });
1165
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1166
+ // return the response
1167
+ return callback(irReturnData, null);
1096
1168
  });
1097
1169
  } catch (ex) {
1098
1170
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -1193,42 +1265,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1193
1265
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
1194
1266
  }
1195
1267
 
1268
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1269
+ // see adapter code documentation for more information on the request object's fields
1270
+ const reqObj = {
1271
+ payload: bodyVars,
1272
+ uriPathVars: pathVars,
1273
+ uriQuery: queryParams,
1274
+ addlHeaders: thisHeaderData
1275
+ };
1276
+
1196
1277
  try {
1197
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1198
- // see adapter code documentation for more information on the request object's fields
1199
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}/associatevpc`, bodyVars, stsParams, roleName, (signature, sigerr) => {
1200
- if (sigerr) {
1201
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1278
+ // Make the call -
1279
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1280
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'associateVPCWithHostedZone', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/associatevpc?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1281
+ // if we received an error or their is no response on the results
1282
+ // return an error
1283
+ if (irReturnError) {
1284
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1285
+ return callback(null, irReturnError);
1286
+ }
1287
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1288
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['associateVPCWithHostedZone'], null, null, null);
1202
1289
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1203
1290
  return callback(null, errorObj);
1204
1291
  }
1205
- Object.assign(thisHeaderData, signature);
1206
- const reqObj = {
1207
- payload: bodyVars,
1208
- uriPathVars: pathVars,
1209
- uriQuery: queryParams,
1210
- addlHeaders: thisHeaderData
1211
- };
1212
-
1213
- // Make the call -
1214
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1215
- return this.requestHandlerInst.identifyRequest('Rest', 'associateVPCWithHostedZone', reqObj, true, (irReturnData, irReturnError) => {
1216
- // if we received an error or their is no response on the results
1217
- // return an error
1218
- if (irReturnError) {
1219
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1220
- return callback(null, irReturnError);
1221
- }
1222
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1223
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['associateVPCWithHostedZone'], null, null, null);
1224
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1225
- return callback(null, errorObj);
1226
- }
1227
1292
 
1228
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1229
- // return the response
1230
- return callback(irReturnData, null);
1231
- });
1293
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1294
+ // return the response
1295
+ return callback(irReturnData, null);
1232
1296
  });
1233
1297
  } catch (ex) {
1234
1298
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -1329,42 +1393,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1329
1393
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
1330
1394
  }
1331
1395
 
1396
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1397
+ // see adapter code documentation for more information on the request object's fields
1398
+ const reqObj = {
1399
+ payload: bodyVars,
1400
+ uriPathVars: pathVars,
1401
+ uriQuery: queryParams,
1402
+ addlHeaders: thisHeaderData
1403
+ };
1404
+
1332
1405
  try {
1333
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1334
- // see adapter code documentation for more information on the request object's fields
1335
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}/rrset/`, bodyVars, stsParams, roleName, (signature, sigerr) => {
1336
- if (sigerr) {
1337
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1406
+ // Make the call -
1407
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1408
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'changeResourceRecordSets', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/rrset/?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1409
+ // if we received an error or their is no response on the results
1410
+ // return an error
1411
+ if (irReturnError) {
1412
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1413
+ return callback(null, irReturnError);
1414
+ }
1415
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1416
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['changeResourceRecordSetsSTSRole'], null, null, null);
1338
1417
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1339
1418
  return callback(null, errorObj);
1340
1419
  }
1341
- Object.assign(thisHeaderData, signature);
1342
- const reqObj = {
1343
- payload: bodyVars,
1344
- uriPathVars: pathVars,
1345
- uriQuery: queryParams,
1346
- addlHeaders: thisHeaderData
1347
- };
1348
-
1349
- // Make the call -
1350
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1351
- return this.requestHandlerInst.identifyRequest('Rest', 'changeResourceRecordSets', reqObj, true, (irReturnData, irReturnError) => {
1352
- // if we received an error or their is no response on the results
1353
- // return an error
1354
- if (irReturnError) {
1355
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1356
- return callback(null, irReturnError);
1357
- }
1358
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1359
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['changeResourceRecordSetsSTSRole'], null, null, null);
1360
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1361
- return callback(null, errorObj);
1362
- }
1363
1420
 
1364
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1365
- // return the response
1366
- return callback(irReturnData, null);
1367
- });
1421
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1422
+ // return the response
1423
+ return callback(irReturnData, null);
1368
1424
  });
1369
1425
  } catch (ex) {
1370
1426
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -1472,42 +1528,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1472
1528
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
1473
1529
  }
1474
1530
 
1531
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1532
+ // see adapter code documentation for more information on the request object's fields
1533
+ const reqObj = {
1534
+ payload: bodyVars,
1535
+ uriPathVars: pathVars,
1536
+ uriQuery: queryParams,
1537
+ addlHeaders: thisHeaderData
1538
+ };
1539
+
1475
1540
  try {
1476
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1477
- // see adapter code documentation for more information on the request object's fields
1478
- return this.getAuthorization('POST', `/${restVer}/tags/${resourceType}/${resourceId}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
1479
- if (sigerr) {
1480
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1541
+ // Make the call -
1542
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1543
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'changeTagsForResource', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/tags/${resourceType}/${resourceId}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1544
+ // if we received an error or their is no response on the results
1545
+ // return an error
1546
+ if (irReturnError) {
1547
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1548
+ return callback(null, irReturnError);
1549
+ }
1550
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1551
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['changeTagsForResourceSTSRole'], null, null, null);
1481
1552
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1482
1553
  return callback(null, errorObj);
1483
1554
  }
1484
- Object.assign(thisHeaderData, signature);
1485
- const reqObj = {
1486
- payload: bodyVars,
1487
- uriPathVars: pathVars,
1488
- uriQuery: queryParams,
1489
- addlHeaders: thisHeaderData
1490
- };
1491
1555
 
1492
- // Make the call -
1493
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1494
- return this.requestHandlerInst.identifyRequest('Rest', 'changeTagsForResource', reqObj, true, (irReturnData, irReturnError) => {
1495
- // if we received an error or their is no response on the results
1496
- // return an error
1497
- if (irReturnError) {
1498
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1499
- return callback(null, irReturnError);
1500
- }
1501
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1502
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['changeTagsForResourceSTSRole'], null, null, null);
1503
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1504
- return callback(null, errorObj);
1505
- }
1506
-
1507
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1508
- // return the response
1509
- return callback(irReturnData, null);
1510
- });
1556
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1557
+ // return the response
1558
+ return callback(irReturnData, null);
1511
1559
  });
1512
1560
  } catch (ex) {
1513
1561
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -1608,42 +1656,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1608
1656
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
1609
1657
  }
1610
1658
 
1659
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1660
+ // see adapter code documentation for more information on the request object's fields
1661
+ const reqObj = {
1662
+ payload: bodyVars,
1663
+ uriPathVars: pathVars,
1664
+ uriQuery: queryParams,
1665
+ addlHeaders: thisHeaderData
1666
+ };
1667
+
1611
1668
  try {
1612
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1613
- // see adapter code documentation for more information on the request object's fields
1614
- return this.getAuthorization('GET', `/${restVer}/tags/${resourceType}/${resourceId}`, null, stsParams, roleName, (signature, sigerr) => {
1615
- if (sigerr) {
1616
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1669
+ // Make the call -
1670
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1671
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTagsForResource', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/tags/${resourceType}/${resourceId}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1672
+ // if we received an error or their is no response on the results
1673
+ // return an error
1674
+ if (irReturnError) {
1675
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1676
+ return callback(null, irReturnError);
1677
+ }
1678
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1679
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTagsForResourceSTSRole'], null, null, null);
1617
1680
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1618
1681
  return callback(null, errorObj);
1619
1682
  }
1620
- Object.assign(thisHeaderData, signature);
1621
- const reqObj = {
1622
- payload: bodyVars,
1623
- uriPathVars: pathVars,
1624
- uriQuery: queryParams,
1625
- addlHeaders: thisHeaderData
1626
- };
1627
-
1628
- // Make the call -
1629
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1630
- return this.requestHandlerInst.identifyRequest('Rest', 'listTagsForResource', reqObj, true, (irReturnData, irReturnError) => {
1631
- // if we received an error or their is no response on the results
1632
- // return an error
1633
- if (irReturnError) {
1634
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1635
- return callback(null, irReturnError);
1636
- }
1637
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1638
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTagsForResourceSTSRole'], null, null, null);
1639
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1640
- return callback(null, errorObj);
1641
- }
1642
1683
 
1643
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1644
- // return the response
1645
- return callback(irReturnData, null);
1646
- });
1684
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1685
+ // return the response
1686
+ return callback(irReturnData, null);
1647
1687
  });
1648
1688
  } catch (ex) {
1649
1689
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -1737,42 +1777,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1737
1777
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
1738
1778
  }
1739
1779
 
1780
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1781
+ // see adapter code documentation for more information on the request object's fields
1782
+ const reqObj = {
1783
+ payload: bodyVars,
1784
+ uriPathVars: pathVars,
1785
+ uriQuery: queryParams,
1786
+ addlHeaders: thisHeaderData
1787
+ };
1788
+
1740
1789
  try {
1741
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1742
- // see adapter code documentation for more information on the request object's fields
1743
- return this.getAuthorization('POST', `/${restVer}/healthcheck`, bodyVars, stsParams, roleName, (signature, sigerr) => {
1744
- if (sigerr) {
1745
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1790
+ // Make the call -
1791
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1792
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createHealthCheck', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1793
+ // if we received an error or their is no response on the results
1794
+ // return an error
1795
+ if (irReturnError) {
1796
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1797
+ return callback(null, irReturnError);
1798
+ }
1799
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1800
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createHealthCheckSTSRole'], null, null, null);
1746
1801
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1747
1802
  return callback(null, errorObj);
1748
1803
  }
1749
- Object.assign(thisHeaderData, signature);
1750
- const reqObj = {
1751
- payload: bodyVars,
1752
- uriPathVars: pathVars,
1753
- uriQuery: queryParams,
1754
- addlHeaders: thisHeaderData
1755
- };
1756
-
1757
- // Make the call -
1758
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1759
- return this.requestHandlerInst.identifyRequest('Rest', 'createHealthCheck', reqObj, true, (irReturnData, irReturnError) => {
1760
- // if we received an error or their is no response on the results
1761
- // return an error
1762
- if (irReturnError) {
1763
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1764
- return callback(null, irReturnError);
1765
- }
1766
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1767
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createHealthCheckSTSRole'], null, null, null);
1768
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1769
- return callback(null, errorObj);
1770
- }
1771
1804
 
1772
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1773
- // return the response
1774
- return callback(irReturnData, null);
1775
- });
1805
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1806
+ // return the response
1807
+ return callback(irReturnData, null);
1776
1808
  });
1777
1809
  } catch (ex) {
1778
1810
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -1867,43 +1899,35 @@ class AmazonRoute53 extends AdapterBaseCl {
1867
1899
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
1868
1900
  }
1869
1901
 
1902
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1903
+ // see adapter code documentation for more information on the request object's fields
1904
+ const reqObj = {
1905
+ payload: bodyVars,
1906
+ uriPathVars: pathVars,
1907
+ uriQuery: queryParams,
1908
+ addlHeaders: thisHeaderData
1909
+ };
1910
+
1870
1911
  try {
1871
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1872
- // see adapter code documentation for more information on the request object's fields
1873
- return this.getAuthorization('GET', `/${restVer}/healthcheck`, null, stsParams, roleName, (signature, sigerr) => {
1874
- if (sigerr) {
1875
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
1912
+ // Make the call -
1913
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1914
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listHealthChecks', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
1915
+ // if we received an error or their is no response on the results
1916
+ // return an error
1917
+ if (irReturnError) {
1918
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1919
+ return callback(null, irReturnError);
1920
+ }
1921
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1922
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHealthChecksSTSRole'], null, null, null);
1876
1923
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1877
1924
  return callback(null, errorObj);
1878
1925
  }
1879
- Object.assign(thisHeaderData, signature);
1880
- const reqObj = {
1881
- payload: bodyVars,
1882
- uriPathVars: pathVars,
1883
- uriQuery: queryParams,
1884
- addlHeaders: thisHeaderData
1885
- };
1886
-
1887
- // Make the call -
1888
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1889
- return this.requestHandlerInst.identifyRequest('Rest', 'listHealthChecks', reqObj, true, (irReturnData, irReturnError) => {
1890
- // if we received an error or their is no response on the results
1891
- // return an error
1892
- if (irReturnError) {
1893
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1894
- return callback(null, irReturnError);
1895
- }
1896
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1897
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHealthChecksSTSRole'], null, null, null);
1898
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1899
- return callback(null, errorObj);
1900
- }
1901
1926
 
1902
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1903
- // return the response
1904
- return callback(irReturnData, null);
1905
- });
1906
- });
1927
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1928
+ // return the response
1929
+ return callback(irReturnData, null);
1930
+ });
1907
1931
  } catch (ex) {
1908
1932
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1909
1933
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
@@ -1996,42 +2020,34 @@ class AmazonRoute53 extends AdapterBaseCl {
1996
2020
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
1997
2021
  }
1998
2022
 
2023
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2024
+ // see adapter code documentation for more information on the request object's fields
2025
+ const reqObj = {
2026
+ payload: bodyVars,
2027
+ uriPathVars: pathVars,
2028
+ uriQuery: queryParams,
2029
+ addlHeaders: thisHeaderData
2030
+ };
2031
+
1999
2032
  try {
2000
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2001
- // see adapter code documentation for more information on the request object's fields
2002
- return this.getAuthorization('POST', `/${restVer}/hostedzone`, bodyVars, stsParams, roleName, (signature, sigerr) => {
2003
- if (sigerr) {
2004
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2033
+ // Make the call -
2034
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2035
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createHostedZone', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2036
+ // if we received an error or their is no response on the results
2037
+ // return an error
2038
+ if (irReturnError) {
2039
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2040
+ return callback(null, irReturnError);
2041
+ }
2042
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2043
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createHostedZoneSTSRole'], null, null, null);
2005
2044
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2006
2045
  return callback(null, errorObj);
2007
2046
  }
2008
- Object.assign(thisHeaderData, signature);
2009
- const reqObj = {
2010
- payload: bodyVars,
2011
- uriPathVars: pathVars,
2012
- uriQuery: queryParams,
2013
- addlHeaders: thisHeaderData
2014
- };
2015
-
2016
- // Make the call -
2017
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2018
- return this.requestHandlerInst.identifyRequest('Rest', 'createHostedZone', reqObj, true, (irReturnData, irReturnError) => {
2019
- // if we received an error or their is no response on the results
2020
- // return an error
2021
- if (irReturnError) {
2022
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2023
- return callback(null, irReturnError);
2024
- }
2025
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2026
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createHostedZoneSTSRole'], null, null, null);
2027
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2028
- return callback(null, errorObj);
2029
- }
2030
2047
 
2031
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2032
- // return the response
2033
- return callback(irReturnData, null);
2034
- });
2048
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2049
+ // return the response
2050
+ return callback(irReturnData, null);
2035
2051
  });
2036
2052
  } catch (ex) {
2037
2053
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2128,42 +2144,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2128
2144
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
2129
2145
  }
2130
2146
 
2147
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2148
+ // see adapter code documentation for more information on the request object's fields
2149
+ const reqObj = {
2150
+ payload: bodyVars,
2151
+ uriPathVars: pathVars,
2152
+ uriQuery: queryParams,
2153
+ addlHeaders: thisHeaderData
2154
+ };
2155
+
2131
2156
  try {
2132
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2133
- // see adapter code documentation for more information on the request object's fields
2134
- return this.getAuthorization('GET', `/${restVer}/hostedzone`, null, stsParams, roleName, (signature, sigerr) => {
2135
- if (sigerr) {
2136
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2157
+ // Make the call -
2158
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2159
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listHostedZones', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2160
+ // if we received an error or their is no response on the results
2161
+ // return an error
2162
+ if (irReturnError) {
2163
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2164
+ return callback(null, irReturnError);
2165
+ }
2166
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2167
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHostedZonesSTSRole'], null, null, null);
2137
2168
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2138
2169
  return callback(null, errorObj);
2139
2170
  }
2140
- Object.assign(thisHeaderData, signature);
2141
- const reqObj = {
2142
- payload: bodyVars,
2143
- uriPathVars: pathVars,
2144
- uriQuery: queryParams,
2145
- addlHeaders: thisHeaderData
2146
- };
2147
-
2148
- // Make the call -
2149
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2150
- return this.requestHandlerInst.identifyRequest('Rest', 'listHostedZones', reqObj, true, (irReturnData, irReturnError) => {
2151
- // if we received an error or their is no response on the results
2152
- // return an error
2153
- if (irReturnError) {
2154
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2155
- return callback(null, irReturnError);
2156
- }
2157
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2158
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHostedZonesSTSRole'], null, null, null);
2159
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2160
- return callback(null, errorObj);
2161
- }
2162
2171
 
2163
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2164
- // return the response
2165
- return callback(irReturnData, null);
2166
- });
2172
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2173
+ // return the response
2174
+ return callback(irReturnData, null);
2167
2175
  });
2168
2176
  } catch (ex) {
2169
2177
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2257,42 +2265,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2257
2265
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
2258
2266
  }
2259
2267
 
2268
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2269
+ // see adapter code documentation for more information on the request object's fields
2270
+ const reqObj = {
2271
+ payload: bodyVars,
2272
+ uriPathVars: pathVars,
2273
+ uriQuery: queryParams,
2274
+ addlHeaders: thisHeaderData
2275
+ };
2276
+
2260
2277
  try {
2261
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2262
- // see adapter code documentation for more information on the request object's fields
2263
- return this.getAuthorization('POST', `/${restVer}/keysigningkey`, bodyVars, stsParams, roleName, (signature, sigerr) => {
2264
- if (sigerr) {
2265
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2278
+ // Make the call -
2279
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2280
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createKeySigningKey', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/keysigningkey?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2281
+ // if we received an error or their is no response on the results
2282
+ // return an error
2283
+ if (irReturnError) {
2284
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2285
+ return callback(null, irReturnError);
2286
+ }
2287
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2288
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createKeySigningKeySTSRole'], null, null, null);
2266
2289
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2267
2290
  return callback(null, errorObj);
2268
2291
  }
2269
- Object.assign(thisHeaderData, signature);
2270
- const reqObj = {
2271
- payload: bodyVars,
2272
- uriPathVars: pathVars,
2273
- uriQuery: queryParams,
2274
- addlHeaders: thisHeaderData
2275
- };
2276
-
2277
- // Make the call -
2278
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2279
- return this.requestHandlerInst.identifyRequest('Rest', 'createKeySigningKey', reqObj, true, (irReturnData, irReturnError) => {
2280
- // if we received an error or their is no response on the results
2281
- // return an error
2282
- if (irReturnError) {
2283
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2284
- return callback(null, irReturnError);
2285
- }
2286
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2287
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createKeySigningKeySTSRole'], null, null, null);
2288
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2289
- return callback(null, errorObj);
2290
- }
2291
2292
 
2292
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2293
- // return the response
2294
- return callback(irReturnData, null);
2295
- });
2293
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2294
+ // return the response
2295
+ return callback(irReturnData, null);
2296
2296
  });
2297
2297
  } catch (ex) {
2298
2298
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2386,42 +2386,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2386
2386
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
2387
2387
  }
2388
2388
 
2389
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2390
+ // see adapter code documentation for more information on the request object's fields
2391
+ const reqObj = {
2392
+ payload: bodyVars,
2393
+ uriPathVars: pathVars,
2394
+ uriQuery: queryParams,
2395
+ addlHeaders: thisHeaderData
2396
+ };
2397
+
2389
2398
  try {
2390
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2391
- // see adapter code documentation for more information on the request object's fields
2392
- return this.getAuthorization('POST', `/${restVer}/queryloggingconfig`, bodyVars, stsParams, roleName, (signature, sigerr) => {
2393
- if (sigerr) {
2394
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2399
+ // Make the call -
2400
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2401
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createQueryLoggingConfig', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/queryloggingconfig?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2402
+ // if we received an error or their is no response on the results
2403
+ // return an error
2404
+ if (irReturnError) {
2405
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2406
+ return callback(null, irReturnError);
2407
+ }
2408
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2409
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createQueryLoggingConfigSTSRole'], null, null, null);
2395
2410
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2396
2411
  return callback(null, errorObj);
2397
2412
  }
2398
- Object.assign(thisHeaderData, signature);
2399
- const reqObj = {
2400
- payload: bodyVars,
2401
- uriPathVars: pathVars,
2402
- uriQuery: queryParams,
2403
- addlHeaders: thisHeaderData
2404
- };
2405
-
2406
- // Make the call -
2407
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2408
- return this.requestHandlerInst.identifyRequest('Rest', 'createQueryLoggingConfig', reqObj, true, (irReturnData, irReturnError) => {
2409
- // if we received an error or their is no response on the results
2410
- // return an error
2411
- if (irReturnError) {
2412
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2413
- return callback(null, irReturnError);
2414
- }
2415
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2416
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createQueryLoggingConfigSTSRole'], null, null, null);
2417
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2418
- return callback(null, errorObj);
2419
- }
2420
2413
 
2421
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2422
- // return the response
2423
- return callback(irReturnData, null);
2424
- });
2414
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2415
+ // return the response
2416
+ return callback(irReturnData, null);
2425
2417
  });
2426
2418
  } catch (ex) {
2427
2419
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2518,42 +2510,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2518
2510
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
2519
2511
  }
2520
2512
 
2513
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2514
+ // see adapter code documentation for more information on the request object's fields
2515
+ const reqObj = {
2516
+ payload: bodyVars,
2517
+ uriPathVars: pathVars,
2518
+ uriQuery: queryParams,
2519
+ addlHeaders: thisHeaderData
2520
+ };
2521
+
2521
2522
  try {
2522
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2523
- // see adapter code documentation for more information on the request object's fields
2524
- return this.getAuthorization('GET', `/${restVer}/queryloggingconfig`, null, stsParams, roleName, (signature, sigerr) => {
2525
- if (sigerr) {
2526
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2523
+ // Make the call -
2524
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2525
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listQueryLoggingConfigs', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/queryloggingconfig?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2526
+ // if we received an error or their is no response on the results
2527
+ // return an error
2528
+ if (irReturnError) {
2529
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2530
+ return callback(null, irReturnError);
2531
+ }
2532
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2533
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listQueryLoggingConfigsSTSRole'], null, null, null);
2527
2534
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2528
2535
  return callback(null, errorObj);
2529
2536
  }
2530
- Object.assign(thisHeaderData, signature);
2531
- const reqObj = {
2532
- payload: bodyVars,
2533
- uriPathVars: pathVars,
2534
- uriQuery: queryParams,
2535
- addlHeaders: thisHeaderData
2536
- };
2537
-
2538
- // Make the call -
2539
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2540
- return this.requestHandlerInst.identifyRequest('Rest', 'listQueryLoggingConfigs', reqObj, true, (irReturnData, irReturnError) => {
2541
- // if we received an error or their is no response on the results
2542
- // return an error
2543
- if (irReturnError) {
2544
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2545
- return callback(null, irReturnError);
2546
- }
2547
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2548
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listQueryLoggingConfigsSTSRole'], null, null, null);
2549
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2550
- return callback(null, errorObj);
2551
- }
2552
2537
 
2553
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2554
- // return the response
2555
- return callback(irReturnData, null);
2556
- });
2538
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2539
+ // return the response
2540
+ return callback(irReturnData, null);
2557
2541
  });
2558
2542
  } catch (ex) {
2559
2543
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2647,42 +2631,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2647
2631
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
2648
2632
  }
2649
2633
 
2634
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2635
+ // see adapter code documentation for more information on the request object's fields
2636
+ const reqObj = {
2637
+ payload: bodyVars,
2638
+ uriPathVars: pathVars,
2639
+ uriQuery: queryParams,
2640
+ addlHeaders: thisHeaderData
2641
+ };
2642
+
2650
2643
  try {
2651
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2652
- // see adapter code documentation for more information on the request object's fields
2653
- return this.getAuthorization('POST', `/${restVer}/delegationset`, bodyVars, stsParams, roleName, (signature, sigerr) => {
2654
- if (sigerr) {
2655
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2644
+ // Make the call -
2645
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2646
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createReusableDelegationSet', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/delegationset?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2647
+ // if we received an error or their is no response on the results
2648
+ // return an error
2649
+ if (irReturnError) {
2650
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2651
+ return callback(null, irReturnError);
2652
+ }
2653
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2654
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createReusableDelegationSetSTSRole'], null, null, null);
2656
2655
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2657
2656
  return callback(null, errorObj);
2658
2657
  }
2659
- Object.assign(thisHeaderData, signature);
2660
- const reqObj = {
2661
- payload: bodyVars,
2662
- uriPathVars: pathVars,
2663
- uriQuery: queryParams,
2664
- addlHeaders: thisHeaderData
2665
- };
2666
-
2667
- // Make the call -
2668
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2669
- return this.requestHandlerInst.identifyRequest('Rest', 'createReusableDelegationSet', reqObj, true, (irReturnData, irReturnError) => {
2670
- // if we received an error or their is no response on the results
2671
- // return an error
2672
- if (irReturnError) {
2673
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2674
- return callback(null, irReturnError);
2675
- }
2676
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2677
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createReusableDelegationSetSTSRole'], null, null, null);
2678
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2679
- return callback(null, errorObj);
2680
- }
2681
2658
 
2682
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2683
- // return the response
2684
- return callback(irReturnData, null);
2685
- });
2659
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2660
+ // return the response
2661
+ return callback(irReturnData, null);
2686
2662
  });
2687
2663
  } catch (ex) {
2688
2664
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2773,42 +2749,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2773
2749
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
2774
2750
  }
2775
2751
 
2752
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2753
+ // see adapter code documentation for more information on the request object's fields
2754
+ const reqObj = {
2755
+ payload: bodyVars,
2756
+ uriPathVars: pathVars,
2757
+ uriQuery: queryParams,
2758
+ addlHeaders: thisHeaderData
2759
+ };
2760
+
2776
2761
  try {
2777
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2778
- // see adapter code documentation for more information on the request object's fields
2779
- return this.getAuthorization('GET', `/${restVer}/delegationset`, null, stsParams, roleName, (signature, sigerr) => {
2780
- if (sigerr) {
2781
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2762
+ // Make the call -
2763
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2764
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listReusableDelegationSets', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/delegationset?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2765
+ // if we received an error or their is no response on the results
2766
+ // return an error
2767
+ if (irReturnError) {
2768
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2769
+ return callback(null, irReturnError);
2770
+ }
2771
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2772
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listReusableDelegationSetsSTSRole'], null, null, null);
2782
2773
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2783
2774
  return callback(null, errorObj);
2784
2775
  }
2785
- Object.assign(thisHeaderData, signature);
2786
- const reqObj = {
2787
- payload: bodyVars,
2788
- uriPathVars: pathVars,
2789
- uriQuery: queryParams,
2790
- addlHeaders: thisHeaderData
2791
- };
2792
2776
 
2793
- // Make the call -
2794
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2795
- return this.requestHandlerInst.identifyRequest('Rest', 'listReusableDelegationSets', reqObj, true, (irReturnData, irReturnError) => {
2796
- // if we received an error or their is no response on the results
2797
- // return an error
2798
- if (irReturnError) {
2799
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2800
- return callback(null, irReturnError);
2801
- }
2802
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2803
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listReusableDelegationSetsSTSRole'], null, null, null);
2804
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2805
- return callback(null, errorObj);
2806
- }
2807
-
2808
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2809
- // return the response
2810
- return callback(irReturnData, null);
2811
- });
2777
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2778
+ // return the response
2779
+ return callback(irReturnData, null);
2812
2780
  });
2813
2781
  } catch (ex) {
2814
2782
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -2902,42 +2870,34 @@ class AmazonRoute53 extends AdapterBaseCl {
2902
2870
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
2903
2871
  }
2904
2872
 
2873
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2874
+ // see adapter code documentation for more information on the request object's fields
2875
+ const reqObj = {
2876
+ payload: bodyVars,
2877
+ uriPathVars: pathVars,
2878
+ uriQuery: queryParams,
2879
+ addlHeaders: thisHeaderData
2880
+ };
2881
+
2905
2882
  try {
2906
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2907
- // see adapter code documentation for more information on the request object's fields
2908
- return this.getAuthorization('POST', `/${restVer}/trafficpolicy`, bodyVars, stsParams, roleName, (signature, sigerr) => {
2909
- if (sigerr) {
2910
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
2883
+ // Make the call -
2884
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2885
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createTrafficPolicy', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicy?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
2886
+ // if we received an error or their is no response on the results
2887
+ // return an error
2888
+ if (irReturnError) {
2889
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2890
+ return callback(null, irReturnError);
2891
+ }
2892
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2893
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTrafficPolicySTSRole'], null, null, null);
2911
2894
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2912
2895
  return callback(null, errorObj);
2913
2896
  }
2914
- Object.assign(thisHeaderData, signature);
2915
- const reqObj = {
2916
- payload: bodyVars,
2917
- uriPathVars: pathVars,
2918
- uriQuery: queryParams,
2919
- addlHeaders: thisHeaderData
2920
- };
2921
-
2922
- // Make the call -
2923
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2924
- return this.requestHandlerInst.identifyRequest('Rest', 'createTrafficPolicy', reqObj, true, (irReturnData, irReturnError) => {
2925
- // if we received an error or their is no response on the results
2926
- // return an error
2927
- if (irReturnError) {
2928
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2929
- return callback(null, irReturnError);
2930
- }
2931
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2932
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTrafficPolicySTSRole'], null, null, null);
2933
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2934
- return callback(null, errorObj);
2935
- }
2936
2897
 
2937
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2938
- // return the response
2939
- return callback(irReturnData, null);
2940
- });
2898
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2899
+ // return the response
2900
+ return callback(irReturnData, null);
2941
2901
  });
2942
2902
  } catch (ex) {
2943
2903
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3031,42 +2991,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3031
2991
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
3032
2992
  }
3033
2993
 
2994
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2995
+ // see adapter code documentation for more information on the request object's fields
2996
+ const reqObj = {
2997
+ payload: bodyVars,
2998
+ uriPathVars: pathVars,
2999
+ uriQuery: queryParams,
3000
+ addlHeaders: thisHeaderData
3001
+ };
3002
+
3034
3003
  try {
3035
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3036
- // see adapter code documentation for more information on the request object's fields
3037
- return this.getAuthorization('POST', `/${restVer}/trafficpolicyinstance`, bodyVars, stsParams, roleName, (signature, sigerr) => {
3038
- if (sigerr) {
3039
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3004
+ // Make the call -
3005
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3006
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createTrafficPolicyInstance', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstance?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3007
+ // if we received an error or their is no response on the results
3008
+ // return an error
3009
+ if (irReturnError) {
3010
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3011
+ return callback(null, irReturnError);
3012
+ }
3013
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3014
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTrafficPolicyInstanceSTSRole'], null, null, null);
3040
3015
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3041
3016
  return callback(null, errorObj);
3042
3017
  }
3043
- Object.assign(thisHeaderData, signature);
3044
- const reqObj = {
3045
- payload: bodyVars,
3046
- uriPathVars: pathVars,
3047
- uriQuery: queryParams,
3048
- addlHeaders: thisHeaderData
3049
- };
3050
-
3051
- // Make the call -
3052
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3053
- return this.requestHandlerInst.identifyRequest('Rest', 'createTrafficPolicyInstance', reqObj, true, (irReturnData, irReturnError) => {
3054
- // if we received an error or their is no response on the results
3055
- // return an error
3056
- if (irReturnError) {
3057
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3058
- return callback(null, irReturnError);
3059
- }
3060
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3061
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTrafficPolicyInstanceSTSRole'], null, null, null);
3062
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3063
- return callback(null, errorObj);
3064
- }
3065
3018
 
3066
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3067
- // return the response
3068
- return callback(irReturnData, null);
3069
- });
3019
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3020
+ // return the response
3021
+ return callback(irReturnData, null);
3070
3022
  });
3071
3023
  } catch (ex) {
3072
3024
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3167,42 +3119,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3167
3119
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
3168
3120
  }
3169
3121
 
3122
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3123
+ // see adapter code documentation for more information on the request object's fields
3124
+ const reqObj = {
3125
+ payload: bodyVars,
3126
+ uriPathVars: pathVars,
3127
+ uriQuery: queryParams,
3128
+ addlHeaders: thisHeaderData
3129
+ };
3130
+
3170
3131
  try {
3171
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3172
- // see adapter code documentation for more information on the request object's fields
3173
- return this.getAuthorization('POST', `/${restVer}/trafficpolicy/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
3174
- if (sigerr) {
3175
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3176
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3132
+ // Make the call -
3133
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3134
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createTrafficPolicyVersion', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicy/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3135
+ // if we received an error or their is no response on the results
3136
+ // return an error
3137
+ if (irReturnError) {
3138
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3139
+ return callback(null, irReturnError);
3140
+ }
3141
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3142
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTrafficPolicyVersionSTSRole'], null, null, null);
3143
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3177
3144
  return callback(null, errorObj);
3178
3145
  }
3179
- Object.assign(thisHeaderData, signature);
3180
- const reqObj = {
3181
- payload: bodyVars,
3182
- uriPathVars: pathVars,
3183
- uriQuery: queryParams,
3184
- addlHeaders: thisHeaderData
3185
- };
3186
-
3187
- // Make the call -
3188
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3189
- return this.requestHandlerInst.identifyRequest('Rest', 'createTrafficPolicyVersion', reqObj, true, (irReturnData, irReturnError) => {
3190
- // if we received an error or their is no response on the results
3191
- // return an error
3192
- if (irReturnError) {
3193
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3194
- return callback(null, irReturnError);
3195
- }
3196
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3197
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTrafficPolicyVersionSTSRole'], null, null, null);
3198
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3199
- return callback(null, errorObj);
3200
- }
3201
3146
 
3202
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3203
- // return the response
3204
- return callback(irReturnData, null);
3205
- });
3147
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3148
+ // return the response
3149
+ return callback(irReturnData, null);
3206
3150
  });
3207
3151
  } catch (ex) {
3208
3152
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3303,42 +3247,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3303
3247
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
3304
3248
  }
3305
3249
 
3250
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3251
+ // see adapter code documentation for more information on the request object's fields
3252
+ const reqObj = {
3253
+ payload: bodyVars,
3254
+ uriPathVars: pathVars,
3255
+ uriQuery: queryParams,
3256
+ addlHeaders: thisHeaderData
3257
+ };
3258
+
3306
3259
  try {
3307
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3308
- // see adapter code documentation for more information on the request object's fields
3309
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}/authorizevpcassociation`, bodyVars, stsParams, roleName, (signature, sigerr) => {
3310
- if (sigerr) {
3311
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3260
+ // Make the call -
3261
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3262
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'createVPCAssociationAuthorization', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/authorizevpcassociation?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3263
+ // if we received an error or their is no response on the results
3264
+ // return an error
3265
+ if (irReturnError) {
3266
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3267
+ return callback(null, irReturnError);
3268
+ }
3269
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3270
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createVPCAssociationAuthorizationSTSRole'], null, null, null);
3312
3271
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3313
3272
  return callback(null, errorObj);
3314
3273
  }
3315
- Object.assign(thisHeaderData, signature);
3316
- const reqObj = {
3317
- payload: bodyVars,
3318
- uriPathVars: pathVars,
3319
- uriQuery: queryParams,
3320
- addlHeaders: thisHeaderData
3321
- };
3322
-
3323
- // Make the call -
3324
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3325
- return this.requestHandlerInst.identifyRequest('Rest', 'createVPCAssociationAuthorization', reqObj, true, (irReturnData, irReturnError) => {
3326
- // if we received an error or their is no response on the results
3327
- // return an error
3328
- if (irReturnError) {
3329
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3330
- return callback(null, irReturnError);
3331
- }
3332
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3333
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createVPCAssociationAuthorizationSTSRole'], null, null, null);
3334
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3335
- return callback(null, errorObj);
3336
- }
3337
3274
 
3338
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3339
- // return the response
3340
- return callback(irReturnData, null);
3341
- });
3275
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3276
+ // return the response
3277
+ return callback(irReturnData, null);
3342
3278
  });
3343
3279
  } catch (ex) {
3344
3280
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3436,42 +3372,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3436
3372
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
3437
3373
  }
3438
3374
 
3375
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3376
+ // see adapter code documentation for more information on the request object's fields
3377
+ const reqObj = {
3378
+ payload: bodyVars,
3379
+ uriPathVars: pathVars,
3380
+ uriQuery: queryParams,
3381
+ addlHeaders: thisHeaderData
3382
+ };
3383
+
3439
3384
  try {
3440
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3441
- // see adapter code documentation for more information on the request object's fields
3442
- return this.getAuthorization('GET', `/${restVer}/hostedzone/${id}/authorizevpcassociation`, null, stsParams, roleName, (signature, sigerr) => {
3443
- if (sigerr) {
3444
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3385
+ // Make the call -
3386
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3387
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listVPCAssociationAuthorizations', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/authorizevpcassociation?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3388
+ // if we received an error or their is no response on the results
3389
+ // return an error
3390
+ if (irReturnError) {
3391
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3392
+ return callback(null, irReturnError);
3393
+ }
3394
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3395
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listVPCAssociationAuthorizationsSTSRole'], null, null, null);
3445
3396
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3446
3397
  return callback(null, errorObj);
3447
3398
  }
3448
- Object.assign(thisHeaderData, signature);
3449
- const reqObj = {
3450
- payload: bodyVars,
3451
- uriPathVars: pathVars,
3452
- uriQuery: queryParams,
3453
- addlHeaders: thisHeaderData
3454
- };
3455
-
3456
- // Make the call -
3457
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3458
- return this.requestHandlerInst.identifyRequest('Rest', 'listVPCAssociationAuthorizations', reqObj, true, (irReturnData, irReturnError) => {
3459
- // if we received an error or their is no response on the results
3460
- // return an error
3461
- if (irReturnError) {
3462
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3463
- return callback(null, irReturnError);
3464
- }
3465
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3466
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listVPCAssociationAuthorizationsSTSRole'], null, null, null);
3467
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3468
- return callback(null, errorObj);
3469
- }
3470
3399
 
3471
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3472
- // return the response
3473
- return callback(irReturnData, null);
3474
- });
3400
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3401
+ // return the response
3402
+ return callback(irReturnData, null);
3475
3403
  });
3476
3404
  } catch (ex) {
3477
3405
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3572,42 +3500,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3572
3500
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
3573
3501
  }
3574
3502
 
3503
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3504
+ // see adapter code documentation for more information on the request object's fields
3505
+ const reqObj = {
3506
+ payload: bodyVars,
3507
+ uriPathVars: pathVars,
3508
+ uriQuery: queryParams,
3509
+ addlHeaders: thisHeaderData
3510
+ };
3511
+
3575
3512
  try {
3576
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3577
- // see adapter code documentation for more information on the request object's fields
3578
- return this.getAuthorization('POST', `/${restVer}/keysigningkey/${hostedZoneId}/${name}/deactivate`, bodyVars, stsParams, roleName, (signature, sigerr) => {
3579
- if (sigerr) {
3580
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3513
+ // Make the call -
3514
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3515
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deactivateKeySigningKey', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/keysigningkey/${hostedZoneId}/${name}/deactivate?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3516
+ // if we received an error or their is no response on the results
3517
+ // return an error
3518
+ if (irReturnError) {
3519
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3520
+ return callback(null, irReturnError);
3521
+ }
3522
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3523
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deactivateKeySigningKeySTSRole'], null, null, null);
3581
3524
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3582
3525
  return callback(null, errorObj);
3583
3526
  }
3584
- Object.assign(thisHeaderData, signature);
3585
- const reqObj = {
3586
- payload: bodyVars,
3587
- uriPathVars: pathVars,
3588
- uriQuery: queryParams,
3589
- addlHeaders: thisHeaderData
3590
- };
3591
-
3592
- // Make the call -
3593
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3594
- return this.requestHandlerInst.identifyRequest('Rest', 'deactivateKeySigningKey', reqObj, true, (irReturnData, irReturnError) => {
3595
- // if we received an error or their is no response on the results
3596
- // return an error
3597
- if (irReturnError) {
3598
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3599
- return callback(null, irReturnError);
3600
- }
3601
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3602
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deactivateKeySigningKeySTSRole'], null, null, null);
3603
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3604
- return callback(null, errorObj);
3605
- }
3606
3527
 
3607
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3608
- // return the response
3609
- return callback(irReturnData, null);
3610
- });
3528
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3529
+ // return the response
3530
+ return callback(irReturnData, null);
3611
3531
  });
3612
3532
  } catch (ex) {
3613
3533
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3701,42 +3621,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3701
3621
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
3702
3622
  }
3703
3623
 
3624
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3625
+ // see adapter code documentation for more information on the request object's fields
3626
+ const reqObj = {
3627
+ payload: bodyVars,
3628
+ uriPathVars: pathVars,
3629
+ uriQuery: queryParams,
3630
+ addlHeaders: thisHeaderData
3631
+ };
3632
+
3704
3633
  try {
3705
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3706
- // see adapter code documentation for more information on the request object's fields
3707
- return this.getAuthorization('DELETE', `/${restVer}/healthcheck/${healthCheckId}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
3708
- if (sigerr) {
3709
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3634
+ // Make the call -
3635
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3636
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteHealthCheck', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck/${healthCheckId}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3637
+ // if we received an error or their is no response on the results
3638
+ // return an error
3639
+ if (irReturnError) {
3640
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3641
+ return callback(null, irReturnError);
3642
+ }
3643
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3644
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteHealthCheckSTSRole'], null, null, null);
3710
3645
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3711
3646
  return callback(null, errorObj);
3712
3647
  }
3713
- Object.assign(thisHeaderData, signature);
3714
- const reqObj = {
3715
- payload: bodyVars,
3716
- uriPathVars: pathVars,
3717
- uriQuery: queryParams,
3718
- addlHeaders: thisHeaderData
3719
- };
3720
-
3721
- // Make the call -
3722
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3723
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteHealthCheck', reqObj, false, (irReturnData, irReturnError) => {
3724
- // if we received an error or their is no response on the results
3725
- // return an error
3726
- if (irReturnError) {
3727
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3728
- return callback(null, irReturnError);
3729
- }
3730
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3731
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteHealthCheckSTSRole'], null, null, null);
3732
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3733
- return callback(null, errorObj);
3734
- }
3735
3648
 
3736
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3737
- // return the response
3738
- return callback(irReturnData, null);
3739
- });
3649
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3650
+ // return the response
3651
+ return callback(irReturnData, null);
3740
3652
  });
3741
3653
  } catch (ex) {
3742
3654
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3830,42 +3742,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3830
3742
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
3831
3743
  }
3832
3744
 
3745
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3746
+ // see adapter code documentation for more information on the request object's fields
3747
+ const reqObj = {
3748
+ payload: bodyVars,
3749
+ uriPathVars: pathVars,
3750
+ uriQuery: queryParams,
3751
+ addlHeaders: thisHeaderData
3752
+ };
3753
+
3833
3754
  try {
3834
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3835
- // see adapter code documentation for more information on the request object's fields
3836
- return this.getAuthorization('GET', `/${restVer}/healthcheck/${healthCheckId}`, null, stsParams, roleName, (signature, sigerr) => {
3837
- if (sigerr) {
3838
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3755
+ // Make the call -
3756
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3757
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHealthCheck', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck/${healthCheckId}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3758
+ // if we received an error or their is no response on the results
3759
+ // return an error
3760
+ if (irReturnError) {
3761
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3762
+ return callback(null, irReturnError);
3763
+ }
3764
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3765
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckSTSRole'], null, null, null);
3839
3766
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3840
3767
  return callback(null, errorObj);
3841
3768
  }
3842
- Object.assign(thisHeaderData, signature);
3843
- const reqObj = {
3844
- payload: bodyVars,
3845
- uriPathVars: pathVars,
3846
- uriQuery: queryParams,
3847
- addlHeaders: thisHeaderData
3848
- };
3849
-
3850
- // Make the call -
3851
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3852
- return this.requestHandlerInst.identifyRequest('Rest', 'getHealthCheck', reqObj, true, (irReturnData, irReturnError) => {
3853
- // if we received an error or their is no response on the results
3854
- // return an error
3855
- if (irReturnError) {
3856
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3857
- return callback(null, irReturnError);
3858
- }
3859
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3860
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckSTSRole'], null, null, null);
3861
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3862
- return callback(null, errorObj);
3863
- }
3864
3769
 
3865
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3866
- // return the response
3867
- return callback(irReturnData, null);
3868
- });
3770
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3771
+ // return the response
3772
+ return callback(irReturnData, null);
3869
3773
  });
3870
3774
  } catch (ex) {
3871
3775
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -3966,42 +3870,34 @@ class AmazonRoute53 extends AdapterBaseCl {
3966
3870
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
3967
3871
  }
3968
3872
 
3873
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3874
+ // see adapter code documentation for more information on the request object's fields
3875
+ const reqObj = {
3876
+ payload: bodyVars,
3877
+ uriPathVars: pathVars,
3878
+ uriQuery: queryParams,
3879
+ addlHeaders: thisHeaderData
3880
+ };
3881
+
3969
3882
  try {
3970
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3971
- // see adapter code documentation for more information on the request object's fields
3972
- return this.getAuthorization('PUT', `/${restVer}/healthcheck/${healthCheckId}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
3973
- if (sigerr) {
3974
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
3883
+ // Make the call -
3884
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3885
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'updateHealthCheck', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck/${healthCheckId}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
3886
+ // if we received an error or their is no response on the results
3887
+ // return an error
3888
+ if (irReturnError) {
3889
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3890
+ return callback(null, irReturnError);
3891
+ }
3892
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3893
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateHealthCheckSTSRole'], null, null, null);
3975
3894
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3976
3895
  return callback(null, errorObj);
3977
3896
  }
3978
- Object.assign(thisHeaderData, signature);
3979
- const reqObj = {
3980
- payload: bodyVars,
3981
- uriPathVars: pathVars,
3982
- uriQuery: queryParams,
3983
- addlHeaders: thisHeaderData
3984
- };
3985
-
3986
- // Make the call -
3987
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3988
- return this.requestHandlerInst.identifyRequest('Rest', 'updateHealthCheck', reqObj, true, (irReturnData, irReturnError) => {
3989
- // if we received an error or their is no response on the results
3990
- // return an error
3991
- if (irReturnError) {
3992
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3993
- return callback(null, irReturnError);
3994
- }
3995
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3996
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateHealthCheckSTSRole'], null, null, null);
3997
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3998
- return callback(null, errorObj);
3999
- }
4000
3897
 
4001
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4002
- // return the response
4003
- return callback(irReturnData, null);
4004
- });
3898
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3899
+ // return the response
3900
+ return callback(irReturnData, null);
4005
3901
  });
4006
3902
  } catch (ex) {
4007
3903
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4095,42 +3991,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4095
3991
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
4096
3992
  }
4097
3993
 
3994
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3995
+ // see adapter code documentation for more information on the request object's fields
3996
+ const reqObj = {
3997
+ payload: bodyVars,
3998
+ uriPathVars: pathVars,
3999
+ uriQuery: queryParams,
4000
+ addlHeaders: thisHeaderData
4001
+ };
4002
+
4098
4003
  try {
4099
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4100
- // see adapter code documentation for more information on the request object's fields
4101
- return this.getAuthorization('DELETE', `/${restVer}/hostedzone/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
4102
- if (sigerr) {
4103
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4004
+ // Make the call -
4005
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4006
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteHostedZone', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4007
+ // if we received an error or their is no response on the results
4008
+ // return an error
4009
+ if (irReturnError) {
4010
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4011
+ return callback(null, irReturnError);
4012
+ }
4013
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4014
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteHostedZoneSTSRole'], null, null, null);
4104
4015
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4105
4016
  return callback(null, errorObj);
4106
4017
  }
4107
- Object.assign(thisHeaderData, signature);
4108
- const reqObj = {
4109
- payload: bodyVars,
4110
- uriPathVars: pathVars,
4111
- uriQuery: queryParams,
4112
- addlHeaders: thisHeaderData
4113
- };
4114
4018
 
4115
- // Make the call -
4116
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4117
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteHostedZone', reqObj, false, (irReturnData, irReturnError) => {
4118
- // if we received an error or their is no response on the results
4119
- // return an error
4120
- if (irReturnError) {
4121
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4122
- return callback(null, irReturnError);
4123
- }
4124
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4125
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteHostedZoneSTSRole'], null, null, null);
4126
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4127
- return callback(null, errorObj);
4128
- }
4129
-
4130
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4131
- // return the response
4132
- return callback(irReturnData, null);
4133
- });
4019
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4020
+ // return the response
4021
+ return callback(irReturnData, null);
4134
4022
  });
4135
4023
  } catch (ex) {
4136
4024
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4224,42 +4112,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4224
4112
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
4225
4113
  }
4226
4114
 
4115
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4116
+ // see adapter code documentation for more information on the request object's fields
4117
+ const reqObj = {
4118
+ payload: bodyVars,
4119
+ uriPathVars: pathVars,
4120
+ uriQuery: queryParams,
4121
+ addlHeaders: thisHeaderData
4122
+ };
4123
+
4227
4124
  try {
4228
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4229
- // see adapter code documentation for more information on the request object's fields
4230
- return this.getAuthorization('GET', `/${restVer}/hostedzone/${id}`, null, stsParams, roleName, (signature, sigerr) => {
4231
- if (sigerr) {
4232
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4125
+ // Make the call -
4126
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4127
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHostedZone', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4128
+ // if we received an error or their is no response on the results
4129
+ // return an error
4130
+ if (irReturnError) {
4131
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4132
+ return callback(null, irReturnError);
4133
+ }
4134
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4135
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHostedZoneSTSRole'], null, null, null);
4233
4136
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4234
4137
  return callback(null, errorObj);
4235
4138
  }
4236
- Object.assign(thisHeaderData, signature);
4237
- const reqObj = {
4238
- payload: bodyVars,
4239
- uriPathVars: pathVars,
4240
- uriQuery: queryParams,
4241
- addlHeaders: thisHeaderData
4242
- };
4243
-
4244
- // Make the call -
4245
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4246
- return this.requestHandlerInst.identifyRequest('Rest', 'getHostedZone', reqObj, true, (irReturnData, irReturnError) => {
4247
- // if we received an error or their is no response on the results
4248
- // return an error
4249
- if (irReturnError) {
4250
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4251
- return callback(null, irReturnError);
4252
- }
4253
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4254
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHostedZoneSTSRole'], null, null, null);
4255
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4256
- return callback(null, errorObj);
4257
- }
4258
4139
 
4259
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4260
- // return the response
4261
- return callback(irReturnData, null);
4262
- });
4140
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4141
+ // return the response
4142
+ return callback(irReturnData, null);
4263
4143
  });
4264
4144
  } catch (ex) {
4265
4145
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4360,42 +4240,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4360
4240
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
4361
4241
  }
4362
4242
 
4243
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4244
+ // see adapter code documentation for more information on the request object's fields
4245
+ const reqObj = {
4246
+ payload: bodyVars,
4247
+ uriPathVars: pathVars,
4248
+ uriQuery: queryParams,
4249
+ addlHeaders: thisHeaderData
4250
+ };
4251
+
4363
4252
  try {
4364
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4365
- // see adapter code documentation for more information on the request object's fields
4366
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
4367
- if (sigerr) {
4368
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4253
+ // Make the call -
4254
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4255
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'updateHostedZoneComment', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4256
+ // if we received an error or their is no response on the results
4257
+ // return an error
4258
+ if (irReturnError) {
4259
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4260
+ return callback(null, irReturnError);
4261
+ }
4262
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4263
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateHostedZoneCommentSTSRole'], null, null, null);
4369
4264
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4370
4265
  return callback(null, errorObj);
4371
4266
  }
4372
- Object.assign(thisHeaderData, signature);
4373
- const reqObj = {
4374
- payload: bodyVars,
4375
- uriPathVars: pathVars,
4376
- uriQuery: queryParams,
4377
- addlHeaders: thisHeaderData
4378
- };
4379
4267
 
4380
- // Make the call -
4381
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4382
- return this.requestHandlerInst.identifyRequest('Rest', 'updateHostedZoneComment', reqObj, true, (irReturnData, irReturnError) => {
4383
- // if we received an error or their is no response on the results
4384
- // return an error
4385
- if (irReturnError) {
4386
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4387
- return callback(null, irReturnError);
4388
- }
4389
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4390
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateHostedZoneCommentSTSRole'], null, null, null);
4391
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4392
- return callback(null, errorObj);
4393
- }
4394
-
4395
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4396
- // return the response
4397
- return callback(irReturnData, null);
4398
- });
4268
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4269
+ // return the response
4270
+ return callback(irReturnData, null);
4399
4271
  });
4400
4272
  } catch (ex) {
4401
4273
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4496,42 +4368,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4496
4368
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
4497
4369
  }
4498
4370
 
4371
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4372
+ // see adapter code documentation for more information on the request object's fields
4373
+ const reqObj = {
4374
+ payload: bodyVars,
4375
+ uriPathVars: pathVars,
4376
+ uriQuery: queryParams,
4377
+ addlHeaders: thisHeaderData
4378
+ };
4379
+
4499
4380
  try {
4500
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4501
- // see adapter code documentation for more information on the request object's fields
4502
- return this.getAuthorization('DELETE', `/${restVer}/keysigningkey/${hostedZoneId}/${name}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
4503
- if (sigerr) {
4504
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4381
+ // Make the call -
4382
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4383
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteKeySigningKey', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/keysigningkey/${hostedZoneId}/${name}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4384
+ // if we received an error or their is no response on the results
4385
+ // return an error
4386
+ if (irReturnError) {
4387
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4388
+ return callback(null, irReturnError);
4389
+ }
4390
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4391
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteKeySigningKeySTSRole'], null, null, null);
4505
4392
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4506
4393
  return callback(null, errorObj);
4507
4394
  }
4508
- Object.assign(thisHeaderData, signature);
4509
- const reqObj = {
4510
- payload: bodyVars,
4511
- uriPathVars: pathVars,
4512
- uriQuery: queryParams,
4513
- addlHeaders: thisHeaderData
4514
- };
4515
-
4516
- // Make the call -
4517
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4518
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteKeySigningKey', reqObj, false, (irReturnData, irReturnError) => {
4519
- // if we received an error or their is no response on the results
4520
- // return an error
4521
- if (irReturnError) {
4522
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4523
- return callback(null, irReturnError);
4524
- }
4525
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4526
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteKeySigningKeySTSRole'], null, null, null);
4527
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4528
- return callback(null, errorObj);
4529
- }
4530
4395
 
4531
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4532
- // return the response
4533
- return callback(irReturnData, null);
4534
- });
4396
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4397
+ // return the response
4398
+ return callback(irReturnData, null);
4535
4399
  });
4536
4400
  } catch (ex) {
4537
4401
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4625,42 +4489,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4625
4489
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
4626
4490
  }
4627
4491
 
4492
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4493
+ // see adapter code documentation for more information on the request object's fields
4494
+ const reqObj = {
4495
+ payload: bodyVars,
4496
+ uriPathVars: pathVars,
4497
+ uriQuery: queryParams,
4498
+ addlHeaders: thisHeaderData
4499
+ };
4500
+
4628
4501
  try {
4629
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4630
- // see adapter code documentation for more information on the request object's fields
4631
- return this.getAuthorization('DELETE', `/${restVer}/queryloggingconfig/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
4632
- if (sigerr) {
4633
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4502
+ // Make the call -
4503
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4504
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteQueryLoggingConfig', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/queryloggingconfig/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4505
+ // if we received an error or their is no response on the results
4506
+ // return an error
4507
+ if (irReturnError) {
4508
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4509
+ return callback(null, irReturnError);
4510
+ }
4511
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4512
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteQueryLoggingConfigSTSRole'], null, null, null);
4634
4513
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4635
4514
  return callback(null, errorObj);
4636
4515
  }
4637
- Object.assign(thisHeaderData, signature);
4638
- const reqObj = {
4639
- payload: bodyVars,
4640
- uriPathVars: pathVars,
4641
- uriQuery: queryParams,
4642
- addlHeaders: thisHeaderData
4643
- };
4644
-
4645
- // Make the call -
4646
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4647
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteQueryLoggingConfig', reqObj, false, (irReturnData, irReturnError) => {
4648
- // if we received an error or their is no response on the results
4649
- // return an error
4650
- if (irReturnError) {
4651
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4652
- return callback(null, irReturnError);
4653
- }
4654
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4655
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteQueryLoggingConfigSTSRole'], null, null, null);
4656
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4657
- return callback(null, errorObj);
4658
- }
4659
4516
 
4660
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4661
- // return the response
4662
- return callback(irReturnData, null);
4663
- });
4517
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4518
+ // return the response
4519
+ return callback(irReturnData, null);
4664
4520
  });
4665
4521
  } catch (ex) {
4666
4522
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4754,42 +4610,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4754
4610
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
4755
4611
  }
4756
4612
 
4613
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4614
+ // see adapter code documentation for more information on the request object's fields
4615
+ const reqObj = {
4616
+ payload: bodyVars,
4617
+ uriPathVars: pathVars,
4618
+ uriQuery: queryParams,
4619
+ addlHeaders: thisHeaderData
4620
+ };
4621
+
4757
4622
  try {
4758
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4759
- // see adapter code documentation for more information on the request object's fields
4760
- return this.getAuthorization('GET', `/${restVer}/queryloggingconfig/${id}`, null, stsParams, roleName, (signature, sigerr) => {
4761
- if (sigerr) {
4762
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4623
+ // Make the call -
4624
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4625
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getQueryLoggingConfig', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/queryloggingconfig/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4626
+ // if we received an error or their is no response on the results
4627
+ // return an error
4628
+ if (irReturnError) {
4629
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4630
+ return callback(null, irReturnError);
4631
+ }
4632
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4633
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getQueryLoggingConfigSTSRole'], null, null, null);
4763
4634
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4764
4635
  return callback(null, errorObj);
4765
4636
  }
4766
- Object.assign(thisHeaderData, signature);
4767
- const reqObj = {
4768
- payload: bodyVars,
4769
- uriPathVars: pathVars,
4770
- uriQuery: queryParams,
4771
- addlHeaders: thisHeaderData
4772
- };
4773
-
4774
- // Make the call -
4775
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4776
- return this.requestHandlerInst.identifyRequest('Rest', 'getQueryLoggingConfig', reqObj, true, (irReturnData, irReturnError) => {
4777
- // if we received an error or their is no response on the results
4778
- // return an error
4779
- if (irReturnError) {
4780
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4781
- return callback(null, irReturnError);
4782
- }
4783
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4784
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getQueryLoggingConfigSTSRole'], null, null, null);
4785
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4786
- return callback(null, errorObj);
4787
- }
4788
4637
 
4789
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4790
- // return the response
4791
- return callback(irReturnData, null);
4792
- });
4638
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4639
+ // return the response
4640
+ return callback(irReturnData, null);
4793
4641
  });
4794
4642
  } catch (ex) {
4795
4643
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -4883,42 +4731,34 @@ class AmazonRoute53 extends AdapterBaseCl {
4883
4731
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
4884
4732
  }
4885
4733
 
4734
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4735
+ // see adapter code documentation for more information on the request object's fields
4736
+ const reqObj = {
4737
+ payload: bodyVars,
4738
+ uriPathVars: pathVars,
4739
+ uriQuery: queryParams,
4740
+ addlHeaders: thisHeaderData
4741
+ };
4742
+
4886
4743
  try {
4887
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4888
- // see adapter code documentation for more information on the request object's fields
4889
- return this.getAuthorization('DELETE', `/${restVer}/delegationset/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
4890
- if (sigerr) {
4891
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4744
+ // Make the call -
4745
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4746
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteReusableDelegationSet', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/delegationset/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4747
+ // if we received an error or their is no response on the results
4748
+ // return an error
4749
+ if (irReturnError) {
4750
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4751
+ return callback(null, irReturnError);
4752
+ }
4753
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4754
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteReusableDelegationSetSTSRole'], null, null, null);
4892
4755
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4893
4756
  return callback(null, errorObj);
4894
4757
  }
4895
- Object.assign(thisHeaderData, signature);
4896
- const reqObj = {
4897
- payload: bodyVars,
4898
- uriPathVars: pathVars,
4899
- uriQuery: queryParams,
4900
- addlHeaders: thisHeaderData
4901
- };
4902
-
4903
- // Make the call -
4904
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4905
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteReusableDelegationSet', reqObj, false, (irReturnData, irReturnError) => {
4906
- // if we received an error or their is no response on the results
4907
- // return an error
4908
- if (irReturnError) {
4909
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4910
- return callback(null, irReturnError);
4911
- }
4912
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4913
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteReusableDelegationSetSTSRole'], null, null, null);
4914
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4915
- return callback(null, errorObj);
4916
- }
4917
4758
 
4918
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4919
- // return the response
4920
- return callback(irReturnData, null);
4921
- });
4759
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4760
+ // return the response
4761
+ return callback(irReturnData, null);
4922
4762
  });
4923
4763
  } catch (ex) {
4924
4764
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5012,42 +4852,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5012
4852
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
5013
4853
  }
5014
4854
 
4855
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4856
+ // see adapter code documentation for more information on the request object's fields
4857
+ const reqObj = {
4858
+ payload: bodyVars,
4859
+ uriPathVars: pathVars,
4860
+ uriQuery: queryParams,
4861
+ addlHeaders: thisHeaderData
4862
+ };
4863
+
5015
4864
  try {
5016
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5017
- // see adapter code documentation for more information on the request object's fields
5018
- return this.getAuthorization('GET', `/${restVer}/delegationset/${id}`, null, stsParams, roleName, (signature, sigerr) => {
5019
- if (sigerr) {
5020
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4865
+ // Make the call -
4866
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4867
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getReusableDelegationSet', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/delegationset/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4868
+ // if we received an error or their is no response on the results
4869
+ // return an error
4870
+ if (irReturnError) {
4871
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4872
+ return callback(null, irReturnError);
4873
+ }
4874
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4875
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getReusableDelegationSetSTSRole'], null, null, null);
5021
4876
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5022
4877
  return callback(null, errorObj);
5023
4878
  }
5024
- Object.assign(thisHeaderData, signature);
5025
- const reqObj = {
5026
- payload: bodyVars,
5027
- uriPathVars: pathVars,
5028
- uriQuery: queryParams,
5029
- addlHeaders: thisHeaderData
5030
- };
5031
-
5032
- // Make the call -
5033
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5034
- return this.requestHandlerInst.identifyRequest('Rest', 'getReusableDelegationSet', reqObj, true, (irReturnData, irReturnError) => {
5035
- // if we received an error or their is no response on the results
5036
- // return an error
5037
- if (irReturnError) {
5038
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5039
- return callback(null, irReturnError);
5040
- }
5041
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5042
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getReusableDelegationSetSTSRole'], null, null, null);
5043
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5044
- return callback(null, errorObj);
5045
- }
5046
4879
 
5047
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5048
- // return the response
5049
- return callback(irReturnData, null);
5050
- });
4880
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4881
+ // return the response
4882
+ return callback(irReturnData, null);
5051
4883
  });
5052
4884
  } catch (ex) {
5053
4885
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5148,42 +4980,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5148
4980
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
5149
4981
  }
5150
4982
 
4983
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4984
+ // see adapter code documentation for more information on the request object's fields
4985
+ const reqObj = {
4986
+ payload: bodyVars,
4987
+ uriPathVars: pathVars,
4988
+ uriQuery: queryParams,
4989
+ addlHeaders: thisHeaderData
4990
+ };
4991
+
5151
4992
  try {
5152
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5153
- // see adapter code documentation for more information on the request object's fields
5154
- return this.getAuthorization('DELETE', `/${restVer}/trafficpolicy/${id}/${version}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
5155
- if (sigerr) {
5156
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
4993
+ // Make the call -
4994
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4995
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteTrafficPolicy', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicy/${id}/${version}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
4996
+ // if we received an error or their is no response on the results
4997
+ // return an error
4998
+ if (irReturnError) {
4999
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5000
+ return callback(null, irReturnError);
5001
+ }
5002
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5003
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteTrafficPolicySTSRole'], null, null, null);
5157
5004
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5158
5005
  return callback(null, errorObj);
5159
5006
  }
5160
- Object.assign(thisHeaderData, signature);
5161
- const reqObj = {
5162
- payload: bodyVars,
5163
- uriPathVars: pathVars,
5164
- uriQuery: queryParams,
5165
- addlHeaders: thisHeaderData
5166
- };
5167
5007
 
5168
- // Make the call -
5169
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5170
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteTrafficPolicy', reqObj, false, (irReturnData, irReturnError) => {
5171
- // if we received an error or their is no response on the results
5172
- // return an error
5173
- if (irReturnError) {
5174
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5175
- return callback(null, irReturnError);
5176
- }
5177
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5178
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteTrafficPolicySTSRole'], null, null, null);
5179
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5180
- return callback(null, errorObj);
5181
- }
5182
-
5183
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5184
- // return the response
5185
- return callback(irReturnData, null);
5186
- });
5008
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5009
+ // return the response
5010
+ return callback(irReturnData, null);
5187
5011
  });
5188
5012
  } catch (ex) {
5189
5013
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5284,42 +5108,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5284
5108
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
5285
5109
  }
5286
5110
 
5111
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5112
+ // see adapter code documentation for more information on the request object's fields
5113
+ const reqObj = {
5114
+ payload: bodyVars,
5115
+ uriPathVars: pathVars,
5116
+ uriQuery: queryParams,
5117
+ addlHeaders: thisHeaderData
5118
+ };
5119
+
5287
5120
  try {
5288
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5289
- // see adapter code documentation for more information on the request object's fields
5290
- return this.getAuthorization('GET', `/${restVer}/trafficpolicy/${id}/${version}`, null, stsParams, roleName, (signature, sigerr) => {
5291
- if (sigerr) {
5292
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5121
+ // Make the call -
5122
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5123
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getTrafficPolicy', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicy/${id}/${version}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5124
+ // if we received an error or their is no response on the results
5125
+ // return an error
5126
+ if (irReturnError) {
5127
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5128
+ return callback(null, irReturnError);
5129
+ }
5130
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5131
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getTrafficPolicySTSRole'], null, null, null);
5293
5132
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5294
5133
  return callback(null, errorObj);
5295
5134
  }
5296
- Object.assign(thisHeaderData, signature);
5297
- const reqObj = {
5298
- payload: bodyVars,
5299
- uriPathVars: pathVars,
5300
- uriQuery: queryParams,
5301
- addlHeaders: thisHeaderData
5302
- };
5303
-
5304
- // Make the call -
5305
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5306
- return this.requestHandlerInst.identifyRequest('Rest', 'getTrafficPolicy', reqObj, true, (irReturnData, irReturnError) => {
5307
- // if we received an error or their is no response on the results
5308
- // return an error
5309
- if (irReturnError) {
5310
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5311
- return callback(null, irReturnError);
5312
- }
5313
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5314
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getTrafficPolicySTSRole'], null, null, null);
5315
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5316
- return callback(null, errorObj);
5317
- }
5318
5135
 
5319
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5320
- // return the response
5321
- return callback(irReturnData, null);
5322
- });
5136
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5137
+ // return the response
5138
+ return callback(irReturnData, null);
5323
5139
  });
5324
5140
  } catch (ex) {
5325
5141
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5427,42 +5243,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5427
5243
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
5428
5244
  }
5429
5245
 
5246
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5247
+ // see adapter code documentation for more information on the request object's fields
5248
+ const reqObj = {
5249
+ payload: bodyVars,
5250
+ uriPathVars: pathVars,
5251
+ uriQuery: queryParams,
5252
+ addlHeaders: thisHeaderData
5253
+ };
5254
+
5430
5255
  try {
5431
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5432
- // see adapter code documentation for more information on the request object's fields
5433
- return this.getAuthorization('POST', `/${restVer}/trafficpolicy/${id}/${version}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
5434
- if (sigerr) {
5435
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5256
+ // Make the call -
5257
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5258
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'updateTrafficPolicyComment', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicy/${id}/${version}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5259
+ // if we received an error or their is no response on the results
5260
+ // return an error
5261
+ if (irReturnError) {
5262
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5263
+ return callback(null, irReturnError);
5264
+ }
5265
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5266
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateTrafficPolicyCommentSTSRole'], null, null, null);
5436
5267
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5437
5268
  return callback(null, errorObj);
5438
5269
  }
5439
- Object.assign(thisHeaderData, signature);
5440
- const reqObj = {
5441
- payload: bodyVars,
5442
- uriPathVars: pathVars,
5443
- uriQuery: queryParams,
5444
- addlHeaders: thisHeaderData
5445
- };
5446
-
5447
- // Make the call -
5448
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5449
- return this.requestHandlerInst.identifyRequest('Rest', 'updateTrafficPolicyComment', reqObj, true, (irReturnData, irReturnError) => {
5450
- // if we received an error or their is no response on the results
5451
- // return an error
5452
- if (irReturnError) {
5453
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5454
- return callback(null, irReturnError);
5455
- }
5456
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5457
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateTrafficPolicyCommentSTSRole'], null, null, null);
5458
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5459
- return callback(null, errorObj);
5460
- }
5461
5270
 
5462
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5463
- // return the response
5464
- return callback(irReturnData, null);
5465
- });
5271
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5272
+ // return the response
5273
+ return callback(irReturnData, null);
5466
5274
  });
5467
5275
  } catch (ex) {
5468
5276
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5556,42 +5364,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5556
5364
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
5557
5365
  }
5558
5366
 
5367
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5368
+ // see adapter code documentation for more information on the request object's fields
5369
+ const reqObj = {
5370
+ payload: bodyVars,
5371
+ uriPathVars: pathVars,
5372
+ uriQuery: queryParams,
5373
+ addlHeaders: thisHeaderData
5374
+ };
5375
+
5559
5376
  try {
5560
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5561
- // see adapter code documentation for more information on the request object's fields
5562
- return this.getAuthorization('DELETE', `/${restVer}/trafficpolicyinstance/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
5563
- if (sigerr) {
5564
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5377
+ // Make the call -
5378
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5379
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteTrafficPolicyInstance', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstance/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5380
+ // if we received an error or their is no response on the results
5381
+ // return an error
5382
+ if (irReturnError) {
5383
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5384
+ return callback(null, irReturnError);
5385
+ }
5386
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5387
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteTrafficPolicyInstanceSTSRole'], null, null, null);
5565
5388
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5566
5389
  return callback(null, errorObj);
5567
5390
  }
5568
- Object.assign(thisHeaderData, signature);
5569
- const reqObj = {
5570
- payload: bodyVars,
5571
- uriPathVars: pathVars,
5572
- uriQuery: queryParams,
5573
- addlHeaders: thisHeaderData
5574
- };
5575
-
5576
- // Make the call -
5577
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5578
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteTrafficPolicyInstance', reqObj, false, (irReturnData, irReturnError) => {
5579
- // if we received an error or their is no response on the results
5580
- // return an error
5581
- if (irReturnError) {
5582
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5583
- return callback(null, irReturnError);
5584
- }
5585
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5586
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteTrafficPolicyInstanceSTSRole'], null, null, null);
5587
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5588
- return callback(null, errorObj);
5589
- }
5590
5391
 
5591
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5592
- // return the response
5593
- return callback(irReturnData, null);
5594
- });
5392
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5393
+ // return the response
5394
+ return callback(irReturnData, null);
5595
5395
  });
5596
5396
  } catch (ex) {
5597
5397
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5685,42 +5485,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5685
5485
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
5686
5486
  }
5687
5487
 
5488
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5489
+ // see adapter code documentation for more information on the request object's fields
5490
+ const reqObj = {
5491
+ payload: bodyVars,
5492
+ uriPathVars: pathVars,
5493
+ uriQuery: queryParams,
5494
+ addlHeaders: thisHeaderData
5495
+ };
5496
+
5688
5497
  try {
5689
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5690
- // see adapter code documentation for more information on the request object's fields
5691
- return this.getAuthorization('GET', `/${restVer}/trafficpolicyinstance/${id}`, null, stsParams, roleName, (signature, sigerr) => {
5692
- if (sigerr) {
5693
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5498
+ // Make the call -
5499
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5500
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getTrafficPolicyInstance', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstance/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5501
+ // if we received an error or their is no response on the results
5502
+ // return an error
5503
+ if (irReturnError) {
5504
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5505
+ return callback(null, irReturnError);
5506
+ }
5507
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5508
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getTrafficPolicyInstanceSTSRole'], null, null, null);
5694
5509
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5695
5510
  return callback(null, errorObj);
5696
5511
  }
5697
- Object.assign(thisHeaderData, signature);
5698
- const reqObj = {
5699
- payload: bodyVars,
5700
- uriPathVars: pathVars,
5701
- uriQuery: queryParams,
5702
- addlHeaders: thisHeaderData
5703
- };
5704
-
5705
- // Make the call -
5706
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5707
- return this.requestHandlerInst.identifyRequest('Rest', 'getTrafficPolicyInstance', reqObj, true, (irReturnData, irReturnError) => {
5708
- // if we received an error or their is no response on the results
5709
- // return an error
5710
- if (irReturnError) {
5711
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5712
- return callback(null, irReturnError);
5713
- }
5714
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5715
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getTrafficPolicyInstanceSTSRole'], null, null, null);
5716
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5717
- return callback(null, errorObj);
5718
- }
5719
5512
 
5720
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5721
- // return the response
5722
- return callback(irReturnData, null);
5723
- });
5513
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5514
+ // return the response
5515
+ return callback(irReturnData, null);
5724
5516
  });
5725
5517
  } catch (ex) {
5726
5518
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5821,42 +5613,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5821
5613
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
5822
5614
  }
5823
5615
 
5616
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5617
+ // see adapter code documentation for more information on the request object's fields
5618
+ const reqObj = {
5619
+ payload: bodyVars,
5620
+ uriPathVars: pathVars,
5621
+ uriQuery: queryParams,
5622
+ addlHeaders: thisHeaderData
5623
+ };
5624
+
5824
5625
  try {
5825
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5826
- // see adapter code documentation for more information on the request object's fields
5827
- return this.getAuthorization('POST', `/${restVer}/trafficpolicyinstance/${id}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
5828
- if (sigerr) {
5829
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5626
+ // Make the call -
5627
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5628
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'updateTrafficPolicyInstance', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstance/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5629
+ // if we received an error or their is no response on the results
5630
+ // return an error
5631
+ if (irReturnError) {
5632
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5633
+ return callback(null, irReturnError);
5634
+ }
5635
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5636
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateTrafficPolicyInstanceSTSRole'], null, null, null);
5830
5637
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5831
5638
  return callback(null, errorObj);
5832
5639
  }
5833
- Object.assign(thisHeaderData, signature);
5834
- const reqObj = {
5835
- payload: bodyVars,
5836
- uriPathVars: pathVars,
5837
- uriQuery: queryParams,
5838
- addlHeaders: thisHeaderData
5839
- };
5840
-
5841
- // Make the call -
5842
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5843
- return this.requestHandlerInst.identifyRequest('Rest', 'updateTrafficPolicyInstance', reqObj, true, (irReturnData, irReturnError) => {
5844
- // if we received an error or their is no response on the results
5845
- // return an error
5846
- if (irReturnError) {
5847
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5848
- return callback(null, irReturnError);
5849
- }
5850
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5851
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateTrafficPolicyInstanceSTSRole'], null, null, null);
5852
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5853
- return callback(null, errorObj);
5854
- }
5855
5640
 
5856
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5857
- // return the response
5858
- return callback(irReturnData, null);
5859
- });
5641
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5642
+ // return the response
5643
+ return callback(irReturnData, null);
5860
5644
  });
5861
5645
  } catch (ex) {
5862
5646
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -5957,42 +5741,34 @@ class AmazonRoute53 extends AdapterBaseCl {
5957
5741
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
5958
5742
  }
5959
5743
 
5744
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5745
+ // see adapter code documentation for more information on the request object's fields
5746
+ const reqObj = {
5747
+ payload: bodyVars,
5748
+ uriPathVars: pathVars,
5749
+ uriQuery: queryParams,
5750
+ addlHeaders: thisHeaderData
5751
+ };
5752
+
5960
5753
  try {
5961
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5962
- // see adapter code documentation for more information on the request object's fields
5963
- return this.getAuthorization('DELETE', `/${restVer}/hostedzone/${id}/deauthorizevpcassociation`, bodyVars, stsParams, roleName, (signature, sigerr) => {
5964
- if (sigerr) {
5965
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5754
+ // Make the call -
5755
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5756
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'deleteVPCAssociationAuthorization', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/deauthorizevpcassociation?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5757
+ // if we received an error or their is no response on the results
5758
+ // return an error
5759
+ if (irReturnError) {
5760
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5761
+ return callback(null, irReturnError);
5762
+ }
5763
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5764
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteVPCAssociationAuthorizationSTSRole'], null, null, null);
5966
5765
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5967
5766
  return callback(null, errorObj);
5968
5767
  }
5969
- Object.assign(thisHeaderData, signature);
5970
- const reqObj = {
5971
- payload: bodyVars,
5972
- uriPathVars: pathVars,
5973
- uriQuery: queryParams,
5974
- addlHeaders: thisHeaderData
5975
- };
5976
-
5977
- // Make the call -
5978
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5979
- return this.requestHandlerInst.identifyRequest('Rest', 'deleteVPCAssociationAuthorization', reqObj, true, (irReturnData, irReturnError) => {
5980
- // if we received an error or their is no response on the results
5981
- // return an error
5982
- if (irReturnError) {
5983
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5984
- return callback(null, irReturnError);
5985
- }
5986
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5987
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteVPCAssociationAuthorizationSTSRole'], null, null, null);
5988
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5989
- return callback(null, errorObj);
5990
- }
5991
5768
 
5992
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5993
- // return the response
5994
- return callback(irReturnData, null);
5995
- });
5769
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5770
+ // return the response
5771
+ return callback(irReturnData, null);
5996
5772
  });
5997
5773
  } catch (ex) {
5998
5774
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6086,42 +5862,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6086
5862
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6087
5863
  }
6088
5864
 
5865
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5866
+ // see adapter code documentation for more information on the request object's fields
5867
+ const reqObj = {
5868
+ payload: bodyVars,
5869
+ uriPathVars: pathVars,
5870
+ uriQuery: queryParams,
5871
+ addlHeaders: thisHeaderData
5872
+ };
5873
+
6089
5874
  try {
6090
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6091
- // see adapter code documentation for more information on the request object's fields
6092
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}/disable-dnssec`, bodyVars, stsParams, roleName, (signature, sigerr) => {
6093
- if (sigerr) {
6094
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
5875
+ // Make the call -
5876
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
5877
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'disableHostedZoneDNSSEC', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/disable-dnssec?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
5878
+ // if we received an error or their is no response on the results
5879
+ // return an error
5880
+ if (irReturnError) {
5881
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
5882
+ return callback(null, irReturnError);
5883
+ }
5884
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
5885
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['disableHostedZoneDNSSECSTSRole'], null, null, null);
6095
5886
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6096
5887
  return callback(null, errorObj);
6097
5888
  }
6098
- Object.assign(thisHeaderData, signature);
6099
- const reqObj = {
6100
- payload: bodyVars,
6101
- uriPathVars: pathVars,
6102
- uriQuery: queryParams,
6103
- addlHeaders: thisHeaderData
6104
- };
6105
-
6106
- // Make the call -
6107
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6108
- return this.requestHandlerInst.identifyRequest('Rest', 'disableHostedZoneDNSSEC', reqObj, true, (irReturnData, irReturnError) => {
6109
- // if we received an error or their is no response on the results
6110
- // return an error
6111
- if (irReturnError) {
6112
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6113
- return callback(null, irReturnError);
6114
- }
6115
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6116
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['disableHostedZoneDNSSECSTSRole'], null, null, null);
6117
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6118
- return callback(null, errorObj);
6119
- }
6120
5889
 
6121
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6122
- // return the response
6123
- return callback(irReturnData, null);
6124
- });
5890
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
5891
+ // return the response
5892
+ return callback(irReturnData, null);
6125
5893
  });
6126
5894
  } catch (ex) {
6127
5895
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6222,42 +5990,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6222
5990
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
6223
5991
  }
6224
5992
 
5993
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
5994
+ // see adapter code documentation for more information on the request object's fields
5995
+ const reqObj = {
5996
+ payload: bodyVars,
5997
+ uriPathVars: pathVars,
5998
+ uriQuery: queryParams,
5999
+ addlHeaders: thisHeaderData
6000
+ };
6001
+
6225
6002
  try {
6226
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6227
- // see adapter code documentation for more information on the request object's fields
6228
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}/disassociatevpc`, bodyVars, stsParams, roleName, (signature, sigerr) => {
6229
- if (sigerr) {
6230
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6003
+ // Make the call -
6004
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6005
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'disassociateVPCFromHostedZone', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/disassociatevpc?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6006
+ // if we received an error or their is no response on the results
6007
+ // return an error
6008
+ if (irReturnError) {
6009
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6010
+ return callback(null, irReturnError);
6011
+ }
6012
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6013
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['disassociateVPCFromHostedZoneSTSRole'], null, null, null);
6231
6014
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6232
6015
  return callback(null, errorObj);
6233
6016
  }
6234
- Object.assign(thisHeaderData, signature);
6235
- const reqObj = {
6236
- payload: bodyVars,
6237
- uriPathVars: pathVars,
6238
- uriQuery: queryParams,
6239
- addlHeaders: thisHeaderData
6240
- };
6241
6017
 
6242
- // Make the call -
6243
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6244
- return this.requestHandlerInst.identifyRequest('Rest', 'disassociateVPCFromHostedZone', reqObj, true, (irReturnData, irReturnError) => {
6245
- // if we received an error or their is no response on the results
6246
- // return an error
6247
- if (irReturnError) {
6248
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6249
- return callback(null, irReturnError);
6250
- }
6251
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6252
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['disassociateVPCFromHostedZoneSTSRole'], null, null, null);
6253
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6254
- return callback(null, errorObj);
6255
- }
6256
-
6257
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6258
- // return the response
6259
- return callback(irReturnData, null);
6260
- });
6018
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6019
+ // return the response
6020
+ return callback(irReturnData, null);
6261
6021
  });
6262
6022
  } catch (ex) {
6263
6023
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6351,42 +6111,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6351
6111
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6352
6112
  }
6353
6113
 
6114
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6115
+ // see adapter code documentation for more information on the request object's fields
6116
+ const reqObj = {
6117
+ payload: bodyVars,
6118
+ uriPathVars: pathVars,
6119
+ uriQuery: queryParams,
6120
+ addlHeaders: thisHeaderData
6121
+ };
6122
+
6354
6123
  try {
6355
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6356
- // see adapter code documentation for more information on the request object's fields
6357
- return this.getAuthorization('POST', `/${restVer}/hostedzone/${id}/enable-dnssec`, bodyVars, stsParams, roleName, (signature, sigerr) => {
6358
- if (sigerr) {
6359
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6124
+ // Make the call -
6125
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6126
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'enableHostedZoneDNSSEC', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/enable-dnssec?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6127
+ // if we received an error or their is no response on the results
6128
+ // return an error
6129
+ if (irReturnError) {
6130
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6131
+ return callback(null, irReturnError);
6132
+ }
6133
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6134
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['enableHostedZoneDNSSECSTSRole'], null, null, null);
6360
6135
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6361
6136
  return callback(null, errorObj);
6362
6137
  }
6363
- Object.assign(thisHeaderData, signature);
6364
- const reqObj = {
6365
- payload: bodyVars,
6366
- uriPathVars: pathVars,
6367
- uriQuery: queryParams,
6368
- addlHeaders: thisHeaderData
6369
- };
6370
-
6371
- // Make the call -
6372
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6373
- return this.requestHandlerInst.identifyRequest('Rest', 'enableHostedZoneDNSSEC', reqObj, true, (irReturnData, irReturnError) => {
6374
- // if we received an error or their is no response on the results
6375
- // return an error
6376
- if (irReturnError) {
6377
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6378
- return callback(null, irReturnError);
6379
- }
6380
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6381
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['enableHostedZoneDNSSECSTSRole'], null, null, null);
6382
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6383
- return callback(null, errorObj);
6384
- }
6385
6138
 
6386
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6387
- // return the response
6388
- return callback(irReturnData, null);
6389
- });
6139
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6140
+ // return the response
6141
+ return callback(irReturnData, null);
6390
6142
  });
6391
6143
  } catch (ex) {
6392
6144
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6480,42 +6232,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6480
6232
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6481
6233
  }
6482
6234
 
6235
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6236
+ // see adapter code documentation for more information on the request object's fields
6237
+ const reqObj = {
6238
+ payload: bodyVars,
6239
+ uriPathVars: pathVars,
6240
+ uriQuery: queryParams,
6241
+ addlHeaders: thisHeaderData
6242
+ };
6243
+
6483
6244
  try {
6484
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6485
- // see adapter code documentation for more information on the request object's fields
6486
- return this.getAuthorization('GET', `/${restVer}/accountlimit/${type}`, null, stsParams, roleName, (signature, sigerr) => {
6487
- if (sigerr) {
6488
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6245
+ // Make the call -
6246
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6247
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'changeResourceRecordSets', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/accountlimit/${type}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6248
+ // if we received an error or their is no response on the results
6249
+ // return an error
6250
+ if (irReturnError) {
6251
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6252
+ return callback(null, irReturnError);
6253
+ }
6254
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6255
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getAccountLimitSTSRole'], null, null, null);
6489
6256
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6490
6257
  return callback(null, errorObj);
6491
6258
  }
6492
- Object.assign(thisHeaderData, signature);
6493
- const reqObj = {
6494
- payload: bodyVars,
6495
- uriPathVars: pathVars,
6496
- uriQuery: queryParams,
6497
- addlHeaders: thisHeaderData
6498
- };
6499
-
6500
- // Make the call -
6501
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6502
- return this.requestHandlerInst.identifyRequest('Rest', 'getAccountLimit', reqObj, true, (irReturnData, irReturnError) => {
6503
- // if we received an error or their is no response on the results
6504
- // return an error
6505
- if (irReturnError) {
6506
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6507
- return callback(null, irReturnError);
6508
- }
6509
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6510
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getAccountLimitSTSRole'], null, null, null);
6511
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6512
- return callback(null, errorObj);
6513
- }
6514
6259
 
6515
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6516
- // return the response
6517
- return callback(irReturnData, null);
6518
- });
6260
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6261
+ // return the response
6262
+ return callback(irReturnData, null);
6519
6263
  });
6520
6264
  } catch (ex) {
6521
6265
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6609,42 +6353,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6609
6353
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6610
6354
  }
6611
6355
 
6356
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6357
+ // see adapter code documentation for more information on the request object's fields
6358
+ const reqObj = {
6359
+ payload: bodyVars,
6360
+ uriPathVars: pathVars,
6361
+ uriQuery: queryParams,
6362
+ addlHeaders: thisHeaderData
6363
+ };
6364
+
6612
6365
  try {
6613
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6614
- // see adapter code documentation for more information on the request object's fields
6615
- return this.getAuthorization('GET', `/${restVer}/change/${id}`, null, stsParams, roleName, (signature, sigerr) => {
6616
- if (sigerr) {
6617
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6366
+ // Make the call -
6367
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6368
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getChange', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/change/${id}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6369
+ // if we received an error or their is no response on the results
6370
+ // return an error
6371
+ if (irReturnError) {
6372
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6373
+ return callback(null, irReturnError);
6374
+ }
6375
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6376
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getChangeSTSRole'], null, null, null);
6618
6377
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6619
6378
  return callback(null, errorObj);
6620
6379
  }
6621
- Object.assign(thisHeaderData, signature);
6622
- const reqObj = {
6623
- payload: bodyVars,
6624
- uriPathVars: pathVars,
6625
- uriQuery: queryParams,
6626
- addlHeaders: thisHeaderData
6627
- };
6628
-
6629
- // Make the call -
6630
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6631
- return this.requestHandlerInst.identifyRequest('Rest', 'getChange', reqObj, true, (irReturnData, irReturnError) => {
6632
- // if we received an error or their is no response on the results
6633
- // return an error
6634
- if (irReturnError) {
6635
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6636
- return callback(null, irReturnError);
6637
- }
6638
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6639
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getChangeSTSRole'], null, null, null);
6640
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6641
- return callback(null, errorObj);
6642
- }
6643
6380
 
6644
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6645
- // return the response
6646
- return callback(irReturnData, null);
6647
- });
6381
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6382
+ // return the response
6383
+ return callback(irReturnData, null);
6648
6384
  });
6649
6385
  } catch (ex) {
6650
6386
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6731,42 +6467,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6731
6467
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6732
6468
  }
6733
6469
 
6470
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6471
+ // see adapter code documentation for more information on the request object's fields
6472
+ const reqObj = {
6473
+ payload: bodyVars,
6474
+ uriPathVars: pathVars,
6475
+ uriQuery: queryParams,
6476
+ addlHeaders: thisHeaderData
6477
+ };
6478
+
6734
6479
  try {
6735
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6736
- // see adapter code documentation for more information on the request object's fields
6737
- return this.getAuthorization('GET', `/${restVer}/checkeripranges`, null, stsParams, roleName, (signature, sigerr) => {
6738
- if (sigerr) {
6739
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6480
+ // Make the call -
6481
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6482
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getCheckerIpRanges', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/checkeripranges?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6483
+ // if we received an error or their is no response on the results
6484
+ // return an error
6485
+ if (irReturnError) {
6486
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6487
+ return callback(null, irReturnError);
6488
+ }
6489
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6490
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getCheckerIpRangesSTSRole'], null, null, null);
6740
6491
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6741
6492
  return callback(null, errorObj);
6742
6493
  }
6743
- Object.assign(thisHeaderData, signature);
6744
- const reqObj = {
6745
- payload: bodyVars,
6746
- uriPathVars: pathVars,
6747
- uriQuery: queryParams,
6748
- addlHeaders: thisHeaderData
6749
- };
6750
-
6751
- // Make the call -
6752
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6753
- return this.requestHandlerInst.identifyRequest('Rest', 'getCheckerIpRanges', reqObj, true, (irReturnData, irReturnError) => {
6754
- // if we received an error or their is no response on the results
6755
- // return an error
6756
- if (irReturnError) {
6757
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6758
- return callback(null, irReturnError);
6759
- }
6760
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6761
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getCheckerIpRangesSTSRole'], null, null, null);
6762
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6763
- return callback(null, errorObj);
6764
- }
6765
6494
 
6766
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6767
- // return the response
6768
- return callback(irReturnData, null);
6769
- });
6495
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6496
+ // return the response
6497
+ return callback(irReturnData, null);
6770
6498
  });
6771
6499
  } catch (ex) {
6772
6500
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6860,42 +6588,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6860
6588
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6861
6589
  }
6862
6590
 
6591
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6592
+ // see adapter code documentation for more information on the request object's fields
6593
+ const reqObj = {
6594
+ payload: bodyVars,
6595
+ uriPathVars: pathVars,
6596
+ uriQuery: queryParams,
6597
+ addlHeaders: thisHeaderData
6598
+ };
6599
+
6863
6600
  try {
6864
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6865
- // see adapter code documentation for more information on the request object's fields
6866
- return this.getAuthorization('GET', `/${restVer}/hostedzone/${id}/dnssec`, null, stsParams, roleName, (signature, sigerr) => {
6867
- if (sigerr) {
6868
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6601
+ // Make the call -
6602
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6603
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getDNSSEC', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/dnssec?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6604
+ // if we received an error or their is no response on the results
6605
+ // return an error
6606
+ if (irReturnError) {
6607
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6608
+ return callback(null, irReturnError);
6609
+ }
6610
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6611
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getDNSSECSTSRole'], null, null, null);
6869
6612
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6870
6613
  return callback(null, errorObj);
6871
6614
  }
6872
- Object.assign(thisHeaderData, signature);
6873
- const reqObj = {
6874
- payload: bodyVars,
6875
- uriPathVars: pathVars,
6876
- uriQuery: queryParams,
6877
- addlHeaders: thisHeaderData
6878
- };
6879
6615
 
6880
- // Make the call -
6881
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6882
- return this.requestHandlerInst.identifyRequest('Rest', 'getDNSSEC', reqObj, true, (irReturnData, irReturnError) => {
6883
- // if we received an error or their is no response on the results
6884
- // return an error
6885
- if (irReturnError) {
6886
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6887
- return callback(null, irReturnError);
6888
- }
6889
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6890
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getDNSSECSTSRole'], null, null, null);
6891
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6892
- return callback(null, errorObj);
6893
- }
6894
-
6895
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6896
- // return the response
6897
- return callback(irReturnData, null);
6898
- });
6616
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6617
+ // return the response
6618
+ return callback(irReturnData, null);
6899
6619
  });
6900
6620
  } catch (ex) {
6901
6621
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -6988,42 +6708,34 @@ class AmazonRoute53 extends AdapterBaseCl {
6988
6708
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
6989
6709
  }
6990
6710
 
6711
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6712
+ // see adapter code documentation for more information on the request object's fields
6713
+ const reqObj = {
6714
+ payload: bodyVars,
6715
+ uriPathVars: pathVars,
6716
+ uriQuery: queryParams,
6717
+ addlHeaders: thisHeaderData
6718
+ };
6719
+
6991
6720
  try {
6992
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6993
- // see adapter code documentation for more information on the request object's fields
6994
- return this.getAuthorization('GET', `/${restVer}/geolocation`, null, stsParams, roleName, (signature, sigerr) => {
6995
- if (sigerr) {
6996
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6721
+ // Make the call -
6722
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6723
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getGeoLocation', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/geolocation?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6724
+ // if we received an error or their is no response on the results
6725
+ // return an error
6726
+ if (irReturnError) {
6727
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6728
+ return callback(null, irReturnError);
6729
+ }
6730
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6731
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getGeoLocationSTSRole'], null, null, null);
6997
6732
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6998
6733
  return callback(null, errorObj);
6999
6734
  }
7000
- Object.assign(thisHeaderData, signature);
7001
- const reqObj = {
7002
- payload: bodyVars,
7003
- uriPathVars: pathVars,
7004
- uriQuery: queryParams,
7005
- addlHeaders: thisHeaderData
7006
- };
7007
6735
 
7008
- // Make the call -
7009
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7010
- return this.requestHandlerInst.identifyRequest('Rest', 'getGeoLocation', reqObj, true, (irReturnData, irReturnError) => {
7011
- // if we received an error or their is no response on the results
7012
- // return an error
7013
- if (irReturnError) {
7014
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7015
- return callback(null, irReturnError);
7016
- }
7017
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7018
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getGeoLocationSTSRole'], null, null, null);
7019
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7020
- return callback(null, errorObj);
7021
- }
7022
-
7023
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7024
- // return the response
7025
- return callback(irReturnData, null);
7026
- });
6736
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6737
+ // return the response
6738
+ return callback(irReturnData, null);
7027
6739
  });
7028
6740
  } catch (ex) {
7029
6741
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7110,42 +6822,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7110
6822
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7111
6823
  }
7112
6824
 
6825
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6826
+ // see adapter code documentation for more information on the request object's fields
6827
+ const reqObj = {
6828
+ payload: bodyVars,
6829
+ uriPathVars: pathVars,
6830
+ uriQuery: queryParams,
6831
+ addlHeaders: thisHeaderData
6832
+ };
6833
+
7113
6834
  try {
7114
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7115
- // see adapter code documentation for more information on the request object's fields
7116
- return this.getAuthorization('GET', `/${restVer}/healthcheckcount`, null, stsParams, roleName, (signature, sigerr) => {
7117
- if (sigerr) {
7118
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6835
+ // Make the call -
6836
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6837
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHealthCheckCount', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheckcount?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6838
+ // if we received an error or their is no response on the results
6839
+ // return an error
6840
+ if (irReturnError) {
6841
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6842
+ return callback(null, irReturnError);
6843
+ }
6844
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6845
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckCountSTSRole'], null, null, null);
7119
6846
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7120
6847
  return callback(null, errorObj);
7121
6848
  }
7122
- Object.assign(thisHeaderData, signature);
7123
- const reqObj = {
7124
- payload: bodyVars,
7125
- uriPathVars: pathVars,
7126
- uriQuery: queryParams,
7127
- addlHeaders: thisHeaderData
7128
- };
7129
-
7130
- // Make the call -
7131
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7132
- return this.requestHandlerInst.identifyRequest('Rest', 'getHealthCheckCount', reqObj, true, (irReturnData, irReturnError) => {
7133
- // if we received an error or their is no response on the results
7134
- // return an error
7135
- if (irReturnError) {
7136
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7137
- return callback(null, irReturnError);
7138
- }
7139
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7140
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckCountSTSRole'], null, null, null);
7141
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7142
- return callback(null, errorObj);
7143
- }
7144
6849
 
7145
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7146
- // return the response
7147
- return callback(irReturnData, null);
7148
- });
6850
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6851
+ // return the response
6852
+ return callback(irReturnData, null);
7149
6853
  });
7150
6854
  } catch (ex) {
7151
6855
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7239,42 +6943,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7239
6943
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7240
6944
  }
7241
6945
 
6946
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
6947
+ // see adapter code documentation for more information on the request object's fields
6948
+ const reqObj = {
6949
+ payload: bodyVars,
6950
+ uriPathVars: pathVars,
6951
+ uriQuery: queryParams,
6952
+ addlHeaders: thisHeaderData
6953
+ };
6954
+
7242
6955
  try {
7243
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7244
- // see adapter code documentation for more information on the request object's fields
7245
- return this.getAuthorization('GET', `/${restVer}/healthcheck/${healthCheckId}/lastfailurereason`, null, stsParams, roleName, (signature, sigerr) => {
7246
- if (sigerr) {
7247
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
6956
+ // Make the call -
6957
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
6958
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHealthCheckLastFailureReason', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck/${healthCheckId}/lastfailurereason?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
6959
+ // if we received an error or their is no response on the results
6960
+ // return an error
6961
+ if (irReturnError) {
6962
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
6963
+ return callback(null, irReturnError);
6964
+ }
6965
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
6966
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckLastFailureReasonSTSRole'], null, null, null);
7248
6967
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7249
6968
  return callback(null, errorObj);
7250
6969
  }
7251
- Object.assign(thisHeaderData, signature);
7252
- const reqObj = {
7253
- payload: bodyVars,
7254
- uriPathVars: pathVars,
7255
- uriQuery: queryParams,
7256
- addlHeaders: thisHeaderData
7257
- };
7258
6970
 
7259
- // Make the call -
7260
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7261
- return this.requestHandlerInst.identifyRequest('Rest', 'getHealthCheckLastFailureReason', reqObj, true, (irReturnData, irReturnError) => {
7262
- // if we received an error or their is no response on the results
7263
- // return an error
7264
- if (irReturnError) {
7265
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7266
- return callback(null, irReturnError);
7267
- }
7268
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7269
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckLastFailureReasonSTSRole'], null, null, null);
7270
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7271
- return callback(null, errorObj);
7272
- }
7273
-
7274
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7275
- // return the response
7276
- return callback(irReturnData, null);
7277
- });
6971
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
6972
+ // return the response
6973
+ return callback(irReturnData, null);
7278
6974
  });
7279
6975
  } catch (ex) {
7280
6976
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7368,42 +7064,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7368
7064
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7369
7065
  }
7370
7066
 
7067
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7068
+ // see adapter code documentation for more information on the request object's fields
7069
+ const reqObj = {
7070
+ payload: bodyVars,
7071
+ uriPathVars: pathVars,
7072
+ uriQuery: queryParams,
7073
+ addlHeaders: thisHeaderData
7074
+ };
7075
+
7371
7076
  try {
7372
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7373
- // see adapter code documentation for more information on the request object's fields
7374
- return this.getAuthorization('GET', `/${restVer}/healthcheck/${healthCheckId}/status`, null, stsParams, roleName, (signature, sigerr) => {
7375
- if (sigerr) {
7376
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7077
+ // Make the call -
7078
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7079
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHealthCheckStatus', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/healthcheck/${healthCheckId}/status?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7080
+ // if we received an error or their is no response on the results
7081
+ // return an error
7082
+ if (irReturnError) {
7083
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7084
+ return callback(null, irReturnError);
7085
+ }
7086
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7087
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckStatusSTSRole'], null, null, null);
7377
7088
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7378
7089
  return callback(null, errorObj);
7379
7090
  }
7380
- Object.assign(thisHeaderData, signature);
7381
- const reqObj = {
7382
- payload: bodyVars,
7383
- uriPathVars: pathVars,
7384
- uriQuery: queryParams,
7385
- addlHeaders: thisHeaderData
7386
- };
7387
7091
 
7388
- // Make the call -
7389
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7390
- return this.requestHandlerInst.identifyRequest('Rest', 'getHealthCheckStatus', reqObj, true, (irReturnData, irReturnError) => {
7391
- // if we received an error or their is no response on the results
7392
- // return an error
7393
- if (irReturnError) {
7394
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7395
- return callback(null, irReturnError);
7396
- }
7397
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7398
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHealthCheckStatusSTSRole'], null, null, null);
7399
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7400
- return callback(null, errorObj);
7401
- }
7402
-
7403
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7404
- // return the response
7405
- return callback(irReturnData, null);
7406
- });
7092
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7093
+ // return the response
7094
+ return callback(irReturnData, null);
7407
7095
  });
7408
7096
  } catch (ex) {
7409
7097
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7490,42 +7178,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7490
7178
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7491
7179
  }
7492
7180
 
7181
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7182
+ // see adapter code documentation for more information on the request object's fields
7183
+ const reqObj = {
7184
+ payload: bodyVars,
7185
+ uriPathVars: pathVars,
7186
+ uriQuery: queryParams,
7187
+ addlHeaders: thisHeaderData
7188
+ };
7189
+
7493
7190
  try {
7494
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7495
- // see adapter code documentation for more information on the request object's fields
7496
- return this.getAuthorization('GET', `/${restVer}/hostedzonecount`, null, stsParams, roleName, (signature, sigerr) => {
7497
- if (sigerr) {
7498
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7191
+ // Make the call -
7192
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7193
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHostedZoneCount', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzonecount?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7194
+ // if we received an error or their is no response on the results
7195
+ // return an error
7196
+ if (irReturnError) {
7197
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7198
+ return callback(null, irReturnError);
7199
+ }
7200
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7201
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHostedZoneCountSTSRole'], null, null, null);
7499
7202
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7500
7203
  return callback(null, errorObj);
7501
7204
  }
7502
- Object.assign(thisHeaderData, signature);
7503
- const reqObj = {
7504
- payload: bodyVars,
7505
- uriPathVars: pathVars,
7506
- uriQuery: queryParams,
7507
- addlHeaders: thisHeaderData
7508
- };
7509
7205
 
7510
- // Make the call -
7511
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7512
- return this.requestHandlerInst.identifyRequest('Rest', 'getHostedZoneCount', reqObj, true, (irReturnData, irReturnError) => {
7513
- // if we received an error or their is no response on the results
7514
- // return an error
7515
- if (irReturnError) {
7516
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7517
- return callback(null, irReturnError);
7518
- }
7519
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7520
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHostedZoneCountSTSRole'], null, null, null);
7521
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7522
- return callback(null, errorObj);
7523
- }
7524
-
7525
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7526
- // return the response
7527
- return callback(irReturnData, null);
7528
- });
7206
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7207
+ // return the response
7208
+ return callback(irReturnData, null);
7529
7209
  });
7530
7210
  } catch (ex) {
7531
7211
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7626,42 +7306,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7626
7306
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7627
7307
  }
7628
7308
 
7309
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7310
+ // see adapter code documentation for more information on the request object's fields
7311
+ const reqObj = {
7312
+ payload: bodyVars,
7313
+ uriPathVars: pathVars,
7314
+ uriQuery: queryParams,
7315
+ addlHeaders: thisHeaderData
7316
+ };
7317
+
7629
7318
  try {
7630
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7631
- // see adapter code documentation for more information on the request object's fields
7632
- return this.getAuthorization('GET', `/${restVer}/hostedzonelimit/${id}/${type}`, null, stsParams, roleName, (signature, sigerr) => {
7633
- if (sigerr) {
7634
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7319
+ // Make the call -
7320
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7321
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getHostedZoneLimit', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzonelimit/${id}/${type}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7322
+ // if we received an error or their is no response on the results
7323
+ // return an error
7324
+ if (irReturnError) {
7325
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7326
+ return callback(null, irReturnError);
7327
+ }
7328
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7329
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHostedZoneLimitSTSRole'], null, null, null);
7635
7330
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7636
7331
  return callback(null, errorObj);
7637
7332
  }
7638
- Object.assign(thisHeaderData, signature);
7639
- const reqObj = {
7640
- payload: bodyVars,
7641
- uriPathVars: pathVars,
7642
- uriQuery: queryParams,
7643
- addlHeaders: thisHeaderData
7644
- };
7645
-
7646
- // Make the call -
7647
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7648
- return this.requestHandlerInst.identifyRequest('Rest', 'getHostedZoneLimit', reqObj, true, (irReturnData, irReturnError) => {
7649
- // if we received an error or their is no response on the results
7650
- // return an error
7651
- if (irReturnError) {
7652
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7653
- return callback(null, irReturnError);
7654
- }
7655
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7656
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getHostedZoneLimitSTSRole'], null, null, null);
7657
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7658
- return callback(null, errorObj);
7659
- }
7660
7333
 
7661
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7662
- // return the response
7663
- return callback(irReturnData, null);
7664
- });
7334
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7335
+ // return the response
7336
+ return callback(irReturnData, null);
7665
7337
  });
7666
7338
  } catch (ex) {
7667
7339
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7762,42 +7434,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7762
7434
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7763
7435
  }
7764
7436
 
7437
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7438
+ // see adapter code documentation for more information on the request object's fields
7439
+ const reqObj = {
7440
+ payload: bodyVars,
7441
+ uriPathVars: pathVars,
7442
+ uriQuery: queryParams,
7443
+ addlHeaders: thisHeaderData
7444
+ };
7445
+
7765
7446
  try {
7766
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7767
- // see adapter code documentation for more information on the request object's fields
7768
- return this.getAuthorization('GET', `/${restVer}/reusabledelegationsetlimit/${id}/${type}`, null, stsParams, roleName, (signature, sigerr) => {
7769
- if (sigerr) {
7770
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7447
+ // Make the call -
7448
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7449
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getReusableDelegationSetLimit', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/reusabledelegationsetlimit/${id}/${type}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7450
+ // if we received an error or their is no response on the results
7451
+ // return an error
7452
+ if (irReturnError) {
7453
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7454
+ return callback(null, irReturnError);
7455
+ }
7456
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7457
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getReusableDelegationSetLimitSTSRole'], null, null, null);
7771
7458
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7772
7459
  return callback(null, errorObj);
7773
7460
  }
7774
- Object.assign(thisHeaderData, signature);
7775
- const reqObj = {
7776
- payload: bodyVars,
7777
- uriPathVars: pathVars,
7778
- uriQuery: queryParams,
7779
- addlHeaders: thisHeaderData
7780
- };
7781
-
7782
- // Make the call -
7783
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7784
- return this.requestHandlerInst.identifyRequest('Rest', 'getReusableDelegationSetLimit', reqObj, true, (irReturnData, irReturnError) => {
7785
- // if we received an error or their is no response on the results
7786
- // return an error
7787
- if (irReturnError) {
7788
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7789
- return callback(null, irReturnError);
7790
- }
7791
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7792
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getReusableDelegationSetLimitSTSRole'], null, null, null);
7793
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7794
- return callback(null, errorObj);
7795
- }
7796
7461
 
7797
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7798
- // return the response
7799
- return callback(irReturnData, null);
7800
- });
7462
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7463
+ // return the response
7464
+ return callback(irReturnData, null);
7801
7465
  });
7802
7466
  } catch (ex) {
7803
7467
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -7884,42 +7548,34 @@ class AmazonRoute53 extends AdapterBaseCl {
7884
7548
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
7885
7549
  }
7886
7550
 
7551
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7552
+ // see adapter code documentation for more information on the request object's fields
7553
+ const reqObj = {
7554
+ payload: bodyVars,
7555
+ uriPathVars: pathVars,
7556
+ uriQuery: queryParams,
7557
+ addlHeaders: thisHeaderData
7558
+ };
7559
+
7887
7560
  try {
7888
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7889
- // see adapter code documentation for more information on the request object's fields
7890
- return this.getAuthorization('GET', `/${restVer}/trafficpolicyinstancecount`, null, stsParams, roleName, (signature, sigerr) => {
7891
- if (sigerr) {
7892
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7561
+ // Make the call -
7562
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7563
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'getTrafficPolicyInstanceCount', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstancecount?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7564
+ // if we received an error or their is no response on the results
7565
+ // return an error
7566
+ if (irReturnError) {
7567
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7568
+ return callback(null, irReturnError);
7569
+ }
7570
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7571
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getTrafficPolicyInstanceCountSTSRole'], null, null, null);
7893
7572
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7894
7573
  return callback(null, errorObj);
7895
7574
  }
7896
- Object.assign(thisHeaderData, signature);
7897
- const reqObj = {
7898
- payload: bodyVars,
7899
- uriPathVars: pathVars,
7900
- uriQuery: queryParams,
7901
- addlHeaders: thisHeaderData
7902
- };
7903
7575
 
7904
- // Make the call -
7905
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7906
- return this.requestHandlerInst.identifyRequest('Rest', 'getTrafficPolicyInstanceCount', reqObj, true, (irReturnData, irReturnError) => {
7907
- // if we received an error or their is no response on the results
7908
- // return an error
7909
- if (irReturnError) {
7910
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7911
- return callback(null, irReturnError);
7912
- }
7913
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7914
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getTrafficPolicyInstanceCountSTSRole'], null, null, null);
7915
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7916
- return callback(null, errorObj);
7917
- }
7918
-
7919
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7920
- // return the response
7921
- return callback(irReturnData, null);
7922
- });
7576
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7577
+ // return the response
7578
+ return callback(irReturnData, null);
7923
7579
  });
7924
7580
  } catch (ex) {
7925
7581
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8014,42 +7670,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8014
7670
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8015
7671
  }
8016
7672
 
7673
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7674
+ // see adapter code documentation for more information on the request object's fields
7675
+ const reqObj = {
7676
+ payload: bodyVars,
7677
+ uriPathVars: pathVars,
7678
+ uriQuery: queryParams,
7679
+ addlHeaders: thisHeaderData
7680
+ };
7681
+
8017
7682
  try {
8018
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8019
- // see adapter code documentation for more information on the request object's fields
8020
- return this.getAuthorization('GET', `/${restVer}/geolocations`, null, stsParams, roleName, (signature, sigerr) => {
8021
- if (sigerr) {
8022
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7683
+ // Make the call -
7684
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7685
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listGeoLocations', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/geolocations?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7686
+ // if we received an error or their is no response on the results
7687
+ // return an error
7688
+ if (irReturnError) {
7689
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7690
+ return callback(null, irReturnError);
7691
+ }
7692
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7693
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listGeoLocationsSTSRole'], null, null, null);
8023
7694
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8024
7695
  return callback(null, errorObj);
8025
7696
  }
8026
- Object.assign(thisHeaderData, signature);
8027
- const reqObj = {
8028
- payload: bodyVars,
8029
- uriPathVars: pathVars,
8030
- uriQuery: queryParams,
8031
- addlHeaders: thisHeaderData
8032
- };
8033
-
8034
- // Make the call -
8035
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8036
- return this.requestHandlerInst.identifyRequest('Rest', 'listGeoLocations', reqObj, true, (irReturnData, irReturnError) => {
8037
- // if we received an error or their is no response on the results
8038
- // return an error
8039
- if (irReturnError) {
8040
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8041
- return callback(null, irReturnError);
8042
- }
8043
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8044
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listGeoLocationsSTSRole'], null, null, null);
8045
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8046
- return callback(null, errorObj);
8047
- }
8048
7697
 
8049
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8050
- // return the response
8051
- return callback(irReturnData, null);
8052
- });
7698
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7699
+ // return the response
7700
+ return callback(irReturnData, null);
8053
7701
  });
8054
7702
  } catch (ex) {
8055
7703
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8142,42 +7790,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8142
7790
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8143
7791
  }
8144
7792
 
7793
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7794
+ // see adapter code documentation for more information on the request object's fields
7795
+ const reqObj = {
7796
+ payload: bodyVars,
7797
+ uriPathVars: pathVars,
7798
+ uriQuery: queryParams,
7799
+ addlHeaders: thisHeaderData
7800
+ };
7801
+
8145
7802
  try {
8146
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8147
- // see adapter code documentation for more information on the request object's fields
8148
- return this.getAuthorization('GET', `/${restVer}/hostedzonesbyname`, null, stsParams, roleName, (signature, sigerr) => {
8149
- if (sigerr) {
8150
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7803
+ // Make the call -
7804
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7805
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listHostedZonesByName', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzonesbyname?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7806
+ // if we received an error or their is no response on the results
7807
+ // return an error
7808
+ if (irReturnError) {
7809
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7810
+ return callback(null, irReturnError);
7811
+ }
7812
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7813
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHostedZonesByNameSTSRole'], null, null, null);
8151
7814
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8152
7815
  return callback(null, errorObj);
8153
7816
  }
8154
- Object.assign(thisHeaderData, signature);
8155
- const reqObj = {
8156
- payload: bodyVars,
8157
- uriPathVars: pathVars,
8158
- uriQuery: queryParams,
8159
- addlHeaders: thisHeaderData
8160
- };
8161
-
8162
- // Make the call -
8163
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8164
- return this.requestHandlerInst.identifyRequest('Rest', 'listHostedZonesByName', reqObj, true, (irReturnData, irReturnError) => {
8165
- // if we received an error or their is no response on the results
8166
- // return an error
8167
- if (irReturnError) {
8168
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8169
- return callback(null, irReturnError);
8170
- }
8171
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8172
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHostedZonesByNameSTSRole'], null, null, null);
8173
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8174
- return callback(null, errorObj);
8175
- }
8176
7817
 
8177
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8178
- // return the response
8179
- return callback(irReturnData, null);
8180
- });
7818
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7819
+ // return the response
7820
+ return callback(irReturnData, null);
8181
7821
  });
8182
7822
  } catch (ex) {
8183
7823
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8282,42 +7922,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8282
7922
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8283
7923
  }
8284
7924
 
7925
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
7926
+ // see adapter code documentation for more information on the request object's fields
7927
+ const reqObj = {
7928
+ payload: bodyVars,
7929
+ uriPathVars: pathVars,
7930
+ uriQuery: queryParams,
7931
+ addlHeaders: thisHeaderData
7932
+ };
7933
+
8285
7934
  try {
8286
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8287
- // see adapter code documentation for more information on the request object's fields
8288
- return this.getAuthorization('GET', `/${restVer}/hostedzonesbyvpc`, null, stsParams, roleName, (signature, sigerr) => {
8289
- if (sigerr) {
8290
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
7935
+ // Make the call -
7936
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
7937
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listHostedZonesByVPC', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzonesbyvpc?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
7938
+ // if we received an error or their is no response on the results
7939
+ // return an error
7940
+ if (irReturnError) {
7941
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
7942
+ return callback(null, irReturnError);
7943
+ }
7944
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
7945
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHostedZonesByVPCSTSRole'], null, null, null);
8291
7946
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8292
7947
  return callback(null, errorObj);
8293
7948
  }
8294
- Object.assign(thisHeaderData, signature);
8295
- const reqObj = {
8296
- payload: bodyVars,
8297
- uriPathVars: pathVars,
8298
- uriQuery: queryParams,
8299
- addlHeaders: thisHeaderData
8300
- };
8301
-
8302
- // Make the call -
8303
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8304
- return this.requestHandlerInst.identifyRequest('Rest', 'listHostedZonesByVPC', reqObj, true, (irReturnData, irReturnError) => {
8305
- // if we received an error or their is no response on the results
8306
- // return an error
8307
- if (irReturnError) {
8308
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8309
- return callback(null, irReturnError);
8310
- }
8311
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8312
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listHostedZonesByVPCSTSRole'], null, null, null);
8313
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8314
- return callback(null, errorObj);
8315
- }
8316
7949
 
8317
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8318
- // return the response
8319
- return callback(irReturnData, null);
8320
- });
7950
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
7951
+ // return the response
7952
+ return callback(irReturnData, null);
8321
7953
  });
8322
7954
  } catch (ex) {
8323
7955
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8427,42 +8059,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8427
8059
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8428
8060
  }
8429
8061
 
8062
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8063
+ // see adapter code documentation for more information on the request object's fields
8064
+ const reqObj = {
8065
+ payload: bodyVars,
8066
+ uriPathVars: pathVars,
8067
+ uriQuery: queryParams,
8068
+ addlHeaders: thisHeaderData
8069
+ };
8070
+
8430
8071
  try {
8431
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8432
- // see adapter code documentation for more information on the request object's fields
8433
- return this.getAuthorization('GET', `/${restVer}/hostedzone/${id}/rrset`, null, stsParams, roleName, (signature, sigerr) => {
8434
- if (sigerr) {
8435
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8072
+ // Make the call -
8073
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8074
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listResourceRecordSets', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/hostedzone/${id}/rrset?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8075
+ // if we received an error or their is no response on the results
8076
+ // return an error
8077
+ if (irReturnError) {
8078
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8079
+ return callback(null, irReturnError);
8080
+ }
8081
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8082
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listResourceRecordSetsSTSRole'], null, null, null);
8436
8083
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8437
8084
  return callback(null, errorObj);
8438
8085
  }
8439
- Object.assign(thisHeaderData, signature);
8440
- const reqObj = {
8441
- payload: bodyVars,
8442
- uriPathVars: pathVars,
8443
- uriQuery: queryParams,
8444
- addlHeaders: thisHeaderData
8445
- };
8446
-
8447
- // Make the call -
8448
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8449
- return this.requestHandlerInst.identifyRequest('Rest', 'listResourceRecordSets', reqObj, true, (irReturnData, irReturnError) => {
8450
- // if we received an error or their is no response on the results
8451
- // return an error
8452
- if (irReturnError) {
8453
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8454
- return callback(null, irReturnError);
8455
- }
8456
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8457
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listResourceRecordSetsSTSRole'], null, null, null);
8458
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8459
- return callback(null, errorObj);
8460
- }
8461
8086
 
8462
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8463
- // return the response
8464
- return callback(irReturnData, null);
8465
- });
8087
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8088
+ // return the response
8089
+ return callback(irReturnData, null);
8466
8090
  });
8467
8091
  } catch (ex) {
8468
8092
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8563,42 +8187,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8563
8187
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '', contentType: '' };
8564
8188
  }
8565
8189
 
8190
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8191
+ // see adapter code documentation for more information on the request object's fields
8192
+ const reqObj = {
8193
+ payload: bodyVars,
8194
+ uriPathVars: pathVars,
8195
+ uriQuery: queryParams,
8196
+ addlHeaders: thisHeaderData
8197
+ };
8198
+
8566
8199
  try {
8567
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8568
- // see adapter code documentation for more information on the request object's fields
8569
- return this.getAuthorization('POST', `/${restVer}/tags/${resourceType}`, bodyVars, stsParams, roleName, (signature, sigerr) => {
8570
- if (sigerr) {
8571
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8200
+ // Make the call -
8201
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8202
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTagsForResources', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/tags/${resourceType}?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8203
+ // if we received an error or their is no response on the results
8204
+ // return an error
8205
+ if (irReturnError) {
8206
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8207
+ return callback(null, irReturnError);
8208
+ }
8209
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8210
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTagsForResourcesSTSRole'], null, null, null);
8572
8211
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8573
8212
  return callback(null, errorObj);
8574
8213
  }
8575
- Object.assign(thisHeaderData, signature);
8576
- const reqObj = {
8577
- payload: bodyVars,
8578
- uriPathVars: pathVars,
8579
- uriQuery: queryParams,
8580
- addlHeaders: thisHeaderData
8581
- };
8582
-
8583
- // Make the call -
8584
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8585
- return this.requestHandlerInst.identifyRequest('Rest', 'listTagsForResources', reqObj, true, (irReturnData, irReturnError) => {
8586
- // if we received an error or their is no response on the results
8587
- // return an error
8588
- if (irReturnError) {
8589
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8590
- return callback(null, irReturnError);
8591
- }
8592
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8593
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTagsForResourcesSTSRole'], null, null, null);
8594
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8595
- return callback(null, errorObj);
8596
- }
8597
8214
 
8598
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8599
- // return the response
8600
- return callback(irReturnData, null);
8601
- });
8215
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8216
+ // return the response
8217
+ return callback(irReturnData, null);
8602
8218
  });
8603
8219
  } catch (ex) {
8604
8220
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8689,42 +8305,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8689
8305
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8690
8306
  }
8691
8307
 
8308
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8309
+ // see adapter code documentation for more information on the request object's fields
8310
+ const reqObj = {
8311
+ payload: bodyVars,
8312
+ uriPathVars: pathVars,
8313
+ uriQuery: queryParams,
8314
+ addlHeaders: thisHeaderData
8315
+ };
8316
+
8692
8317
  try {
8693
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8694
- // see adapter code documentation for more information on the request object's fields
8695
- return this.getAuthorization('GET', `/${restVer}/trafficpolicies`, null, stsParams, roleName, (signature, sigerr) => {
8696
- if (sigerr) {
8697
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8318
+ // Make the call -
8319
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8320
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTrafficPolicies', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicies?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8321
+ // if we received an error or their is no response on the results
8322
+ // return an error
8323
+ if (irReturnError) {
8324
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8325
+ return callback(null, irReturnError);
8326
+ }
8327
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8328
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPoliciesSTSRole'], null, null, null);
8698
8329
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8699
8330
  return callback(null, errorObj);
8700
8331
  }
8701
- Object.assign(thisHeaderData, signature);
8702
- const reqObj = {
8703
- payload: bodyVars,
8704
- uriPathVars: pathVars,
8705
- uriQuery: queryParams,
8706
- addlHeaders: thisHeaderData
8707
- };
8708
8332
 
8709
- // Make the call -
8710
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8711
- return this.requestHandlerInst.identifyRequest('Rest', 'listTrafficPolicies', reqObj, true, (irReturnData, irReturnError) => {
8712
- // if we received an error or their is no response on the results
8713
- // return an error
8714
- if (irReturnError) {
8715
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8716
- return callback(null, irReturnError);
8717
- }
8718
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8719
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPoliciesSTSRole'], null, null, null);
8720
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8721
- return callback(null, errorObj);
8722
- }
8723
-
8724
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8725
- // return the response
8726
- return callback(irReturnData, null);
8727
- });
8333
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8334
+ // return the response
8335
+ return callback(irReturnData, null);
8728
8336
  });
8729
8337
  } catch (ex) {
8730
8338
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8819,42 +8427,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8819
8427
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8820
8428
  }
8821
8429
 
8430
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8431
+ // see adapter code documentation for more information on the request object's fields
8432
+ const reqObj = {
8433
+ payload: bodyVars,
8434
+ uriPathVars: pathVars,
8435
+ uriQuery: queryParams,
8436
+ addlHeaders: thisHeaderData
8437
+ };
8438
+
8822
8439
  try {
8823
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8824
- // see adapter code documentation for more information on the request object's fields
8825
- return this.getAuthorization('GET', `/${restVer}/trafficpolicyinstances`, null, stsParams, roleName, (signature, sigerr) => {
8826
- if (sigerr) {
8827
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8440
+ // Make the call -
8441
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8442
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTrafficPolicyInstances', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstances?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8443
+ // if we received an error or their is no response on the results
8444
+ // return an error
8445
+ if (irReturnError) {
8446
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8447
+ return callback(null, irReturnError);
8448
+ }
8449
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8450
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyInstancesSTSRole'], null, null, null);
8828
8451
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8829
8452
  return callback(null, errorObj);
8830
8453
  }
8831
- Object.assign(thisHeaderData, signature);
8832
- const reqObj = {
8833
- payload: bodyVars,
8834
- uriPathVars: pathVars,
8835
- uriQuery: queryParams,
8836
- addlHeaders: thisHeaderData
8837
- };
8838
-
8839
- // Make the call -
8840
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8841
- return this.requestHandlerInst.identifyRequest('Rest', 'listTrafficPolicyInstances', reqObj, true, (irReturnData, irReturnError) => {
8842
- // if we received an error or their is no response on the results
8843
- // return an error
8844
- if (irReturnError) {
8845
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8846
- return callback(null, irReturnError);
8847
- }
8848
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8849
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyInstancesSTSRole'], null, null, null);
8850
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8851
- return callback(null, errorObj);
8852
- }
8853
8454
 
8854
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8855
- // return the response
8856
- return callback(irReturnData, null);
8857
- });
8455
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8456
+ // return the response
8457
+ return callback(irReturnData, null);
8858
8458
  });
8859
8459
  } catch (ex) {
8860
8460
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -8954,42 +8554,34 @@ class AmazonRoute53 extends AdapterBaseCl {
8954
8554
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
8955
8555
  }
8956
8556
 
8557
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8558
+ // see adapter code documentation for more information on the request object's fields
8559
+ const reqObj = {
8560
+ payload: bodyVars,
8561
+ uriPathVars: pathVars,
8562
+ uriQuery: queryParams,
8563
+ addlHeaders: thisHeaderData
8564
+ };
8565
+
8957
8566
  try {
8958
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8959
- // see adapter code documentation for more information on the request object's fields
8960
- return this.getAuthorization('GET', `/${restVer}/trafficpolicyinstances/hostedzone`, null, stsParams, roleName, (signature, sigerr) => {
8961
- if (sigerr) {
8962
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8567
+ // Make the call -
8568
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8569
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTrafficPolicyInstancesByHostedZone', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstances/hostedzone?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8570
+ // if we received an error or their is no response on the results
8571
+ // return an error
8572
+ if (irReturnError) {
8573
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8574
+ return callback(null, irReturnError);
8575
+ }
8576
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8577
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyInstancesByHostedZoneSTSRole'], null, null, null);
8963
8578
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8964
8579
  return callback(null, errorObj);
8965
8580
  }
8966
- Object.assign(thisHeaderData, signature);
8967
- const reqObj = {
8968
- payload: bodyVars,
8969
- uriPathVars: pathVars,
8970
- uriQuery: queryParams,
8971
- addlHeaders: thisHeaderData
8972
- };
8973
-
8974
- // Make the call -
8975
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8976
- return this.requestHandlerInst.identifyRequest('Rest', 'listTrafficPolicyInstancesByHostedZone', reqObj, true, (irReturnData, irReturnError) => {
8977
- // if we received an error or their is no response on the results
8978
- // return an error
8979
- if (irReturnError) {
8980
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8981
- return callback(null, irReturnError);
8982
- }
8983
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8984
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyInstancesByHostedZoneSTSRole'], null, null, null);
8985
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8986
- return callback(null, errorObj);
8987
- }
8988
8581
 
8989
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8990
- // return the response
8991
- return callback(irReturnData, null);
8992
- });
8582
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8583
+ // return the response
8584
+ return callback(irReturnData, null);
8993
8585
  });
8994
8586
  } catch (ex) {
8995
8587
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -9098,42 +8690,34 @@ class AmazonRoute53 extends AdapterBaseCl {
9098
8690
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
9099
8691
  }
9100
8692
 
8693
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8694
+ // see adapter code documentation for more information on the request object's fields
8695
+ const reqObj = {
8696
+ payload: bodyVars,
8697
+ uriPathVars: pathVars,
8698
+ uriQuery: queryParams,
8699
+ addlHeaders: thisHeaderData
8700
+ };
8701
+
9101
8702
  try {
9102
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
9103
- // see adapter code documentation for more information on the request object's fields
9104
- return this.getAuthorization('GET', `/${restVer}/trafficpolicyinstances/trafficpolicy`, null, stsParams, roleName, (signature, sigerr) => {
9105
- if (sigerr) {
9106
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8703
+ // Make the call -
8704
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8705
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTrafficPolicyInstancesByPolicy', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicyinstances/trafficpolicy?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8706
+ // if we received an error or their is no response on the results
8707
+ // return an error
8708
+ if (irReturnError) {
8709
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8710
+ return callback(null, irReturnError);
8711
+ }
8712
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8713
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyInstancesByPolicySTSRole'], null, null, null);
9107
8714
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9108
8715
  return callback(null, errorObj);
9109
8716
  }
9110
- Object.assign(thisHeaderData, signature);
9111
- const reqObj = {
9112
- payload: bodyVars,
9113
- uriPathVars: pathVars,
9114
- uriQuery: queryParams,
9115
- addlHeaders: thisHeaderData
9116
- };
9117
-
9118
- // Make the call -
9119
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
9120
- return this.requestHandlerInst.identifyRequest('Rest', 'listTrafficPolicyInstancesByPolicy', reqObj, true, (irReturnData, irReturnError) => {
9121
- // if we received an error or their is no response on the results
9122
- // return an error
9123
- if (irReturnError) {
9124
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
9125
- return callback(null, irReturnError);
9126
- }
9127
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
9128
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyInstancesByPolicySTSRole'], null, null, null);
9129
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9130
- return callback(null, errorObj);
9131
- }
9132
8717
 
9133
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
9134
- // return the response
9135
- return callback(irReturnData, null);
9136
- });
8718
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8719
+ // return the response
8720
+ return callback(irReturnData, null);
9137
8721
  });
9138
8722
  } catch (ex) {
9139
8723
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -9231,42 +8815,34 @@ class AmazonRoute53 extends AdapterBaseCl {
9231
8815
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
9232
8816
  }
9233
8817
 
8818
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8819
+ // see adapter code documentation for more information on the request object's fields
8820
+ const reqObj = {
8821
+ payload: bodyVars,
8822
+ uriPathVars: pathVars,
8823
+ uriQuery: queryParams,
8824
+ addlHeaders: thisHeaderData
8825
+ };
8826
+
9234
8827
  try {
9235
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
9236
- // see adapter code documentation for more information on the request object's fields
9237
- return this.getAuthorization('GET', `/${restVer}/trafficpolicies/${id}/versions`, null, stsParams, roleName, (signature, sigerr) => {
9238
- if (sigerr) {
9239
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8828
+ // Make the call -
8829
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8830
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'listTrafficPolicyVersions', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/trafficpolicies/${id}/versions?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8831
+ // if we received an error or their is no response on the results
8832
+ // return an error
8833
+ if (irReturnError) {
8834
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8835
+ return callback(null, irReturnError);
8836
+ }
8837
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8838
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyVersionsSTSRole'], null, null, null);
9240
8839
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9241
8840
  return callback(null, errorObj);
9242
8841
  }
9243
- Object.assign(thisHeaderData, signature);
9244
- const reqObj = {
9245
- payload: bodyVars,
9246
- uriPathVars: pathVars,
9247
- uriQuery: queryParams,
9248
- addlHeaders: thisHeaderData
9249
- };
9250
-
9251
- // Make the call -
9252
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
9253
- return this.requestHandlerInst.identifyRequest('Rest', 'listTrafficPolicyVersions', reqObj, true, (irReturnData, irReturnError) => {
9254
- // if we received an error or their is no response on the results
9255
- // return an error
9256
- if (irReturnError) {
9257
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
9258
- return callback(null, irReturnError);
9259
- }
9260
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
9261
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['listTrafficPolicyVersionsSTSRole'], null, null, null);
9262
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9263
- return callback(null, errorObj);
9264
- }
9265
8842
 
9266
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
9267
- // return the response
9268
- return callback(irReturnData, null);
9269
- });
8843
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8844
+ // return the response
8845
+ return callback(irReturnData, null);
9270
8846
  });
9271
8847
  } catch (ex) {
9272
8848
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
@@ -9380,42 +8956,34 @@ class AmazonRoute53 extends AdapterBaseCl {
9380
8956
  thisHeaderData = { xAmzContentSha256: '', xAmzDate: '', xAmzAlgorithm: '', xAmzCredential: '', xAmzSecurityToken: '', xAmzSignature: '', xAmzSignedHeaders: '' };
9381
8957
  }
9382
8958
 
8959
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8960
+ // see adapter code documentation for more information on the request object's fields
8961
+ const reqObj = {
8962
+ payload: bodyVars,
8963
+ uriPathVars: pathVars,
8964
+ uriQuery: queryParams,
8965
+ addlHeaders: thisHeaderData
8966
+ };
8967
+
9383
8968
  try {
9384
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
9385
- // see adapter code documentation for more information on the request object's fields
9386
- return this.getAuthorization('GET', `/${restVer}/testdnsanswer`, null, stsParams, roleName, (signature, sigerr) => {
9387
- if (sigerr) {
9388
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, `Can not Authenticate ${sigerr}`, [], null, null, null);
8969
+ // Make the call -
8970
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8971
+ return this.getAuthorizationAndIdentifyRequest('Rest', 'testDNSAnswer', reqObj, true, `${this.allProps.base_path}/${this.allProps.version}/${restVer}/testdnsanswer?${querystring.stringify(queryParams)}`, stsParams, roleName, (irReturnData, irReturnError) => {
8972
+ // if we received an error or their is no response on the results
8973
+ // return an error
8974
+ if (irReturnError) {
8975
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8976
+ return callback(null, irReturnError);
8977
+ }
8978
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8979
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['testDNSAnswerSTSRole'], null, null, null);
9389
8980
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9390
8981
  return callback(null, errorObj);
9391
8982
  }
9392
- Object.assign(thisHeaderData, signature);
9393
- const reqObj = {
9394
- payload: bodyVars,
9395
- uriPathVars: pathVars,
9396
- uriQuery: queryParams,
9397
- addlHeaders: thisHeaderData
9398
- };
9399
-
9400
- // Make the call -
9401
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
9402
- return this.requestHandlerInst.identifyRequest('Rest', 'testDNSAnswer', reqObj, true, (irReturnData, irReturnError) => {
9403
- // if we received an error or their is no response on the results
9404
- // return an error
9405
- if (irReturnError) {
9406
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
9407
- return callback(null, irReturnError);
9408
- }
9409
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
9410
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['testDNSAnswerSTSRole'], null, null, null);
9411
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9412
- return callback(null, errorObj);
9413
- }
9414
8983
 
9415
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
9416
- // return the response
9417
- return callback(irReturnData, null);
9418
- });
8984
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8985
+ // return the response
8986
+ return callback(irReturnData, null);
9419
8987
  });
9420
8988
  } catch (ex) {
9421
8989
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);