@itentialopensource/adapter-servicenow 2.2.1 → 2.4.0

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.
Files changed (52) hide show
  1. package/.eslintignore +1 -0
  2. package/AUTH.md +39 -0
  3. package/BROKER.md +199 -0
  4. package/CALLS.md +169 -0
  5. package/CHANGELOG.md +62 -40
  6. package/CODE_OF_CONDUCT.md +12 -17
  7. package/CONTRIBUTING.md +88 -74
  8. package/ENHANCE.md +69 -0
  9. package/PROPERTIES.md +641 -0
  10. package/README.md +228 -420
  11. package/SUMMARY.md +9 -0
  12. package/SYSTEMINFO.md +11 -0
  13. package/TROUBLESHOOT.md +47 -0
  14. package/adapter.js +1665 -52
  15. package/adapterBase.js +1270 -238
  16. package/entities/.generic/action.json +214 -0
  17. package/entities/.generic/schema.json +28 -0
  18. package/entities/.system/action.json +3 -2
  19. package/entities/ChangeManagement/action.json +63 -0
  20. package/entities/ChangeManagement/schema.json +4 -1
  21. package/error.json +12 -0
  22. package/package.json +45 -20
  23. package/pronghorn.json +767 -77
  24. package/propertiesDecorators.json +14 -0
  25. package/propertiesSchema.json +476 -8
  26. package/refs?service=git-upload-pack +0 -0
  27. package/report/adapterInfo.json +10 -0
  28. package/report/updateReport1615339875463.json +95 -0
  29. package/report/updateReport1653406010548.json +120 -0
  30. package/sampleProperties.json +102 -5
  31. package/storage/metrics.json +2205 -0
  32. package/test/integration/adapterTestBasicGet.js +85 -0
  33. package/test/integration/adapterTestConnectivity.js +93 -0
  34. package/test/integration/adapterTestIntegration.js +29 -98
  35. package/test/unit/adapterBaseTestUnit.js +949 -0
  36. package/test/unit/adapterTestUnit.js +780 -109
  37. package/utils/adapterInfo.js +206 -0
  38. package/utils/addAuth.js +94 -0
  39. package/utils/basicGet.js +50 -0
  40. package/utils/checkMigrate.js +63 -0
  41. package/utils/entitiesToDB.js +179 -0
  42. package/utils/findPath.js +74 -0
  43. package/utils/modify.js +154 -0
  44. package/utils/packModificationScript.js +1 -1
  45. package/utils/patches2bundledDeps.js +90 -0
  46. package/utils/pre-commit.sh +3 -0
  47. package/utils/removeHooks.js +20 -0
  48. package/utils/tbScript.js +184 -0
  49. package/utils/tbUtils.js +469 -0
  50. package/utils/testRunner.js +16 -16
  51. package/utils/troubleshootingAdapter.js +190 -0
  52. package/img/adapter.png +0 -0
package/adapter.js CHANGED
@@ -82,11 +82,37 @@ class Servicenow extends AdapterBaseCl {
82
82
  }
83
83
 
84
84
  /**
85
- * updateAdapterConfiguration is used to update any of the adapter configuration files. This
85
+ * @iapGetAdapterWorkflowFunctions
86
+ */
87
+ iapGetAdapterWorkflowFunctions(inIgnore) {
88
+ let myIgnore = [
89
+ 'healthCheck',
90
+ 'iapGetAdapterWorkflowFunctions',
91
+ 'iapHasAdapterEntity',
92
+ 'iapVerifyAdapterCapability',
93
+ 'iapUpdateAdapterEntityCache',
94
+ 'hasEntities',
95
+ 'getAuthorization'
96
+ ];
97
+ if (!inIgnore && Array.isArray(inIgnore)) {
98
+ myIgnore = inIgnore;
99
+ } else if (!inIgnore && typeof inIgnore === 'string') {
100
+ myIgnore = [inIgnore];
101
+ }
102
+
103
+ // The generic adapter functions should already be ignored (e.g. healthCheck)
104
+ // you can add specific methods that you do not want to be workflow functions to ignore like below
105
+ // myIgnore.push('myMethodNotInWorkflow');
106
+
107
+ return super.iapGetAdapterWorkflowFunctions(myIgnore);
108
+ }
109
+
110
+ /**
111
+ * iapUpdateAdapterConfiguration is used to update any of the adapter configuration files. This
86
112
  * allows customers to make changes to adapter configuration without having to be on the
87
113
  * file system.
88
114
  *
89
- * @function updateAdapterConfiguration
115
+ * @function iapUpdateAdapterConfiguration
90
116
  * @param {string} configFile - the name of the file being updated (required)
91
117
  * @param {Object} changes - an object containing all of the changes = formatted like the configuration file (required)
92
118
  * @param {string} entity - the entity to be changed, if an action, schema or mock data file (optional)
@@ -94,59 +120,206 @@ class Servicenow extends AdapterBaseCl {
94
120
  * @param {string} action - the action to be changed, if an action, schema or mock data file (optional)
95
121
  * @param {Callback} callback - The results of the call
96
122
  */
97
- updateAdapterConfiguration(configFile, changes, entity, type, action, callback) {
98
- super.updateAdapterConfiguration(configFile, changes, entity, type, action, callback);
123
+ iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback) {
124
+ const meth = 'adapter-iapUpdateAdapterConfiguration';
125
+ const origin = `${this.id}-${meth}`;
126
+ log.trace(origin);
127
+
128
+ super.iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback);
99
129
  }
100
130
 
101
131
  /**
102
- * @callback healthCallback
103
- * @param {Object} result - the result of the get request (contains an id and a status)
132
+ * See if the API path provided is found in this adapter
133
+ *
134
+ * @function iapFindAdapterPath
135
+ * @param {string} apiPath - the api path to check on
136
+ * @param {Callback} callback - The results of the call
104
137
  */
138
+ iapFindAdapterPath(apiPath, callback) {
139
+ const meth = 'adapter-iapFindAdapterPath';
140
+ const origin = `${this.id}-${meth}`;
141
+ log.trace(origin);
142
+
143
+ super.iapFindAdapterPath(apiPath, callback);
144
+ }
145
+
105
146
  /**
106
- * @callback getCallback
107
- * @param {Object} result - the result of the get request (entity/ies)
108
- * @param {String} error - any error that occurred
109
- */
147
+ * @summary Suspends adapter
148
+ *
149
+ * @function iapSuspendAdapter
150
+ * @param {Callback} callback - callback function
151
+ */
152
+ iapSuspendAdapter(mode, callback) {
153
+ const meth = 'adapter-iapSuspendAdapter';
154
+ const origin = `${this.id}-${meth}`;
155
+ log.trace(origin);
156
+
157
+ try {
158
+ return super.iapSuspendAdapter(mode, callback);
159
+ } catch (error) {
160
+ log.error(`${origin}: ${error}`);
161
+ return callback(null, error);
162
+ }
163
+ }
164
+
110
165
  /**
111
- * @callback createCallback
112
- * @param {Object} item - the newly created entity
113
- * @param {String} error - any error that occurred
114
- */
166
+ * @summary Unsuspends adapter
167
+ *
168
+ * @function iapUnsuspendAdapter
169
+ * @param {Callback} callback - callback function
170
+ */
171
+ iapUnsuspendAdapter(callback) {
172
+ const meth = 'adapter-iapUnsuspendAdapter';
173
+ const origin = `${this.id}-${meth}`;
174
+ log.trace(origin);
175
+
176
+ try {
177
+ return super.iapUnsuspendAdapter(callback);
178
+ } catch (error) {
179
+ log.error(`${origin}: ${error}`);
180
+ return callback(null, error);
181
+ }
182
+ }
183
+
115
184
  /**
116
- * @callback updateCallback
117
- * @param {String} status - the status of the update action
118
- * @param {String} error - any error that occurred
119
- */
185
+ * @summary Get the Adaoter Queue
186
+ *
187
+ * @function iapGetAdapterQueue
188
+ * @param {Callback} callback - callback function
189
+ */
190
+ iapGetAdapterQueue(callback) {
191
+ const meth = 'adapter-iapGetAdapterQueue';
192
+ const origin = `${this.id}-${meth}`;
193
+ log.trace(origin);
194
+
195
+ return super.iapGetAdapterQueue(callback);
196
+ }
197
+
120
198
  /**
121
- * @callback deleteCallback
122
- * @param {String} status - the status of the delete action
123
- * @param {String} error - any error that occurred
199
+ * @summary Runs troubleshoot scripts for adapter
200
+ *
201
+ * @function iapTroubleshootAdapter
202
+ * @param {Object} props - the connection, healthcheck and authentication properties
203
+ *
204
+ * @param {boolean} persistFlag - whether the adapter properties should be updated
205
+ * @param {Callback} callback - The results of the call
206
+ */
207
+ iapTroubleshootAdapter(props, persistFlag, callback) {
208
+ const meth = 'adapter-iapTroubleshootAdapter';
209
+ const origin = `${this.id}-${meth}`;
210
+ log.trace(origin);
211
+
212
+ try {
213
+ return super.iapTroubleshootAdapter(props, persistFlag, this, callback);
214
+ } catch (error) {
215
+ log.error(`${origin}: ${error}`);
216
+ return callback(null, error);
217
+ }
218
+ }
219
+
220
+ /**
221
+ * @summary runs healthcheck script for adapter
222
+ *
223
+ * @function iapRunAdapterHealthcheck
224
+ * @param {Adapter} adapter - adapter instance to troubleshoot
225
+ * @param {Callback} callback - callback function
226
+ */
227
+ iapRunAdapterHealthcheck(callback) {
228
+ const meth = 'adapter-iapRunAdapterHealthcheck';
229
+ const origin = `${this.id}-${meth}`;
230
+ log.trace(origin);
231
+
232
+ try {
233
+ return super.iapRunAdapterHealthcheck(this, callback);
234
+ } catch (error) {
235
+ log.error(`${origin}: ${error}`);
236
+ return callback(null, error);
237
+ }
238
+ }
239
+
240
+ /**
241
+ * @summary runs connectivity check script for adapter
242
+ *
243
+ * @function iapRunAdapterConnectivity
244
+ * @param {Callback} callback - callback function
245
+ */
246
+ iapRunAdapterConnectivity(callback) {
247
+ const meth = 'adapter-iapRunAdapterConnectivity';
248
+ const origin = `${this.id}-${meth}`;
249
+ log.trace(origin);
250
+
251
+ try {
252
+ return super.iapRunAdapterConnectivity(callback);
253
+ } catch (error) {
254
+ log.error(`${origin}: ${error}`);
255
+ return callback(null, error);
256
+ }
257
+ }
258
+
259
+ /**
260
+ * @summary runs basicGet script for adapter
261
+ *
262
+ * @function iapRunAdapterBasicGet
263
+ * @param {Callback} callback - callback function
264
+ */
265
+ iapRunAdapterBasicGet(callback) {
266
+ const meth = 'adapter-iapRunAdapterBasicGet';
267
+ const origin = `${this.id}-${meth}`;
268
+ log.trace(origin);
269
+
270
+ try {
271
+ return super.iapRunAdapterBasicGet(callback);
272
+ } catch (error) {
273
+ log.error(`${origin}: ${error}`);
274
+ return callback(null, error);
275
+ }
276
+ }
277
+
278
+ /**
279
+ * @summary moves entites into Mongo DB
280
+ *
281
+ * @function iapMoveAdapterEntitiesToDB
282
+ * @param {getCallback} callback - a callback function to return the result (Generics)
283
+ * or the error
124
284
  */
285
+ iapMoveAdapterEntitiesToDB(callback) {
286
+ const meth = 'adapter-iapMoveAdapterEntitiesToDB';
287
+ const origin = `${this.id}-${meth}`;
288
+ log.trace(origin);
125
289
 
290
+ try {
291
+ return super.iapMoveAdapterEntitiesToDB(callback);
292
+ } catch (err) {
293
+ log.error(`${origin}: ${err}`);
294
+ return callback(null, err);
295
+ }
296
+ }
297
+
298
+ /* BROKER CALLS */
126
299
  /**
127
300
  * @summary Determines if this adapter supports the specific entity
128
301
  *
129
- * @function hasEntity
302
+ * @function iapHasAdapterEntity
130
303
  * @param {String} entityType - the entity type to check for
131
304
  * @param {String/Array} entityId - the specific entity we are looking for
132
305
  *
133
306
  * @param {Callback} callback - An array of whether the adapter can has the
134
307
  * desired capability or an error
135
308
  */
136
- hasEntity(entityType, entityId, callback) {
137
- const origin = `${this.id}-adapter-hasEntity`;
309
+ iapHasAdapterEntity(entityType, entityId, callback) {
310
+ const origin = `${this.id}-adapter-iapHasAdapterEntity`;
138
311
  log.trace(origin);
139
312
 
140
313
  // Make the call -
141
- // verifyCapability(entityType, actionType, entityId, callback)
142
- return this.verifyCapability(entityType, null, entityId, callback);
314
+ // iapVerifyAdapterCapability(entityType, actionType, entityId, callback)
315
+ return this.iapVerifyAdapterCapability(entityType, null, entityId, callback);
143
316
  }
144
317
 
145
318
  /**
146
319
  * @summary Provides a way for the adapter to tell north bound integrations
147
320
  * whether the adapter supports type, action and specific entity
148
321
  *
149
- * @function verifyCapability
322
+ * @function iapVerifyAdapterCapability
150
323
  * @param {String} entityType - the entity type to check for
151
324
  * @param {String} actionType - the action type to check for
152
325
  * @param {String/Array} entityId - the specific entity we are looking for
@@ -154,15 +327,15 @@ class Servicenow extends AdapterBaseCl {
154
327
  * @param {Callback} callback - An array of whether the adapter can has the
155
328
  * desired capability or an error
156
329
  */
157
- verifyCapability(entityType, actionType, entityId, callback) {
158
- const meth = 'adapterBase-verifyCapability';
330
+ iapVerifyAdapterCapability(entityType, actionType, entityId, callback) {
331
+ const meth = 'adapterBase-iapVerifyAdapterCapability';
159
332
  const origin = `${this.id}-${meth}`;
160
333
  log.trace(origin);
161
334
 
162
335
  // if caching
163
336
  if (this.caching) {
164
- // Make the call - verifyCapability(entityType, actionType, entityId, callback)
165
- return this.requestHandlerInst.verifyCapability(entityType, actionType, entityId, (results, error) => {
337
+ // Make the call - iapVerifyAdapterCapability(entityType, actionType, entityId, callback)
338
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, entityId, (results, error) => {
166
339
  if (error) {
167
340
  return callback(null, error);
168
341
  }
@@ -180,7 +353,7 @@ class Servicenow extends AdapterBaseCl {
180
353
  }
181
354
 
182
355
  // need to check the cache again since it has been updated
183
- return this.requestHandlerInst.verifyCapability(entityType, actionType, entityId, (vcapable, verror) => {
356
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, entityId, (vcapable, verror) => {
184
357
  if (verror) {
185
358
  return callback(null, verror);
186
359
  }
@@ -213,7 +386,7 @@ class Servicenow extends AdapterBaseCl {
213
386
  // if no entity id
214
387
  if (!entityId) {
215
388
  // need to check the cache again since it has been updated
216
- return this.requestHandlerInst.verifyCapability(entityType, actionType, null, (vcapable, verror) => {
389
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, null, (vcapable, verror) => {
217
390
  if (verror) {
218
391
  return callback(null, verror);
219
392
  }
@@ -234,7 +407,7 @@ class Servicenow extends AdapterBaseCl {
234
407
  }
235
408
 
236
409
  // need to check the cache again since it has been updated
237
- return this.requestHandlerInst.verifyCapability(entityType, actionType, null, (vcapable, verror) => {
410
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, null, (vcapable, verror) => {
238
411
  if (verror) {
239
412
  return callback(null, verror);
240
413
  }
@@ -275,22 +448,401 @@ class Servicenow extends AdapterBaseCl {
275
448
  /**
276
449
  * @summary Updates the cache for all entities by call the get All entity method
277
450
  *
278
- * @function updateEntityCache
451
+ * @function iapUpdateAdapterEntityCache
452
+ *
453
+ */
454
+ iapUpdateAdapterEntityCache() {
455
+ const origin = `${this.id}-adapter-iapUpdateAdapterEntityCache`;
456
+ log.trace(origin);
457
+
458
+ if (this.caching) {
459
+ // if the cache is invalid, update the cache
460
+ this.getEntities(null, null, null, null, (data, err) => {
461
+ if (err) {
462
+ log.trace(`${origin}: Could not load template_entity into cache - ${err}`);
463
+ }
464
+ });
465
+ }
466
+ }
467
+
468
+ /**
469
+ * @summary Determines if this adapter supports any in a list of entities
470
+ *
471
+ * @function hasEntities
472
+ * @param {String} entityType - the entity type to check for
473
+ * @param {Array} entityList - the list of entities we are looking for
474
+ *
475
+ * @param {Callback} callback - A map where the entity is the key and the
476
+ * value is true or false
477
+ */
478
+ hasEntities(entityType, entityList, callback) {
479
+ const meth = 'adapter-hasEntities';
480
+ const origin = `${this.id}-${meth}`;
481
+ log.trace(origin);
482
+
483
+ try {
484
+ return super.hasEntities(entityType, entityList, callback);
485
+ } catch (err) {
486
+ log.error(`${origin}: ${err}`);
487
+ return callback(null, err);
488
+ }
489
+ }
490
+
491
+ /**
492
+ * @summary Get Appliance that match the deviceName
493
+ *
494
+ * @function getDevice
495
+ * @param {String} deviceName - the deviceName to find (required)
496
+ *
497
+ * @param {getCallback} callback - a callback function to return the result
498
+ * (appliance) or the error
499
+ */
500
+ getDevice(deviceName, callback) {
501
+ const meth = 'adapter-getDevice';
502
+ const origin = `${this.id}-${meth}`;
503
+ log.trace(origin);
504
+
505
+ try {
506
+ return super.getDevice(deviceName, callback);
507
+ } catch (err) {
508
+ log.error(`${origin}: ${err}`);
509
+ return callback(null, err);
510
+ }
511
+ }
512
+
513
+ /**
514
+ * @summary Get Appliances that match the filter
515
+ *
516
+ * @function getDevicesFiltered
517
+ * @param {Object} options - the data to use to filter the appliances (optional)
518
+ *
519
+ * @param {getCallback} callback - a callback function to return the result
520
+ * (appliances) or the error
521
+ */
522
+ getDevicesFiltered(options, callback) {
523
+ const meth = 'adapter-getDevicesFiltered';
524
+ const origin = `${this.id}-${meth}`;
525
+ log.trace(origin);
526
+
527
+ try {
528
+ return super.getDevicesFiltered(options, callback);
529
+ } catch (err) {
530
+ log.error(`${origin}: ${err}`);
531
+ return callback(null, err);
532
+ }
533
+ }
534
+
535
+ /**
536
+ * @summary Gets the status for the provided appliance
537
+ *
538
+ * @function isAlive
539
+ * @param {String} deviceName - the deviceName of the appliance. (required)
540
+ *
541
+ * @param {configCallback} callback - callback function to return the result
542
+ * (appliance isAlive) or the error
543
+ */
544
+ isAlive(deviceName, callback) {
545
+ const meth = 'adapter-isAlive';
546
+ const origin = `${this.id}-${meth}`;
547
+ log.trace(origin);
548
+
549
+ try {
550
+ return super.isAlive(deviceName, callback);
551
+ } catch (err) {
552
+ log.error(`${origin}: ${err}`);
553
+ return callback(null, err);
554
+ }
555
+ }
556
+
557
+ /**
558
+ * @summary Gets a config for the provided Appliance
559
+ *
560
+ * @function getConfig
561
+ * @param {String} deviceName - the deviceName of the appliance. (required)
562
+ * @param {String} format - the desired format of the config. (optional)
563
+ *
564
+ * @param {configCallback} callback - callback function to return the result
565
+ * (appliance config) or the error
566
+ */
567
+ getConfig(deviceName, format, callback) {
568
+ const meth = 'adapter-getConfig';
569
+ const origin = `${this.id}-${meth}`;
570
+ log.trace(origin);
571
+
572
+ try {
573
+ return super.getConfig(deviceName, format, callback);
574
+ } catch (err) {
575
+ log.error(`${origin}: ${err}`);
576
+ return callback(null, err);
577
+ }
578
+ }
579
+
580
+ /**
581
+ * @summary Gets the device count from the system
582
+ *
583
+ * @function iapGetDeviceCount
584
+ *
585
+ * @param {getCallback} callback - callback function to return the result
586
+ * (count) or the error
587
+ */
588
+ iapGetDeviceCount(callback) {
589
+ const meth = 'adapter-iapGetDeviceCount';
590
+ const origin = `${this.id}-${meth}`;
591
+ log.trace(origin);
592
+
593
+ try {
594
+ return super.iapGetDeviceCount(callback);
595
+ } catch (err) {
596
+ log.error(`${origin}: ${err}`);
597
+ return callback(null, err);
598
+ }
599
+ }
600
+
601
+ /* GENERIC ADAPTER REQUEST - allows extension of adapter without new calls being added */
602
+ /**
603
+ * Makes the requested generic call
279
604
  *
605
+ * @function genericAdapterRequest
606
+ * @param {String} uriPath - the path of the api call - do not include the host, port, base path or version (required)
607
+ * @param {String} restMethod - the rest method (GET, POST, PUT, PATCH, DELETE) (required)
608
+ * @param {Object} queryData - the parameters to be put on the url (optional).
609
+ * Can be a stringified Object.
610
+ * @param {Object} requestBody - the body to add to the request (optional).
611
+ * Can be a stringified Object.
612
+ * @param {Object} addlHeaders - additional headers to be put on the call (optional).
613
+ * Can be a stringified Object.
614
+ * @param {getCallback} callback - a callback function to return the result (Generics)
615
+ * or the error
616
+ */
617
+ genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) {
618
+ const meth = 'adapter-genericAdapterRequest';
619
+ const origin = `${this.id}-${meth}`;
620
+ log.trace(origin);
621
+
622
+ if (this.suspended && this.suspendMode === 'error') {
623
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
624
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
625
+ return callback(null, errorObj);
626
+ }
627
+
628
+ /* HERE IS WHERE YOU VALIDATE DATA */
629
+ if (uriPath === undefined || uriPath === null || uriPath === '') {
630
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['uriPath'], null, null, null);
631
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
632
+ return callback(null, errorObj);
633
+ }
634
+ if (restMethod === undefined || restMethod === null || restMethod === '') {
635
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['restMethod'], null, null, null);
636
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
637
+ return callback(null, errorObj);
638
+ }
639
+
640
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
641
+ // remove any leading / and split the uripath into path variables
642
+ let myPath = uriPath;
643
+ while (myPath.indexOf('/') === 0) {
644
+ myPath = myPath.substring(1);
645
+ }
646
+ const pathVars = myPath.split('/');
647
+ const queryParamsAvailable = queryData;
648
+ const queryParams = {};
649
+ const bodyVars = requestBody;
650
+
651
+ // loop in template. long callback arg name to avoid identifier conflicts
652
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
653
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
654
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
655
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
656
+ }
657
+ });
658
+
659
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
660
+ const reqObj = {
661
+ payload: bodyVars,
662
+ uriPathVars: pathVars,
663
+ uriQuery: queryParams,
664
+ uriOptions: {}
665
+ };
666
+ // add headers if provided
667
+ if (addlHeaders) {
668
+ reqObj.addlHeaders = addlHeaders;
669
+ }
670
+
671
+ // determine the call and return flag
672
+ let action = 'getGenerics';
673
+ let returnF = true;
674
+ if (restMethod.toUpperCase() === 'POST') {
675
+ action = 'createGeneric';
676
+ } else if (restMethod.toUpperCase() === 'PUT') {
677
+ action = 'updateGeneric';
678
+ } else if (restMethod.toUpperCase() === 'PATCH') {
679
+ action = 'patchGeneric';
680
+ } else if (restMethod.toUpperCase() === 'DELETE') {
681
+ action = 'deleteGeneric';
682
+ returnF = false;
683
+ }
684
+
685
+ try {
686
+ // Make the call -
687
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
688
+ return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
689
+ // if we received an error or their is no response on the results
690
+ // return an error
691
+ if (irReturnError) {
692
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
693
+ return callback(null, irReturnError);
694
+ }
695
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
696
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['genericAdapterRequest'], null, null, null);
697
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
698
+ return callback(null, errorObj);
699
+ }
700
+
701
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
702
+ // return the response
703
+ return callback(irReturnData, null);
704
+ });
705
+ } catch (ex) {
706
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
707
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
708
+ return callback(null, errorObj);
709
+ }
710
+ }
711
+
712
+ /**
713
+ * Makes the requested generic call with no base path or version
714
+ *
715
+ * @function genericAdapterRequestNoBasePath
716
+ * @param {String} uriPath - the path of the api call - do not include the host, port, base path or version (required)
717
+ * @param {String} restMethod - the rest method (GET, POST, PUT, PATCH, DELETE) (required)
718
+ * @param {Object} queryData - the parameters to be put on the url (optional).
719
+ * Can be a stringified Object.
720
+ * @param {Object} requestBody - the body to add to the request (optional).
721
+ * Can be a stringified Object.
722
+ * @param {Object} addlHeaders - additional headers to be put on the call (optional).
723
+ * Can be a stringified Object.
724
+ * @param {getCallback} callback - a callback function to return the result (Generics)
725
+ * or the error
726
+ */
727
+ genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) {
728
+ const meth = 'adapter-genericAdapterRequestNoBasePath';
729
+ const origin = `${this.id}-${meth}`;
730
+ log.trace(origin);
731
+
732
+ if (this.suspended && this.suspendMode === 'error') {
733
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
734
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
735
+ return callback(null, errorObj);
736
+ }
737
+
738
+ /* HERE IS WHERE YOU VALIDATE DATA */
739
+ if (uriPath === undefined || uriPath === null || uriPath === '') {
740
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['uriPath'], null, null, null);
741
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
742
+ return callback(null, errorObj);
743
+ }
744
+ if (restMethod === undefined || restMethod === null || restMethod === '') {
745
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['restMethod'], null, null, null);
746
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
747
+ return callback(null, errorObj);
748
+ }
749
+
750
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
751
+ // remove any leading / and split the uripath into path variables
752
+ let myPath = uriPath;
753
+ while (myPath.indexOf('/') === 0) {
754
+ myPath = myPath.substring(1);
755
+ }
756
+ const pathVars = myPath.split('/');
757
+ const queryParamsAvailable = queryData;
758
+ const queryParams = {};
759
+ const bodyVars = requestBody;
760
+
761
+ // loop in template. long callback arg name to avoid identifier conflicts
762
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
763
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
764
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
765
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
766
+ }
767
+ });
768
+
769
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
770
+ const reqObj = {
771
+ payload: bodyVars,
772
+ uriPathVars: pathVars,
773
+ uriQuery: queryParams,
774
+ uriOptions: {}
775
+ };
776
+ // add headers if provided
777
+ if (addlHeaders) {
778
+ reqObj.addlHeaders = addlHeaders;
779
+ }
780
+
781
+ // determine the call and return flag
782
+ let action = 'getGenericsNoBase';
783
+ let returnF = true;
784
+ if (restMethod.toUpperCase() === 'POST') {
785
+ action = 'createGenericNoBase';
786
+ } else if (restMethod.toUpperCase() === 'PUT') {
787
+ action = 'updateGenericNoBase';
788
+ } else if (restMethod.toUpperCase() === 'PATCH') {
789
+ action = 'patchGenericNoBase';
790
+ } else if (restMethod.toUpperCase() === 'DELETE') {
791
+ action = 'deleteGenericNoBase';
792
+ returnF = false;
793
+ }
794
+
795
+ try {
796
+ // Make the call -
797
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
798
+ return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
799
+ // if we received an error or their is no response on the results
800
+ // return an error
801
+ if (irReturnError) {
802
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
803
+ return callback(null, irReturnError);
804
+ }
805
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
806
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['genericAdapterRequestNoBasePath'], null, null, null);
807
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
808
+ return callback(null, errorObj);
809
+ }
810
+
811
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
812
+ // return the response
813
+ return callback(irReturnData, null);
814
+ });
815
+ } catch (ex) {
816
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
817
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
818
+ return callback(null, errorObj);
819
+ }
820
+ }
821
+
822
+ /**
823
+ * @callback healthCallback
824
+ * @param {Object} result - the result of the get request (contains an id and a status)
825
+ */
826
+ /**
827
+ * @callback getCallback
828
+ * @param {Object} result - the result of the get request (entity/ies)
829
+ * @param {String} error - any error that occurred
830
+ */
831
+ /**
832
+ * @callback createCallback
833
+ * @param {Object} item - the newly created entity
834
+ * @param {String} error - any error that occurred
835
+ */
836
+ /**
837
+ * @callback updateCallback
838
+ * @param {String} status - the status of the update action
839
+ * @param {String} error - any error that occurred
840
+ */
841
+ /**
842
+ * @callback deleteCallback
843
+ * @param {String} status - the status of the delete action
844
+ * @param {String} error - any error that occurred
280
845
  */
281
- updateEntityCache() {
282
- const origin = `${this.id}-adapter-updateEntityCache`;
283
- log.trace(origin);
284
-
285
- if (this.caching) {
286
- // if the cache is invalid, update the cache
287
- this.getEntities(null, null, null, null, (data, err) => {
288
- if (err) {
289
- log.trace(`${origin}: Could not load template_entity into cache - ${err}`);
290
- }
291
- });
292
- }
293
- }
294
846
 
295
847
  /**
296
848
  * @summary Retrieves the record identified by the specified sys_id from the specified table.
@@ -306,6 +858,12 @@ class Servicenow extends AdapterBaseCl {
306
858
  const origin = `${this.id}-${meth}`;
307
859
  log.trace(origin);
308
860
 
861
+ if (this.suspended && this.suspendMode === 'error') {
862
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
863
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
864
+ return callback(null, errorObj);
865
+ }
866
+
309
867
  /* HERE IS WHERE YOU VALIDATE DATA */
310
868
  if (tableName === undefined || tableName === null || tableName === '') {
311
869
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -402,6 +960,12 @@ class Servicenow extends AdapterBaseCl {
402
960
  const origin = `${this.id}-${meth}`;
403
961
  log.trace(origin);
404
962
 
963
+ if (this.suspended && this.suspendMode === 'error') {
964
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
965
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
966
+ return callback(null, errorObj);
967
+ }
968
+
405
969
  /* HERE IS WHERE YOU VALIDATE DATA */
406
970
  if (tableName === undefined || tableName === null || tableName === '') {
407
971
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -473,6 +1037,12 @@ class Servicenow extends AdapterBaseCl {
473
1037
  const origin = `${this.id}-${meth}`;
474
1038
  log.trace(origin);
475
1039
 
1040
+ if (this.suspended && this.suspendMode === 'error') {
1041
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1042
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1043
+ return callback(null, errorObj);
1044
+ }
1045
+
476
1046
  /* HERE IS WHERE YOU VALIDATE DATA */
477
1047
  if (tableName === undefined || tableName === null || tableName === '') {
478
1048
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -550,6 +1120,12 @@ class Servicenow extends AdapterBaseCl {
550
1120
  const origin = `${this.id}-${meth}`;
551
1121
  log.trace(origin);
552
1122
 
1123
+ if (this.suspended && this.suspendMode === 'error') {
1124
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1125
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1126
+ return callback(null, errorObj);
1127
+ }
1128
+
553
1129
  /* HERE IS WHERE YOU VALIDATE DATA */
554
1130
  if (tableName === undefined || tableName === null || tableName === '') {
555
1131
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -631,6 +1207,12 @@ class Servicenow extends AdapterBaseCl {
631
1207
  const origin = `${this.id}-${meth}`;
632
1208
  log.trace(origin);
633
1209
 
1210
+ if (this.suspended && this.suspendMode === 'error') {
1211
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1212
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1213
+ return callback(null, errorObj);
1214
+ }
1215
+
634
1216
  /* HERE IS WHERE YOU VALIDATE DATA */
635
1217
  if (tableName === undefined || tableName === null || tableName === '') {
636
1218
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -706,6 +1288,12 @@ class Servicenow extends AdapterBaseCl {
706
1288
  const origin = `${this.id}-${meth}`;
707
1289
  log.trace(origin);
708
1290
 
1291
+ if (this.suspended && this.suspendMode === 'error') {
1292
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1293
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1294
+ return callback(null, errorObj);
1295
+ }
1296
+
709
1297
  /* HERE IS WHERE YOU VALIDATE DATA */
710
1298
  if (agentId === undefined || agentId === null || agentId === '') {
711
1299
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['agentId'], null, null, null);
@@ -777,6 +1365,12 @@ class Servicenow extends AdapterBaseCl {
777
1365
  const origin = `${this.id}-${meth}`;
778
1366
  log.trace(origin);
779
1367
 
1368
+ if (this.suspended && this.suspendMode === 'error') {
1369
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1370
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1371
+ return callback(null, errorObj);
1372
+ }
1373
+
780
1374
  /* HERE IS WHERE YOU VALIDATE DATA */
781
1375
  if (agentId === undefined || agentId === null || agentId === '') {
782
1376
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['agentId'], null, null, null);
@@ -852,6 +1446,12 @@ class Servicenow extends AdapterBaseCl {
852
1446
  const origin = `${this.id}-${meth}`;
853
1447
  log.trace(origin);
854
1448
 
1449
+ if (this.suspended && this.suspendMode === 'error') {
1450
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1451
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1452
+ return callback(null, errorObj);
1453
+ }
1454
+
855
1455
  /* HERE IS WHERE YOU VALIDATE DATA */
856
1456
 
857
1457
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -918,6 +1518,12 @@ class Servicenow extends AdapterBaseCl {
918
1518
  const origin = `${this.id}-${meth}`;
919
1519
  log.trace(origin);
920
1520
 
1521
+ if (this.suspended && this.suspendMode === 'error') {
1522
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1523
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1524
+ return callback(null, errorObj);
1525
+ }
1526
+
921
1527
  /* HERE IS WHERE YOU VALIDATE DATA */
922
1528
  if (changeId === undefined || changeId === null || changeId === '') {
923
1529
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -989,6 +1595,12 @@ class Servicenow extends AdapterBaseCl {
989
1595
  const origin = `${this.id}-${meth}`;
990
1596
  log.trace(origin);
991
1597
 
1598
+ if (this.suspended && this.suspendMode === 'error') {
1599
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1600
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1601
+ return callback(null, errorObj);
1602
+ }
1603
+
992
1604
  /* HERE IS WHERE YOU VALIDATE DATA */
993
1605
  if (changeId === undefined || changeId === null || changeId === '') {
994
1606
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1059,6 +1671,12 @@ class Servicenow extends AdapterBaseCl {
1059
1671
  const origin = `${this.id}-${meth}`;
1060
1672
  log.trace(origin);
1061
1673
 
1674
+ if (this.suspended && this.suspendMode === 'error') {
1675
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1676
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1677
+ return callback(null, errorObj);
1678
+ }
1679
+
1062
1680
  /* HERE IS WHERE YOU VALIDATE DATA */
1063
1681
 
1064
1682
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -1125,6 +1743,12 @@ class Servicenow extends AdapterBaseCl {
1125
1743
  const origin = `${this.id}-${meth}`;
1126
1744
  log.trace(origin);
1127
1745
 
1746
+ if (this.suspended && this.suspendMode === 'error') {
1747
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1748
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1749
+ return callback(null, errorObj);
1750
+ }
1751
+
1128
1752
  /* HERE IS WHERE YOU VALIDATE DATA */
1129
1753
  if (changeId === undefined || changeId === null || changeId === '') {
1130
1754
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1195,6 +1819,12 @@ class Servicenow extends AdapterBaseCl {
1195
1819
  const origin = `${this.id}-${meth}`;
1196
1820
  log.trace(origin);
1197
1821
 
1822
+ if (this.suspended && this.suspendMode === 'error') {
1823
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1824
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1825
+ return callback(null, errorObj);
1826
+ }
1827
+
1198
1828
  /* HERE IS WHERE YOU VALIDATE DATA */
1199
1829
  if (standardChangeTemplateId === undefined || standardChangeTemplateId === null || standardChangeTemplateId === '') {
1200
1830
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['standardChangeTemplateId'], null, null, null);
@@ -1265,6 +1895,12 @@ class Servicenow extends AdapterBaseCl {
1265
1895
  const origin = `${this.id}-${meth}`;
1266
1896
  log.trace(origin);
1267
1897
 
1898
+ if (this.suspended && this.suspendMode === 'error') {
1899
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1900
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1901
+ return callback(null, errorObj);
1902
+ }
1903
+
1268
1904
  /* HERE IS WHERE YOU VALIDATE DATA */
1269
1905
 
1270
1906
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -1331,6 +1967,12 @@ class Servicenow extends AdapterBaseCl {
1331
1967
  const origin = `${this.id}-${meth}`;
1332
1968
  log.trace(origin);
1333
1969
 
1970
+ if (this.suspended && this.suspendMode === 'error') {
1971
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1972
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1973
+ return callback(null, errorObj);
1974
+ }
1975
+
1334
1976
  /* HERE IS WHERE YOU VALIDATE DATA */
1335
1977
  if (changeId === undefined || changeId === null || changeId === '') {
1336
1978
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1392,22 +2034,33 @@ class Servicenow extends AdapterBaseCl {
1392
2034
  * @summary Creates one normal change request based on the default normal change request record.
1393
2035
  *
1394
2036
  * @function createNormalChangeRequest
1395
- * @param {object} sysparmQuery - Encoded query used to filter the result set. e.g. { change: 'CHG123456' }
2037
+ * @param {object} change - The change request information to create
1396
2038
  * @param {getCallback} callback - a callback function to return the result
1397
2039
  */
1398
2040
  /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1399
- createNormalChangeRequest(sysparmQuery, callback) {
2041
+ createNormalChangeRequest(change, callback) {
1400
2042
  const meth = 'adapter-createNormalChangeRequest';
1401
2043
  const origin = `${this.id}-${meth}`;
1402
2044
  log.trace(origin);
1403
2045
 
2046
+ if (this.suspended && this.suspendMode === 'error') {
2047
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2048
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2049
+ return callback(null, errorObj);
2050
+ }
2051
+
1404
2052
  /* HERE IS WHERE YOU VALIDATE DATA */
2053
+ if (change === undefined || change === null || change === '') {
2054
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['change'], null, null, null);
2055
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2056
+ return callback(null, errorObj);
2057
+ }
1405
2058
 
1406
2059
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1407
2060
  const queryParamsAvailable = {};
1408
- const queryParams = sysparmQuery;
2061
+ const queryParams = {};
1409
2062
  const pathVars = [];
1410
- const bodyVars = {};
2063
+ const bodyVars = change;
1411
2064
 
1412
2065
  // loop in template. long callback arg name to avoid identifier conflicts
1413
2066
  if (queryParamsAvailable && Object.keys(queryParamsAvailable).length > 0) {
@@ -1453,6 +2106,88 @@ class Servicenow extends AdapterBaseCl {
1453
2106
  }
1454
2107
  }
1455
2108
 
2109
+ /**
2110
+ * @summary Updates one normal change request based on the default normal change request record.
2111
+ *
2112
+ * @function updateNormalChangeRequestById
2113
+ * @param {string} changeId - Unique identifier of the standard change request to update from the [change_request] table.
2114
+ * @param {object} change - The change request information to update
2115
+ * @param {getCallback} callback - a callback function to return the result
2116
+ */
2117
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2118
+ updateNormalChangeRequestById(changeId, change, callback) {
2119
+ const meth = 'adapter-updateNormalChangeRequestById';
2120
+ const origin = `${this.id}-${meth}`;
2121
+ log.trace(origin);
2122
+
2123
+ if (this.suspended && this.suspendMode === 'error') {
2124
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2125
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2126
+ return callback(null, errorObj);
2127
+ }
2128
+
2129
+ /* HERE IS WHERE YOU VALIDATE DATA */
2130
+ if (changeId === undefined || changeId === null || changeId === '') {
2131
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
2132
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2133
+ return callback(null, errorObj);
2134
+ }
2135
+ if (change === undefined || change === null || change === '') {
2136
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['change'], null, null, null);
2137
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2138
+ return callback(null, errorObj);
2139
+ }
2140
+
2141
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2142
+ const queryParamsAvailable = {};
2143
+ const queryParams = {};
2144
+ const pathVars = [changeId];
2145
+ const bodyVars = change;
2146
+
2147
+ // loop in template. long callback arg name to avoid identifier conflicts
2148
+ if (queryParamsAvailable && Object.keys(queryParamsAvailable).length > 0) {
2149
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2150
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2151
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2152
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2153
+ }
2154
+ });
2155
+ }
2156
+
2157
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
2158
+ const reqObj = {
2159
+ payload: bodyVars,
2160
+ uriPathVars: pathVars,
2161
+ uriQuery: queryParams
2162
+ };
2163
+
2164
+ try {
2165
+ // Make the call -
2166
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2167
+ return this.requestHandlerInst.identifyRequest('ChangeManagement', 'updateNormalChangeRequestById', reqObj, true, (irReturnData, irReturnError) => {
2168
+ // if we received an error or their is no response on the results
2169
+ // return an error
2170
+ if (irReturnError) {
2171
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2172
+ return callback(null, irReturnError);
2173
+ }
2174
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2175
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateNormalChangeRequestById'], null, null, null);
2176
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2177
+ return callback(null, errorObj);
2178
+ }
2179
+
2180
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2181
+ // return the response
2182
+ return callback(irReturnData, null);
2183
+ });
2184
+ } catch (ex) {
2185
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2186
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2187
+ return callback(null, errorObj);
2188
+ }
2189
+ }
2190
+
1456
2191
  /**
1457
2192
  * @summary Deletes the normal change request identified by the specified sys_id.
1458
2193
  *
@@ -1467,6 +2202,12 @@ class Servicenow extends AdapterBaseCl {
1467
2202
  const origin = `${this.id}-${meth}`;
1468
2203
  log.trace(origin);
1469
2204
 
2205
+ if (this.suspended && this.suspendMode === 'error') {
2206
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2207
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2208
+ return callback(null, errorObj);
2209
+ }
2210
+
1470
2211
  /* HERE IS WHERE YOU VALIDATE DATA */
1471
2212
  if (changeId === undefined || changeId === null || changeId === '') {
1472
2213
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1537,6 +2278,12 @@ class Servicenow extends AdapterBaseCl {
1537
2278
  const origin = `${this.id}-${meth}`;
1538
2279
  log.trace(origin);
1539
2280
 
2281
+ if (this.suspended && this.suspendMode === 'error') {
2282
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2283
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2284
+ return callback(null, errorObj);
2285
+ }
2286
+
1540
2287
  /* HERE IS WHERE YOU VALIDATE DATA */
1541
2288
 
1542
2289
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -1603,6 +2350,12 @@ class Servicenow extends AdapterBaseCl {
1603
2350
  const origin = `${this.id}-${meth}`;
1604
2351
  log.trace(origin);
1605
2352
 
2353
+ if (this.suspended && this.suspendMode === 'error') {
2354
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2355
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2356
+ return callback(null, errorObj);
2357
+ }
2358
+
1606
2359
  /* HERE IS WHERE YOU VALIDATE DATA */
1607
2360
  if (changeId === undefined || changeId === null || changeId === '') {
1608
2361
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1673,6 +2426,12 @@ class Servicenow extends AdapterBaseCl {
1673
2426
  const origin = `${this.id}-${meth}`;
1674
2427
  log.trace(origin);
1675
2428
 
2429
+ if (this.suspended && this.suspendMode === 'error') {
2430
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2431
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2432
+ return callback(null, errorObj);
2433
+ }
2434
+
1676
2435
  /* HERE IS WHERE YOU VALIDATE DATA */
1677
2436
 
1678
2437
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -1739,6 +2498,12 @@ class Servicenow extends AdapterBaseCl {
1739
2498
  const origin = `${this.id}-${meth}`;
1740
2499
  log.trace(origin);
1741
2500
 
2501
+ if (this.suspended && this.suspendMode === 'error') {
2502
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2503
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2504
+ return callback(null, errorObj);
2505
+ }
2506
+
1742
2507
  /* HERE IS WHERE YOU VALIDATE DATA */
1743
2508
  if (changeId === undefined || changeId === null || changeId === '') {
1744
2509
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1810,6 +2575,12 @@ class Servicenow extends AdapterBaseCl {
1810
2575
  const origin = `${this.id}-${meth}`;
1811
2576
  log.trace(origin);
1812
2577
 
2578
+ if (this.suspended && this.suspendMode === 'error') {
2579
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2580
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2581
+ return callback(null, errorObj);
2582
+ }
2583
+
1813
2584
  /* HERE IS WHERE YOU VALIDATE DATA */
1814
2585
  if (changeId === undefined || changeId === null || changeId === '') {
1815
2586
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1882,6 +2653,12 @@ class Servicenow extends AdapterBaseCl {
1882
2653
  const origin = `${this.id}-${meth}`;
1883
2654
  log.trace(origin);
1884
2655
 
2656
+ if (this.suspended && this.suspendMode === 'error') {
2657
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2658
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2659
+ return callback(null, errorObj);
2660
+ }
2661
+
1885
2662
  /* HERE IS WHERE YOU VALIDATE DATA */
1886
2663
  if (changeId === undefined || changeId === null || changeId === '') {
1887
2664
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -1958,6 +2735,12 @@ class Servicenow extends AdapterBaseCl {
1958
2735
  const origin = `${this.id}-${meth}`;
1959
2736
  log.trace(origin);
1960
2737
 
2738
+ if (this.suspended && this.suspendMode === 'error') {
2739
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2740
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2741
+ return callback(null, errorObj);
2742
+ }
2743
+
1961
2744
  /* HERE IS WHERE YOU VALIDATE DATA */
1962
2745
  if (changeId === undefined || changeId === null || changeId === '') {
1963
2746
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -2030,6 +2813,12 @@ class Servicenow extends AdapterBaseCl {
2030
2813
  const origin = `${this.id}-${meth}`;
2031
2814
  log.trace(origin);
2032
2815
 
2816
+ if (this.suspended && this.suspendMode === 'error') {
2817
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2818
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2819
+ return callback(null, errorObj);
2820
+ }
2821
+
2033
2822
  /* HERE IS WHERE YOU VALIDATE DATA */
2034
2823
  if (changeId === undefined || changeId === null || changeId === '') {
2035
2824
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -2106,6 +2895,12 @@ class Servicenow extends AdapterBaseCl {
2106
2895
  const origin = `${this.id}-${meth}`;
2107
2896
  log.trace(origin);
2108
2897
 
2898
+ if (this.suspended && this.suspendMode === 'error') {
2899
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2900
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2901
+ return callback(null, errorObj);
2902
+ }
2903
+
2109
2904
  /* HERE IS WHERE YOU VALIDATE DATA */
2110
2905
  if (changeId === undefined || changeId === null || changeId === '') {
2111
2906
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -2177,6 +2972,12 @@ class Servicenow extends AdapterBaseCl {
2177
2972
  const origin = `${this.id}-${meth}`;
2178
2973
  log.trace(origin);
2179
2974
 
2975
+ if (this.suspended && this.suspendMode === 'error') {
2976
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2977
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2978
+ return callback(null, errorObj);
2979
+ }
2980
+
2180
2981
  /* HERE IS WHERE YOU VALIDATE DATA */
2181
2982
  if (changeId === undefined || changeId === null || changeId === '') {
2182
2983
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -2248,6 +3049,12 @@ class Servicenow extends AdapterBaseCl {
2248
3049
  const origin = `${this.id}-${meth}`;
2249
3050
  log.trace(origin);
2250
3051
 
3052
+ if (this.suspended && this.suspendMode === 'error') {
3053
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3054
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3055
+ return callback(null, errorObj);
3056
+ }
3057
+
2251
3058
  /* HERE IS WHERE YOU VALIDATE DATA */
2252
3059
  if (changeId === undefined || changeId === null || changeId === '') {
2253
3060
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -2319,6 +3126,12 @@ class Servicenow extends AdapterBaseCl {
2319
3126
  const origin = `${this.id}-${meth}`;
2320
3127
  log.trace(origin);
2321
3128
 
3129
+ if (this.suspended && this.suspendMode === 'error') {
3130
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3131
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3132
+ return callback(null, errorObj);
3133
+ }
3134
+
2322
3135
  /* HERE IS WHERE YOU VALIDATE DATA */
2323
3136
  if (tableName === undefined || tableName === null || tableName === '') {
2324
3137
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -2395,6 +3208,12 @@ class Servicenow extends AdapterBaseCl {
2395
3208
  const origin = `${this.id}-${meth}`;
2396
3209
  log.trace(origin);
2397
3210
 
3211
+ if (this.suspended && this.suspendMode === 'error') {
3212
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3213
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3214
+ return callback(null, errorObj);
3215
+ }
3216
+
2398
3217
  /* HERE IS WHERE YOU VALIDATE DATA */
2399
3218
  if (tableName === undefined || tableName === null || tableName === '') {
2400
3219
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['tableName'], null, null, null);
@@ -2470,6 +3289,12 @@ class Servicenow extends AdapterBaseCl {
2470
3289
  const origin = `${this.id}-${meth}`;
2471
3290
  log.trace(origin);
2472
3291
 
3292
+ if (this.suspended && this.suspendMode === 'error') {
3293
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3294
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3295
+ return callback(null, errorObj);
3296
+ }
3297
+
2473
3298
  /* HERE IS WHERE YOU VALIDATE DATA */
2474
3299
  if (appId === undefined || appId === null || appId === '') {
2475
3300
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['appId'], null, null, null);
@@ -2541,6 +3366,12 @@ class Servicenow extends AdapterBaseCl {
2541
3366
  const origin = `${this.id}-${meth}`;
2542
3367
  log.trace(origin);
2543
3368
 
3369
+ if (this.suspended && this.suspendMode === 'error') {
3370
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3371
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3372
+ return callback(null, errorObj);
3373
+ }
3374
+
2544
3375
  /* HERE IS WHERE YOU VALIDATE DATA */
2545
3376
  if (body === undefined || body === null || body === '') {
2546
3377
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -2611,6 +3442,12 @@ class Servicenow extends AdapterBaseCl {
2611
3442
  const origin = `${this.id}-${meth}`;
2612
3443
  log.trace(origin);
2613
3444
 
3445
+ if (this.suspended && this.suspendMode === 'error') {
3446
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3447
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3448
+ return callback(null, errorObj);
3449
+ }
3450
+
2614
3451
  /* HERE IS WHERE YOU VALIDATE DATA */
2615
3452
  if (emailId === undefined || emailId === null || emailId === '') {
2616
3453
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['emailId'], null, null, null);
@@ -2681,6 +3518,12 @@ class Servicenow extends AdapterBaseCl {
2681
3518
  const origin = `${this.id}-${meth}`;
2682
3519
  log.trace(origin);
2683
3520
 
3521
+ if (this.suspended && this.suspendMode === 'error') {
3522
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3523
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3524
+ return callback(null, errorObj);
3525
+ }
3526
+
2684
3527
  /* HERE IS WHERE YOU VALIDATE DATA */
2685
3528
  if (body === undefined || body === null || body === '') {
2686
3529
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -2752,6 +3595,12 @@ class Servicenow extends AdapterBaseCl {
2752
3595
  const origin = `${this.id}-${meth}`;
2753
3596
  log.trace(origin);
2754
3597
 
3598
+ if (this.suspended && this.suspendMode === 'error') {
3599
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3600
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3601
+ return callback(null, errorObj);
3602
+ }
3603
+
2755
3604
  /* HERE IS WHERE YOU VALIDATE DATA */
2756
3605
  if (pushApplicationName === undefined || pushApplicationName === null || pushApplicationName === '') {
2757
3606
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['pushApplicationName'], null, null, null);
@@ -2828,6 +3677,12 @@ class Servicenow extends AdapterBaseCl {
2828
3677
  const origin = `${this.id}-${meth}`;
2829
3678
  log.trace(origin);
2830
3679
 
3680
+ if (this.suspended && this.suspendMode === 'error') {
3681
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3682
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3683
+ return callback(null, errorObj);
3684
+ }
3685
+
2831
3686
  /* HERE IS WHERE YOU VALIDATE DATA */
2832
3687
  if (pushApplicationName === undefined || pushApplicationName === null || pushApplicationName === '') {
2833
3688
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['pushApplicationName'], null, null, null);
@@ -2907,6 +3762,12 @@ class Servicenow extends AdapterBaseCl {
2907
3762
  const origin = `${this.id}-${meth}`;
2908
3763
  log.trace(origin);
2909
3764
 
3765
+ if (this.suspended && this.suspendMode === 'error') {
3766
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3767
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3768
+ return callback(null, errorObj);
3769
+ }
3770
+
2910
3771
  /* HERE IS WHERE YOU VALIDATE DATA */
2911
3772
  if (table === undefined || table === null || table === '') {
2912
3773
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['table'], null, null, null);
@@ -2997,6 +3858,12 @@ class Servicenow extends AdapterBaseCl {
2997
3858
  const origin = `${this.id}-${meth}`;
2998
3859
  log.trace(origin);
2999
3860
 
3861
+ if (this.suspended && this.suspendMode === 'error') {
3862
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3863
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3864
+ return callback(null, errorObj);
3865
+ }
3866
+
3000
3867
  /* HERE IS WHERE YOU VALIDATE DATA */
3001
3868
  if (body === undefined || body === null || body === '') {
3002
3869
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -3070,6 +3937,12 @@ class Servicenow extends AdapterBaseCl {
3070
3937
  const origin = `${this.id}-${meth}`;
3071
3938
  log.trace(origin);
3072
3939
 
3940
+ if (this.suspended && this.suspendMode === 'error') {
3941
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3942
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3943
+ return callback(null, errorObj);
3944
+ }
3945
+
3073
3946
  /* HERE IS WHERE YOU VALIDATE DATA */
3074
3947
  if (table === undefined || table === null || table === '') {
3075
3948
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['table'], null, null, null);
@@ -3157,6 +4030,12 @@ class Servicenow extends AdapterBaseCl {
3157
4030
  const origin = `${this.id}-${meth}`;
3158
4031
  log.trace(origin);
3159
4032
 
4033
+ if (this.suspended && this.suspendMode === 'error') {
4034
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4035
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4036
+ return callback(null, errorObj);
4037
+ }
4038
+
3160
4039
  /* HERE IS WHERE YOU VALIDATE DATA */
3161
4040
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
3162
4041
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -3239,6 +4118,12 @@ class Servicenow extends AdapterBaseCl {
3239
4118
  const origin = `${this.id}-${meth}`;
3240
4119
  log.trace(origin);
3241
4120
 
4121
+ if (this.suspended && this.suspendMode === 'error') {
4122
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4123
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4124
+ return callback(null, errorObj);
4125
+ }
4126
+
3242
4127
  /* HERE IS WHERE YOU VALIDATE DATA */
3243
4128
  if (queueId === undefined || queueId === null || queueId === '') {
3244
4129
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['queueId'], null, null, null);
@@ -3314,6 +4199,12 @@ class Servicenow extends AdapterBaseCl {
3314
4199
  const origin = `${this.id}-${meth}`;
3315
4200
  log.trace(origin);
3316
4201
 
4202
+ if (this.suspended && this.suspendMode === 'error') {
4203
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4204
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4205
+ return callback(null, errorObj);
4206
+ }
4207
+
3317
4208
  /* HERE IS WHERE YOU VALIDATE DATA */
3318
4209
  if (userId === undefined || userId === null || userId === '') {
3319
4210
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['userId'], null, null, null);
@@ -3384,6 +4275,12 @@ class Servicenow extends AdapterBaseCl {
3384
4275
  const origin = `${this.id}-${meth}`;
3385
4276
  log.trace(origin);
3386
4277
 
4278
+ if (this.suspended && this.suspendMode === 'error') {
4279
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4280
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4281
+ return callback(null, errorObj);
4282
+ }
4283
+
3387
4284
  /* HERE IS WHERE YOU VALIDATE DATA */
3388
4285
  if (sysparmUuid === undefined || sysparmUuid === null || sysparmUuid === '') {
3389
4286
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmUuid'], null, null, null);
@@ -3454,6 +4351,12 @@ class Servicenow extends AdapterBaseCl {
3454
4351
  const origin = `${this.id}-${meth}`;
3455
4352
  log.trace(origin);
3456
4353
 
4354
+ if (this.suspended && this.suspendMode === 'error') {
4355
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4356
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4357
+ return callback(null, errorObj);
4358
+ }
4359
+
3457
4360
  /* HERE IS WHERE YOU VALIDATE DATA */
3458
4361
  if (sysparmTable === undefined || sysparmTable === null || sysparmTable === '') {
3459
4362
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmTable'], null, null, null);
@@ -3525,6 +4428,12 @@ class Servicenow extends AdapterBaseCl {
3525
4428
  const origin = `${this.id}-${meth}`;
3526
4429
  log.trace(origin);
3527
4430
 
4431
+ if (this.suspended && this.suspendMode === 'error') {
4432
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4433
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4434
+ return callback(null, errorObj);
4435
+ }
4436
+
3528
4437
  /* HERE IS WHERE YOU VALIDATE DATA */
3529
4438
  if (commTaskId === undefined || commTaskId === null || commTaskId === '') {
3530
4439
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['commTaskId'], null, null, null);
@@ -3600,6 +4509,12 @@ class Servicenow extends AdapterBaseCl {
3600
4509
  const origin = `${this.id}-${meth}`;
3601
4510
  log.trace(origin);
3602
4511
 
4512
+ if (this.suspended && this.suspendMode === 'error') {
4513
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4514
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4515
+ return callback(null, errorObj);
4516
+ }
4517
+
3603
4518
  /* HERE IS WHERE YOU VALIDATE DATA */
3604
4519
  if (taskId === undefined || taskId === null || taskId === '') {
3605
4520
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['taskId'], null, null, null);
@@ -3670,6 +4585,12 @@ class Servicenow extends AdapterBaseCl {
3670
4585
  const origin = `${this.id}-${meth}`;
3671
4586
  log.trace(origin);
3672
4587
 
4588
+ if (this.suspended && this.suspendMode === 'error') {
4589
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4590
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4591
+ return callback(null, errorObj);
4592
+ }
4593
+
3673
4594
  /* HERE IS WHERE YOU VALIDATE DATA */
3674
4595
  if (taskId === undefined || taskId === null || taskId === '') {
3675
4596
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['taskId'], null, null, null);
@@ -3742,6 +4663,12 @@ class Servicenow extends AdapterBaseCl {
3742
4663
  const origin = `${this.id}-${meth}`;
3743
4664
  log.trace(origin);
3744
4665
 
4666
+ if (this.suspended && this.suspendMode === 'error') {
4667
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4668
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4669
+ return callback(null, errorObj);
4670
+ }
4671
+
3745
4672
  /* HERE IS WHERE YOU VALIDATE DATA */
3746
4673
  if (sysparmTable === undefined || sysparmTable === null || sysparmTable === '') {
3747
4674
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmTable'], null, null, null);
@@ -3818,6 +4745,12 @@ class Servicenow extends AdapterBaseCl {
3818
4745
  const origin = `${this.id}-${meth}`;
3819
4746
  log.trace(origin);
3820
4747
 
4748
+ if (this.suspended && this.suspendMode === 'error') {
4749
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4750
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4751
+ return callback(null, errorObj);
4752
+ }
4753
+
3821
4754
  /* HERE IS WHERE YOU VALIDATE DATA */
3822
4755
  if (sysparmTable === undefined || sysparmTable === null || sysparmTable === '') {
3823
4756
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmTable'], null, null, null);
@@ -3890,6 +4823,12 @@ class Servicenow extends AdapterBaseCl {
3890
4823
  const origin = `${this.id}-${meth}`;
3891
4824
  log.trace(origin);
3892
4825
 
4826
+ if (this.suspended && this.suspendMode === 'error') {
4827
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4828
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4829
+ return callback(null, errorObj);
4830
+ }
4831
+
3893
4832
  /* HERE IS WHERE YOU VALIDATE DATA */
3894
4833
  if (commTaskId === undefined || commTaskId === null || commTaskId === '') {
3895
4834
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['commTaskId'], null, null, null);
@@ -3966,6 +4905,12 @@ class Servicenow extends AdapterBaseCl {
3966
4905
  const origin = `${this.id}-${meth}`;
3967
4906
  log.trace(origin);
3968
4907
 
4908
+ if (this.suspended && this.suspendMode === 'error') {
4909
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4910
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4911
+ return callback(null, errorObj);
4912
+ }
4913
+
3969
4914
  /* HERE IS WHERE YOU VALIDATE DATA */
3970
4915
  if (sysparmTable === undefined || sysparmTable === null || sysparmTable === '') {
3971
4916
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmTable'], null, null, null);
@@ -4038,6 +4983,12 @@ class Servicenow extends AdapterBaseCl {
4038
4983
  const origin = `${this.id}-${meth}`;
4039
4984
  log.trace(origin);
4040
4985
 
4986
+ if (this.suspended && this.suspendMode === 'error') {
4987
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4988
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4989
+ return callback(null, errorObj);
4990
+ }
4991
+
4041
4992
  /* HERE IS WHERE YOU VALIDATE DATA */
4042
4993
  if (commTaskId === undefined || commTaskId === null || commTaskId === '') {
4043
4994
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['commTaskId'], null, null, null);
@@ -4113,6 +5064,12 @@ class Servicenow extends AdapterBaseCl {
4113
5064
  const origin = `${this.id}-${meth}`;
4114
5065
  log.trace(origin);
4115
5066
 
5067
+ if (this.suspended && this.suspendMode === 'error') {
5068
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5069
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5070
+ return callback(null, errorObj);
5071
+ }
5072
+
4116
5073
  /* HERE IS WHERE YOU VALIDATE DATA */
4117
5074
  if (attachId === undefined || attachId === null || attachId === '') {
4118
5075
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['attachId'], null, null, null);
@@ -4183,6 +5140,12 @@ class Servicenow extends AdapterBaseCl {
4183
5140
  const origin = `${this.id}-${meth}`;
4184
5141
  log.trace(origin);
4185
5142
 
5143
+ if (this.suspended && this.suspendMode === 'error') {
5144
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5145
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5146
+ return callback(null, errorObj);
5147
+ }
5148
+
4186
5149
  /* HERE IS WHERE YOU VALIDATE DATA */
4187
5150
  if (attachId === undefined || attachId === null || attachId === '') {
4188
5151
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['attachId'], null, null, null);
@@ -4254,6 +5217,12 @@ class Servicenow extends AdapterBaseCl {
4254
5217
  const origin = `${this.id}-${meth}`;
4255
5218
  log.trace(origin);
4256
5219
 
5220
+ if (this.suspended && this.suspendMode === 'error') {
5221
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5222
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5223
+ return callback(null, errorObj);
5224
+ }
5225
+
4257
5226
  /* HERE IS WHERE YOU VALIDATE DATA */
4258
5227
 
4259
5228
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -4323,6 +5292,12 @@ class Servicenow extends AdapterBaseCl {
4323
5292
  const origin = `${this.id}-${meth}`;
4324
5293
  log.trace(origin);
4325
5294
 
5295
+ if (this.suspended && this.suspendMode === 'error') {
5296
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5297
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5298
+ return callback(null, errorObj);
5299
+ }
5300
+
4326
5301
  /* HERE IS WHERE YOU VALIDATE DATA */
4327
5302
  if (fileName === undefined || fileName === null || fileName === '') {
4328
5303
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['fileName'], null, null, null);
@@ -4408,6 +5383,12 @@ class Servicenow extends AdapterBaseCl {
4408
5383
  const origin = `${this.id}-${meth}`;
4409
5384
  log.trace(origin);
4410
5385
 
5386
+ if (this.suspended && this.suspendMode === 'error') {
5387
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5388
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5389
+ return callback(null, errorObj);
5390
+ }
5391
+
4411
5392
  /* HERE IS WHERE YOU VALIDATE DATA */
4412
5393
  if (bodyFormData === undefined || bodyFormData === null || bodyFormData === '') {
4413
5394
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['bodyFormData'], null, null, null);
@@ -4478,6 +5459,12 @@ class Servicenow extends AdapterBaseCl {
4478
5459
  const origin = `${this.id}-${meth}`;
4479
5460
  log.trace(origin);
4480
5461
 
5462
+ if (this.suspended && this.suspendMode === 'error') {
5463
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5464
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5465
+ return callback(null, errorObj);
5466
+ }
5467
+
4481
5468
  /* HERE IS WHERE YOU VALIDATE DATA */
4482
5469
  if (attachId === undefined || attachId === null || attachId === '') {
4483
5470
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['attachId'], null, null, null);
@@ -4548,6 +5535,12 @@ class Servicenow extends AdapterBaseCl {
4548
5535
  const origin = `${this.id}-${meth}`;
4549
5536
  log.trace(origin);
4550
5537
 
5538
+ if (this.suspended && this.suspendMode === 'error') {
5539
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5540
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5541
+ return callback(null, errorObj);
5542
+ }
5543
+
4551
5544
  /* HERE IS WHERE YOU VALIDATE DATA */
4552
5545
  if (id === undefined || id === null || id === '') {
4553
5546
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
@@ -4618,6 +5611,12 @@ class Servicenow extends AdapterBaseCl {
4618
5611
  const origin = `${this.id}-${meth}`;
4619
5612
  log.trace(origin);
4620
5613
 
5614
+ if (this.suspended && this.suspendMode === 'error') {
5615
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5616
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5617
+ return callback(null, errorObj);
5618
+ }
5619
+
4621
5620
  /* HERE IS WHERE YOU VALIDATE DATA */
4622
5621
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
4623
5622
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -4688,6 +5687,12 @@ class Servicenow extends AdapterBaseCl {
4688
5687
  const origin = `${this.id}-${meth}`;
4689
5688
  log.trace(origin);
4690
5689
 
5690
+ if (this.suspended && this.suspendMode === 'error') {
5691
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5692
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5693
+ return callback(null, errorObj);
5694
+ }
5695
+
4691
5696
  /* HERE IS WHERE YOU VALIDATE DATA */
4692
5697
  if (id === undefined || id === null || id === '') {
4693
5698
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
@@ -4758,6 +5763,12 @@ class Servicenow extends AdapterBaseCl {
4758
5763
  const origin = `${this.id}-${meth}`;
4759
5764
  log.trace(origin);
4760
5765
 
5766
+ if (this.suspended && this.suspendMode === 'error') {
5767
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5768
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5769
+ return callback(null, errorObj);
5770
+ }
5771
+
4761
5772
  /* HERE IS WHERE YOU VALIDATE DATA */
4762
5773
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
4763
5774
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -4829,6 +5840,12 @@ class Servicenow extends AdapterBaseCl {
4829
5840
  const origin = `${this.id}-${meth}`;
4830
5841
  log.trace(origin);
4831
5842
 
5843
+ if (this.suspended && this.suspendMode === 'error') {
5844
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5845
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5846
+ return callback(null, errorObj);
5847
+ }
5848
+
4832
5849
  /* HERE IS WHERE YOU VALIDATE DATA */
4833
5850
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
4834
5851
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -4905,6 +5922,12 @@ class Servicenow extends AdapterBaseCl {
4905
5922
  const origin = `${this.id}-${meth}`;
4906
5923
  log.trace(origin);
4907
5924
 
5925
+ if (this.suspended && this.suspendMode === 'error') {
5926
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
5927
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
5928
+ return callback(null, errorObj);
5929
+ }
5930
+
4908
5931
  /* HERE IS WHERE YOU VALIDATE DATA */
4909
5932
  if (id === undefined || id === null || id === '') {
4910
5933
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
@@ -4980,6 +6003,12 @@ class Servicenow extends AdapterBaseCl {
4980
6003
  const origin = `${this.id}-${meth}`;
4981
6004
  log.trace(origin);
4982
6005
 
6006
+ if (this.suspended && this.suspendMode === 'error') {
6007
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6008
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6009
+ return callback(null, errorObj);
6010
+ }
6011
+
4983
6012
  /* HERE IS WHERE YOU VALIDATE DATA */
4984
6013
  if (id === undefined || id === null || id === '') {
4985
6014
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
@@ -5050,6 +6079,12 @@ class Servicenow extends AdapterBaseCl {
5050
6079
  const origin = `${this.id}-${meth}`;
5051
6080
  log.trace(origin);
5052
6081
 
6082
+ if (this.suspended && this.suspendMode === 'error') {
6083
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6084
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6085
+ return callback(null, errorObj);
6086
+ }
6087
+
5053
6088
  /* HERE IS WHERE YOU VALIDATE DATA */
5054
6089
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
5055
6090
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -5121,6 +6156,12 @@ class Servicenow extends AdapterBaseCl {
5121
6156
  const origin = `${this.id}-${meth}`;
5122
6157
  log.trace(origin);
5123
6158
 
6159
+ if (this.suspended && this.suspendMode === 'error') {
6160
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6161
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6162
+ return callback(null, errorObj);
6163
+ }
6164
+
5124
6165
  /* HERE IS WHERE YOU VALIDATE DATA */
5125
6166
  if (body === undefined || body === null || body === '') {
5126
6167
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -5191,6 +6232,12 @@ class Servicenow extends AdapterBaseCl {
5191
6232
  const origin = `${this.id}-${meth}`;
5192
6233
  log.trace(origin);
5193
6234
 
6235
+ if (this.suspended && this.suspendMode === 'error') {
6236
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6237
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6238
+ return callback(null, errorObj);
6239
+ }
6240
+
5194
6241
  /* HERE IS WHERE YOU VALIDATE DATA */
5195
6242
  if (id === undefined || id === null || id === '') {
5196
6243
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
@@ -5261,6 +6308,12 @@ class Servicenow extends AdapterBaseCl {
5261
6308
  const origin = `${this.id}-${meth}`;
5262
6309
  log.trace(origin);
5263
6310
 
6311
+ if (this.suspended && this.suspendMode === 'error') {
6312
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6313
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6314
+ return callback(null, errorObj);
6315
+ }
6316
+
5264
6317
  /* HERE IS WHERE YOU VALIDATE DATA */
5265
6318
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
5266
6319
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -5332,6 +6385,12 @@ class Servicenow extends AdapterBaseCl {
5332
6385
  const origin = `${this.id}-${meth}`;
5333
6386
  log.trace(origin);
5334
6387
 
6388
+ if (this.suspended && this.suspendMode === 'error') {
6389
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6390
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6391
+ return callback(null, errorObj);
6392
+ }
6393
+
5335
6394
  /* HERE IS WHERE YOU VALIDATE DATA */
5336
6395
  if (sysparmQuery === undefined || sysparmQuery === null || sysparmQuery === '') {
5337
6396
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmQuery'], null, null, null);
@@ -5407,6 +6466,12 @@ class Servicenow extends AdapterBaseCl {
5407
6466
  const origin = `${this.id}-${meth}`;
5408
6467
  log.trace(origin);
5409
6468
 
6469
+ if (this.suspended && this.suspendMode === 'error') {
6470
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6471
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6472
+ return callback(null, errorObj);
6473
+ }
6474
+
5410
6475
  /* HERE IS WHERE YOU VALIDATE DATA */
5411
6476
  if (sysparmLimit === undefined || sysparmLimit === null || sysparmLimit === '') {
5412
6477
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmLimit'], null, null, null);
@@ -5478,6 +6543,12 @@ class Servicenow extends AdapterBaseCl {
5478
6543
  const origin = `${this.id}-${meth}`;
5479
6544
  log.trace(origin);
5480
6545
 
6546
+ if (this.suspended && this.suspendMode === 'error') {
6547
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6548
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6549
+ return callback(null, errorObj);
6550
+ }
6551
+
5481
6552
  /* HERE IS WHERE YOU VALIDATE DATA */
5482
6553
  if (sysparmLimit === undefined || sysparmLimit === null || sysparmLimit === '') {
5483
6554
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmLimit'], null, null, null);
@@ -5554,6 +6625,12 @@ class Servicenow extends AdapterBaseCl {
5554
6625
  const origin = `${this.id}-${meth}`;
5555
6626
  log.trace(origin);
5556
6627
 
6628
+ if (this.suspended && this.suspendMode === 'error') {
6629
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6630
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6631
+ return callback(null, errorObj);
6632
+ }
6633
+
5557
6634
  /* HERE IS WHERE YOU VALIDATE DATA */
5558
6635
  if (sysparmLimit === undefined || sysparmLimit === null || sysparmLimit === '') {
5559
6636
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmLimit'], null, null, null);
@@ -5630,6 +6707,12 @@ class Servicenow extends AdapterBaseCl {
5630
6707
  const origin = `${this.id}-${meth}`;
5631
6708
  log.trace(origin);
5632
6709
 
6710
+ if (this.suspended && this.suspendMode === 'error') {
6711
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6712
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6713
+ return callback(null, errorObj);
6714
+ }
6715
+
5633
6716
  /* HERE IS WHERE YOU VALIDATE DATA */
5634
6717
  if (sysparmLimit === undefined || sysparmLimit === null || sysparmLimit === '') {
5635
6718
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmLimit'], null, null, null);
@@ -5707,6 +6790,12 @@ class Servicenow extends AdapterBaseCl {
5707
6790
  const origin = `${this.id}-${meth}`;
5708
6791
  log.trace(origin);
5709
6792
 
6793
+ if (this.suspended && this.suspendMode === 'error') {
6794
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6795
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6796
+ return callback(null, errorObj);
6797
+ }
6798
+
5710
6799
  /* HERE IS WHERE YOU VALIDATE DATA */
5711
6800
  if (sysparmLimit === undefined || sysparmLimit === null || sysparmLimit === '') {
5712
6801
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmLimit'], null, null, null);
@@ -5778,6 +6867,12 @@ class Servicenow extends AdapterBaseCl {
5778
6867
  const origin = `${this.id}-${meth}`;
5779
6868
  log.trace(origin);
5780
6869
 
6870
+ if (this.suspended && this.suspendMode === 'error') {
6871
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6872
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6873
+ return callback(null, errorObj);
6874
+ }
6875
+
5781
6876
  /* HERE IS WHERE YOU VALIDATE DATA */
5782
6877
  if (sysparmLimit === undefined || sysparmLimit === null || sysparmLimit === '') {
5783
6878
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['sysparmLimit'], null, null, null);
@@ -5854,6 +6949,12 @@ class Servicenow extends AdapterBaseCl {
5854
6949
  const origin = `${this.id}-${meth}`;
5855
6950
  log.trace(origin);
5856
6951
 
6952
+ if (this.suspended && this.suspendMode === 'error') {
6953
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
6954
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
6955
+ return callback(null, errorObj);
6956
+ }
6957
+
5857
6958
  /* HERE IS WHERE YOU VALIDATE DATA */
5858
6959
  if (itemId === undefined || itemId === null || itemId === '') {
5859
6960
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -5930,6 +7031,12 @@ class Servicenow extends AdapterBaseCl {
5930
7031
  const origin = `${this.id}-${meth}`;
5931
7032
  log.trace(origin);
5932
7033
 
7034
+ if (this.suspended && this.suspendMode === 'error') {
7035
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7036
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7037
+ return callback(null, errorObj);
7038
+ }
7039
+
5933
7040
  /* HERE IS WHERE YOU VALIDATE DATA */
5934
7041
  if (itemId === undefined || itemId === null || itemId === '') {
5935
7042
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -6006,6 +7113,12 @@ class Servicenow extends AdapterBaseCl {
6006
7113
  const origin = `${this.id}-${meth}`;
6007
7114
  log.trace(origin);
6008
7115
 
7116
+ if (this.suspended && this.suspendMode === 'error') {
7117
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7118
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7119
+ return callback(null, errorObj);
7120
+ }
7121
+
6009
7122
  /* HERE IS WHERE YOU VALIDATE DATA */
6010
7123
  if (itemId === undefined || itemId === null || itemId === '') {
6011
7124
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -6082,6 +7195,12 @@ class Servicenow extends AdapterBaseCl {
6082
7195
  const origin = `${this.id}-${meth}`;
6083
7196
  log.trace(origin);
6084
7197
 
7198
+ if (this.suspended && this.suspendMode === 'error') {
7199
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7200
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7201
+ return callback(null, errorObj);
7202
+ }
7203
+
6085
7204
  /* HERE IS WHERE YOU VALIDATE DATA */
6086
7205
  if (itemId === undefined || itemId === null || itemId === '') {
6087
7206
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -6158,6 +7277,12 @@ class Servicenow extends AdapterBaseCl {
6158
7277
  const origin = `${this.id}-${meth}`;
6159
7278
  log.trace(origin);
6160
7279
 
7280
+ if (this.suspended && this.suspendMode === 'error') {
7281
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7282
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7283
+ return callback(null, errorObj);
7284
+ }
7285
+
6161
7286
  /* HERE IS WHERE YOU VALIDATE DATA */
6162
7287
  if (itemId === undefined || itemId === null || itemId === '') {
6163
7288
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -6232,6 +7357,12 @@ class Servicenow extends AdapterBaseCl {
6232
7357
  const origin = `${this.id}-${meth}`;
6233
7358
  log.trace(origin);
6234
7359
 
7360
+ if (this.suspended && this.suspendMode === 'error') {
7361
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7362
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7363
+ return callback(null, errorObj);
7364
+ }
7365
+
6235
7366
  /* HERE IS WHERE YOU VALIDATE DATA */
6236
7367
 
6237
7368
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -6278,6 +7409,12 @@ class Servicenow extends AdapterBaseCl {
6278
7409
  const origin = `${this.id}-${meth}`;
6279
7410
  log.trace(origin);
6280
7411
 
7412
+ if (this.suspended && this.suspendMode === 'error') {
7413
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7414
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7415
+ return callback(null, errorObj);
7416
+ }
7417
+
6281
7418
  /* HERE IS WHERE YOU VALIDATE DATA */
6282
7419
  if (userId === undefined || userId === null || userId === '') {
6283
7420
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['userId'], null, null, null);
@@ -6349,6 +7486,12 @@ class Servicenow extends AdapterBaseCl {
6349
7486
  const origin = `${this.id}-${meth}`;
6350
7487
  log.trace(origin);
6351
7488
 
7489
+ if (this.suspended && this.suspendMode === 'error') {
7490
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7491
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7492
+ return callback(null, errorObj);
7493
+ }
7494
+
6352
7495
  /* HERE IS WHERE YOU VALIDATE DATA */
6353
7496
  if (cartItemId === undefined || cartItemId === null || cartItemId === '') {
6354
7497
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['cartItemId'], null, null, null);
@@ -6424,6 +7567,12 @@ class Servicenow extends AdapterBaseCl {
6424
7567
  const origin = `${this.id}-${meth}`;
6425
7568
  log.trace(origin);
6426
7569
 
7570
+ if (this.suspended && this.suspendMode === 'error') {
7571
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7572
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7573
+ return callback(null, errorObj);
7574
+ }
7575
+
6427
7576
  /* HERE IS WHERE YOU VALIDATE DATA */
6428
7577
  if (cartItemId === undefined || cartItemId === null || cartItemId === '') {
6429
7578
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['cartItemId'], null, null, null);
@@ -6495,6 +7644,12 @@ class Servicenow extends AdapterBaseCl {
6495
7644
  const origin = `${this.id}-${meth}`;
6496
7645
  log.trace(origin);
6497
7646
 
7647
+ if (this.suspended && this.suspendMode === 'error') {
7648
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7649
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7650
+ return callback(null, errorObj);
7651
+ }
7652
+
6498
7653
  /* HERE IS WHERE YOU VALIDATE DATA */
6499
7654
  if (itemId === undefined || itemId === null || itemId === '') {
6500
7655
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -6570,6 +7725,12 @@ class Servicenow extends AdapterBaseCl {
6570
7725
  const origin = `${this.id}-${meth}`;
6571
7726
  log.trace(origin);
6572
7727
 
7728
+ if (this.suspended && this.suspendMode === 'error') {
7729
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7730
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7731
+ return callback(null, errorObj);
7732
+ }
7733
+
6573
7734
  /* HERE IS WHERE YOU VALIDATE DATA */
6574
7735
  if (cartId === undefined || cartId === null || cartId === '') {
6575
7736
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['cartId'], null, null, null);
@@ -6639,6 +7800,12 @@ class Servicenow extends AdapterBaseCl {
6639
7800
  const origin = `${this.id}-${meth}`;
6640
7801
  log.trace(origin);
6641
7802
 
7803
+ if (this.suspended && this.suspendMode === 'error') {
7804
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7805
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7806
+ return callback(null, errorObj);
7807
+ }
7808
+
6642
7809
  /* HERE IS WHERE YOU VALIDATE DATA */
6643
7810
 
6644
7811
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -6684,6 +7851,12 @@ class Servicenow extends AdapterBaseCl {
6684
7851
  const origin = `${this.id}-${meth}`;
6685
7852
  log.trace(origin);
6686
7853
 
7854
+ if (this.suspended && this.suspendMode === 'error') {
7855
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7856
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7857
+ return callback(null, errorObj);
7858
+ }
7859
+
6687
7860
  /* HERE IS WHERE YOU VALIDATE DATA */
6688
7861
 
6689
7862
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -6730,6 +7903,12 @@ class Servicenow extends AdapterBaseCl {
6730
7903
  const origin = `${this.id}-${meth}`;
6731
7904
  log.trace(origin);
6732
7905
 
7906
+ if (this.suspended && this.suspendMode === 'error') {
7907
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7908
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7909
+ return callback(null, errorObj);
7910
+ }
7911
+
6733
7912
  /* HERE IS WHERE YOU VALIDATE DATA */
6734
7913
 
6735
7914
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -6795,6 +7974,12 @@ class Servicenow extends AdapterBaseCl {
6795
7974
  const origin = `${this.id}-${meth}`;
6796
7975
  log.trace(origin);
6797
7976
 
7977
+ if (this.suspended && this.suspendMode === 'error') {
7978
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
7979
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
7980
+ return callback(null, errorObj);
7981
+ }
7982
+
6798
7983
  /* HERE IS WHERE YOU VALIDATE DATA */
6799
7984
  if (changeId === undefined || changeId === null || changeId === '') {
6800
7985
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -6865,6 +8050,12 @@ class Servicenow extends AdapterBaseCl {
6865
8050
  const origin = `${this.id}-${meth}`;
6866
8051
  log.trace(origin);
6867
8052
 
8053
+ if (this.suspended && this.suspendMode === 'error') {
8054
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8055
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8056
+ return callback(null, errorObj);
8057
+ }
8058
+
6868
8059
  /* HERE IS WHERE YOU VALIDATE DATA */
6869
8060
  if (body === undefined || body === null || body === '') {
6870
8061
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -6936,6 +8127,12 @@ class Servicenow extends AdapterBaseCl {
6936
8127
  const origin = `${this.id}-${meth}`;
6937
8128
  log.trace(origin);
6938
8129
 
8130
+ if (this.suspended && this.suspendMode === 'error') {
8131
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8132
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8133
+ return callback(null, errorObj);
8134
+ }
8135
+
6939
8136
  /* HERE IS WHERE YOU VALIDATE DATA */
6940
8137
  if (changeId === undefined || changeId === null || changeId === '') {
6941
8138
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -7011,6 +8208,12 @@ class Servicenow extends AdapterBaseCl {
7011
8208
  const origin = `${this.id}-${meth}`;
7012
8209
  log.trace(origin);
7013
8210
 
8211
+ if (this.suspended && this.suspendMode === 'error') {
8212
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8213
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8214
+ return callback(null, errorObj);
8215
+ }
8216
+
7014
8217
  /* HERE IS WHERE YOU VALIDATE DATA */
7015
8218
  if (changeId === undefined || changeId === null || changeId === '') {
7016
8219
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
@@ -7081,6 +8284,12 @@ class Servicenow extends AdapterBaseCl {
7081
8284
  const origin = `${this.id}-${meth}`;
7082
8285
  log.trace(origin);
7083
8286
 
8287
+ if (this.suspended && this.suspendMode === 'error') {
8288
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8289
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8290
+ return callback(null, errorObj);
8291
+ }
8292
+
7084
8293
  /* HERE IS WHERE YOU VALIDATE DATA */
7085
8294
  if (incidentId === undefined || incidentId === null || incidentId === '') {
7086
8295
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['incidentId'], null, null, null);
@@ -7151,6 +8360,12 @@ class Servicenow extends AdapterBaseCl {
7151
8360
  const origin = `${this.id}-${meth}`;
7152
8361
  log.trace(origin);
7153
8362
 
8363
+ if (this.suspended && this.suspendMode === 'error') {
8364
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8365
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8366
+ return callback(null, errorObj);
8367
+ }
8368
+
7154
8369
  /* HERE IS WHERE YOU VALIDATE DATA */
7155
8370
 
7156
8371
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -7216,6 +8431,12 @@ class Servicenow extends AdapterBaseCl {
7216
8431
  const origin = `${this.id}-${meth}`;
7217
8432
  log.trace(origin);
7218
8433
 
8434
+ if (this.suspended && this.suspendMode === 'error') {
8435
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8436
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8437
+ return callback(null, errorObj);
8438
+ }
8439
+
7219
8440
  /* HERE IS WHERE YOU VALIDATE DATA */
7220
8441
  if (body === undefined || body === null || body === '') {
7221
8442
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -7287,6 +8508,12 @@ class Servicenow extends AdapterBaseCl {
7287
8508
  const origin = `${this.id}-${meth}`;
7288
8509
  log.trace(origin);
7289
8510
 
8511
+ if (this.suspended && this.suspendMode === 'error') {
8512
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8513
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8514
+ return callback(null, errorObj);
8515
+ }
8516
+
7290
8517
  /* HERE IS WHERE YOU VALIDATE DATA */
7291
8518
  if (incidentId === undefined || incidentId === null || incidentId === '') {
7292
8519
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['incidentId'], null, null, null);
@@ -7362,6 +8589,12 @@ class Servicenow extends AdapterBaseCl {
7362
8589
  const origin = `${this.id}-${meth}`;
7363
8590
  log.trace(origin);
7364
8591
 
8592
+ if (this.suspended && this.suspendMode === 'error') {
8593
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8594
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8595
+ return callback(null, errorObj);
8596
+ }
8597
+
7365
8598
  /* HERE IS WHERE YOU VALIDATE DATA */
7366
8599
  if (incidentId === undefined || incidentId === null || incidentId === '') {
7367
8600
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['incidentId'], null, null, null);
@@ -7432,6 +8665,12 @@ class Servicenow extends AdapterBaseCl {
7432
8665
  const origin = `${this.id}-${meth}`;
7433
8666
  log.trace(origin);
7434
8667
 
8668
+ if (this.suspended && this.suspendMode === 'error') {
8669
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8670
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8671
+ return callback(null, errorObj);
8672
+ }
8673
+
7435
8674
  /* HERE IS WHERE YOU VALIDATE DATA */
7436
8675
  if (groupId === undefined || groupId === null || groupId === '') {
7437
8676
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['groupId'], null, null, null);
@@ -7502,6 +8741,12 @@ class Servicenow extends AdapterBaseCl {
7502
8741
  const origin = `${this.id}-${meth}`;
7503
8742
  log.trace(origin);
7504
8743
 
8744
+ if (this.suspended && this.suspendMode === 'error') {
8745
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8746
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8747
+ return callback(null, errorObj);
8748
+ }
8749
+
7505
8750
  /* HERE IS WHERE YOU VALIDATE DATA */
7506
8751
 
7507
8752
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -7567,6 +8812,12 @@ class Servicenow extends AdapterBaseCl {
7567
8812
  const origin = `${this.id}-${meth}`;
7568
8813
  log.trace(origin);
7569
8814
 
8815
+ if (this.suspended && this.suspendMode === 'error') {
8816
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8817
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8818
+ return callback(null, errorObj);
8819
+ }
8820
+
7570
8821
  /* HERE IS WHERE YOU VALIDATE DATA */
7571
8822
  if (body === undefined || body === null || body === '') {
7572
8823
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -7638,6 +8889,12 @@ class Servicenow extends AdapterBaseCl {
7638
8889
  const origin = `${this.id}-${meth}`;
7639
8890
  log.trace(origin);
7640
8891
 
8892
+ if (this.suspended && this.suspendMode === 'error') {
8893
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8894
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8895
+ return callback(null, errorObj);
8896
+ }
8897
+
7641
8898
  /* HERE IS WHERE YOU VALIDATE DATA */
7642
8899
  if (groupId === undefined || groupId === null || groupId === '') {
7643
8900
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['groupId'], null, null, null);
@@ -7713,6 +8970,12 @@ class Servicenow extends AdapterBaseCl {
7713
8970
  const origin = `${this.id}-${meth}`;
7714
8971
  log.trace(origin);
7715
8972
 
8973
+ if (this.suspended && this.suspendMode === 'error') {
8974
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8975
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8976
+ return callback(null, errorObj);
8977
+ }
8978
+
7716
8979
  /* HERE IS WHERE YOU VALIDATE DATA */
7717
8980
  if (groupId === undefined || groupId === null || groupId === '') {
7718
8981
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['groupId'], null, null, null);
@@ -7783,6 +9046,12 @@ class Servicenow extends AdapterBaseCl {
7783
9046
  const origin = `${this.id}-${meth}`;
7784
9047
  log.trace(origin);
7785
9048
 
9049
+ if (this.suspended && this.suspendMode === 'error') {
9050
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9051
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9052
+ return callback(null, errorObj);
9053
+ }
9054
+
7786
9055
  /* HERE IS WHERE YOU VALIDATE DATA */
7787
9056
  if (itemId === undefined || itemId === null || itemId === '') {
7788
9057
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -7853,6 +9122,12 @@ class Servicenow extends AdapterBaseCl {
7853
9122
  const origin = `${this.id}-${meth}`;
7854
9123
  log.trace(origin);
7855
9124
 
9125
+ if (this.suspended && this.suspendMode === 'error') {
9126
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9127
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9128
+ return callback(null, errorObj);
9129
+ }
9130
+
7856
9131
  /* HERE IS WHERE YOU VALIDATE DATA */
7857
9132
 
7858
9133
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -7918,6 +9193,12 @@ class Servicenow extends AdapterBaseCl {
7918
9193
  const origin = `${this.id}-${meth}`;
7919
9194
  log.trace(origin);
7920
9195
 
9196
+ if (this.suspended && this.suspendMode === 'error') {
9197
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9198
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9199
+ return callback(null, errorObj);
9200
+ }
9201
+
7921
9202
  /* HERE IS WHERE YOU VALIDATE DATA */
7922
9203
  if (body === undefined || body === null || body === '') {
7923
9204
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -7989,6 +9270,12 @@ class Servicenow extends AdapterBaseCl {
7989
9270
  const origin = `${this.id}-${meth}`;
7990
9271
  log.trace(origin);
7991
9272
 
9273
+ if (this.suspended && this.suspendMode === 'error') {
9274
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9275
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9276
+ return callback(null, errorObj);
9277
+ }
9278
+
7992
9279
  /* HERE IS WHERE YOU VALIDATE DATA */
7993
9280
  if (itemId === undefined || itemId === null || itemId === '') {
7994
9281
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -8064,6 +9351,12 @@ class Servicenow extends AdapterBaseCl {
8064
9351
  const origin = `${this.id}-${meth}`;
8065
9352
  log.trace(origin);
8066
9353
 
9354
+ if (this.suspended && this.suspendMode === 'error') {
9355
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9356
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9357
+ return callback(null, errorObj);
9358
+ }
9359
+
8067
9360
  /* HERE IS WHERE YOU VALIDATE DATA */
8068
9361
  if (itemId === undefined || itemId === null || itemId === '') {
8069
9362
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -8134,6 +9427,12 @@ class Servicenow extends AdapterBaseCl {
8134
9427
  const origin = `${this.id}-${meth}`;
8135
9428
  log.trace(origin);
8136
9429
 
9430
+ if (this.suspended && this.suspendMode === 'error') {
9431
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9432
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9433
+ return callback(null, errorObj);
9434
+ }
9435
+
8137
9436
  /* HERE IS WHERE YOU VALIDATE DATA */
8138
9437
  if (articleId === undefined || articleId === null || articleId === '') {
8139
9438
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['articleId'], null, null, null);
@@ -8204,6 +9503,12 @@ class Servicenow extends AdapterBaseCl {
8204
9503
  const origin = `${this.id}-${meth}`;
8205
9504
  log.trace(origin);
8206
9505
 
9506
+ if (this.suspended && this.suspendMode === 'error') {
9507
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9508
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9509
+ return callback(null, errorObj);
9510
+ }
9511
+
8207
9512
  /* HERE IS WHERE YOU VALIDATE DATA */
8208
9513
 
8209
9514
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -8269,6 +9574,12 @@ class Servicenow extends AdapterBaseCl {
8269
9574
  const origin = `${this.id}-${meth}`;
8270
9575
  log.trace(origin);
8271
9576
 
9577
+ if (this.suspended && this.suspendMode === 'error') {
9578
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9579
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9580
+ return callback(null, errorObj);
9581
+ }
9582
+
8272
9583
  /* HERE IS WHERE YOU VALIDATE DATA */
8273
9584
  if (body === undefined || body === null || body === '') {
8274
9585
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -8340,6 +9651,12 @@ class Servicenow extends AdapterBaseCl {
8340
9651
  const origin = `${this.id}-${meth}`;
8341
9652
  log.trace(origin);
8342
9653
 
9654
+ if (this.suspended && this.suspendMode === 'error') {
9655
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9656
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9657
+ return callback(null, errorObj);
9658
+ }
9659
+
8343
9660
  /* HERE IS WHERE YOU VALIDATE DATA */
8344
9661
  if (articleId === undefined || articleId === null || articleId === '') {
8345
9662
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['articleId'], null, null, null);
@@ -8415,6 +9732,12 @@ class Servicenow extends AdapterBaseCl {
8415
9732
  const origin = `${this.id}-${meth}`;
8416
9733
  log.trace(origin);
8417
9734
 
9735
+ if (this.suspended && this.suspendMode === 'error') {
9736
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9737
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9738
+ return callback(null, errorObj);
9739
+ }
9740
+
8418
9741
  /* HERE IS WHERE YOU VALIDATE DATA */
8419
9742
  if (articleId === undefined || articleId === null || articleId === '') {
8420
9743
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['articleId'], null, null, null);
@@ -8485,6 +9808,12 @@ class Servicenow extends AdapterBaseCl {
8485
9808
  const origin = `${this.id}-${meth}`;
8486
9809
  log.trace(origin);
8487
9810
 
9811
+ if (this.suspended && this.suspendMode === 'error') {
9812
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9813
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9814
+ return callback(null, errorObj);
9815
+ }
9816
+
8488
9817
  /* HERE IS WHERE YOU VALIDATE DATA */
8489
9818
  if (problemId === undefined || problemId === null || problemId === '') {
8490
9819
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['problemId'], null, null, null);
@@ -8555,6 +9884,12 @@ class Servicenow extends AdapterBaseCl {
8555
9884
  const origin = `${this.id}-${meth}`;
8556
9885
  log.trace(origin);
8557
9886
 
9887
+ if (this.suspended && this.suspendMode === 'error') {
9888
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9889
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9890
+ return callback(null, errorObj);
9891
+ }
9892
+
8558
9893
  /* HERE IS WHERE YOU VALIDATE DATA */
8559
9894
 
8560
9895
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -8620,6 +9955,12 @@ class Servicenow extends AdapterBaseCl {
8620
9955
  const origin = `${this.id}-${meth}`;
8621
9956
  log.trace(origin);
8622
9957
 
9958
+ if (this.suspended && this.suspendMode === 'error') {
9959
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
9960
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
9961
+ return callback(null, errorObj);
9962
+ }
9963
+
8623
9964
  /* HERE IS WHERE YOU VALIDATE DATA */
8624
9965
  if (body === undefined || body === null || body === '') {
8625
9966
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -8691,6 +10032,12 @@ class Servicenow extends AdapterBaseCl {
8691
10032
  const origin = `${this.id}-${meth}`;
8692
10033
  log.trace(origin);
8693
10034
 
10035
+ if (this.suspended && this.suspendMode === 'error') {
10036
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10037
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10038
+ return callback(null, errorObj);
10039
+ }
10040
+
8694
10041
  /* HERE IS WHERE YOU VALIDATE DATA */
8695
10042
  if (problemId === undefined || problemId === null || problemId === '') {
8696
10043
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['problemId'], null, null, null);
@@ -8766,6 +10113,12 @@ class Servicenow extends AdapterBaseCl {
8766
10113
  const origin = `${this.id}-${meth}`;
8767
10114
  log.trace(origin);
8768
10115
 
10116
+ if (this.suspended && this.suspendMode === 'error') {
10117
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10118
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10119
+ return callback(null, errorObj);
10120
+ }
10121
+
8769
10122
  /* HERE IS WHERE YOU VALIDATE DATA */
8770
10123
  if (problemId === undefined || problemId === null || problemId === '') {
8771
10124
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['problemId'], null, null, null);
@@ -8836,6 +10189,12 @@ class Servicenow extends AdapterBaseCl {
8836
10189
  const origin = `${this.id}-${meth}`;
8837
10190
  log.trace(origin);
8838
10191
 
10192
+ if (this.suspended && this.suspendMode === 'error') {
10193
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10194
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10195
+ return callback(null, errorObj);
10196
+ }
10197
+
8839
10198
  /* HERE IS WHERE YOU VALIDATE DATA */
8840
10199
  if (requestId === undefined || requestId === null || requestId === '') {
8841
10200
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['requestId'], null, null, null);
@@ -8906,6 +10265,12 @@ class Servicenow extends AdapterBaseCl {
8906
10265
  const origin = `${this.id}-${meth}`;
8907
10266
  log.trace(origin);
8908
10267
 
10268
+ if (this.suspended && this.suspendMode === 'error') {
10269
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10270
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10271
+ return callback(null, errorObj);
10272
+ }
10273
+
8909
10274
  /* HERE IS WHERE YOU VALIDATE DATA */
8910
10275
 
8911
10276
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -8971,6 +10336,12 @@ class Servicenow extends AdapterBaseCl {
8971
10336
  const origin = `${this.id}-${meth}`;
8972
10337
  log.trace(origin);
8973
10338
 
10339
+ if (this.suspended && this.suspendMode === 'error') {
10340
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10341
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10342
+ return callback(null, errorObj);
10343
+ }
10344
+
8974
10345
  /* HERE IS WHERE YOU VALIDATE DATA */
8975
10346
  if (body === undefined || body === null || body === '') {
8976
10347
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -9042,6 +10413,12 @@ class Servicenow extends AdapterBaseCl {
9042
10413
  const origin = `${this.id}-${meth}`;
9043
10414
  log.trace(origin);
9044
10415
 
10416
+ if (this.suspended && this.suspendMode === 'error') {
10417
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10418
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10419
+ return callback(null, errorObj);
10420
+ }
10421
+
9045
10422
  /* HERE IS WHERE YOU VALIDATE DATA */
9046
10423
  if (requestId === undefined || requestId === null || requestId === '') {
9047
10424
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['requestId'], null, null, null);
@@ -9117,6 +10494,12 @@ class Servicenow extends AdapterBaseCl {
9117
10494
  const origin = `${this.id}-${meth}`;
9118
10495
  log.trace(origin);
9119
10496
 
10497
+ if (this.suspended && this.suspendMode === 'error') {
10498
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10499
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10500
+ return callback(null, errorObj);
10501
+ }
10502
+
9120
10503
  /* HERE IS WHERE YOU VALIDATE DATA */
9121
10504
  if (requestId === undefined || requestId === null || requestId === '') {
9122
10505
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['requestId'], null, null, null);
@@ -9187,6 +10570,12 @@ class Servicenow extends AdapterBaseCl {
9187
10570
  const origin = `${this.id}-${meth}`;
9188
10571
  log.trace(origin);
9189
10572
 
10573
+ if (this.suspended && this.suspendMode === 'error') {
10574
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10575
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10576
+ return callback(null, errorObj);
10577
+ }
10578
+
9190
10579
  /* HERE IS WHERE YOU VALIDATE DATA */
9191
10580
  if (itemId === undefined || itemId === null || itemId === '') {
9192
10581
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -9257,6 +10646,12 @@ class Servicenow extends AdapterBaseCl {
9257
10646
  const origin = `${this.id}-${meth}`;
9258
10647
  log.trace(origin);
9259
10648
 
10649
+ if (this.suspended && this.suspendMode === 'error') {
10650
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10651
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10652
+ return callback(null, errorObj);
10653
+ }
10654
+
9260
10655
  /* HERE IS WHERE YOU VALIDATE DATA */
9261
10656
 
9262
10657
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -9322,6 +10717,12 @@ class Servicenow extends AdapterBaseCl {
9322
10717
  const origin = `${this.id}-${meth}`;
9323
10718
  log.trace(origin);
9324
10719
 
10720
+ if (this.suspended && this.suspendMode === 'error') {
10721
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10722
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10723
+ return callback(null, errorObj);
10724
+ }
10725
+
9325
10726
  /* HERE IS WHERE YOU VALIDATE DATA */
9326
10727
  if (body === undefined || body === null || body === '') {
9327
10728
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -9393,6 +10794,12 @@ class Servicenow extends AdapterBaseCl {
9393
10794
  const origin = `${this.id}-${meth}`;
9394
10795
  log.trace(origin);
9395
10796
 
10797
+ if (this.suspended && this.suspendMode === 'error') {
10798
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10799
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10800
+ return callback(null, errorObj);
10801
+ }
10802
+
9396
10803
  /* HERE IS WHERE YOU VALIDATE DATA */
9397
10804
  if (itemId === undefined || itemId === null || itemId === '') {
9398
10805
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -9468,6 +10875,12 @@ class Servicenow extends AdapterBaseCl {
9468
10875
  const origin = `${this.id}-${meth}`;
9469
10876
  log.trace(origin);
9470
10877
 
10878
+ if (this.suspended && this.suspendMode === 'error') {
10879
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10880
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10881
+ return callback(null, errorObj);
10882
+ }
10883
+
9471
10884
  /* HERE IS WHERE YOU VALIDATE DATA */
9472
10885
  if (itemId === undefined || itemId === null || itemId === '') {
9473
10886
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['itemId'], null, null, null);
@@ -9538,6 +10951,12 @@ class Servicenow extends AdapterBaseCl {
9538
10951
  const origin = `${this.id}-${meth}`;
9539
10952
  log.trace(origin);
9540
10953
 
10954
+ if (this.suspended && this.suspendMode === 'error') {
10955
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
10956
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
10957
+ return callback(null, errorObj);
10958
+ }
10959
+
9541
10960
  /* HERE IS WHERE YOU VALIDATE DATA */
9542
10961
  if (userId === undefined || userId === null || userId === '') {
9543
10962
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['userId'], null, null, null);
@@ -9608,6 +11027,12 @@ class Servicenow extends AdapterBaseCl {
9608
11027
  const origin = `${this.id}-${meth}`;
9609
11028
  log.trace(origin);
9610
11029
 
11030
+ if (this.suspended && this.suspendMode === 'error') {
11031
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11032
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11033
+ return callback(null, errorObj);
11034
+ }
11035
+
9611
11036
  /* HERE IS WHERE YOU VALIDATE DATA */
9612
11037
 
9613
11038
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
@@ -9673,6 +11098,12 @@ class Servicenow extends AdapterBaseCl {
9673
11098
  const origin = `${this.id}-${meth}`;
9674
11099
  log.trace(origin);
9675
11100
 
11101
+ if (this.suspended && this.suspendMode === 'error') {
11102
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11103
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11104
+ return callback(null, errorObj);
11105
+ }
11106
+
9676
11107
  /* HERE IS WHERE YOU VALIDATE DATA */
9677
11108
  if (body === undefined || body === null || body === '') {
9678
11109
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
@@ -9744,6 +11175,12 @@ class Servicenow extends AdapterBaseCl {
9744
11175
  const origin = `${this.id}-${meth}`;
9745
11176
  log.trace(origin);
9746
11177
 
11178
+ if (this.suspended && this.suspendMode === 'error') {
11179
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11180
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11181
+ return callback(null, errorObj);
11182
+ }
11183
+
9747
11184
  /* HERE IS WHERE YOU VALIDATE DATA */
9748
11185
  if (userId === undefined || userId === null || userId === '') {
9749
11186
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['userId'], null, null, null);
@@ -9819,6 +11256,12 @@ class Servicenow extends AdapterBaseCl {
9819
11256
  const origin = `${this.id}-${meth}`;
9820
11257
  log.trace(origin);
9821
11258
 
11259
+ if (this.suspended && this.suspendMode === 'error') {
11260
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11261
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11262
+ return callback(null, errorObj);
11263
+ }
11264
+
9822
11265
  /* HERE IS WHERE YOU VALIDATE DATA */
9823
11266
  if (userId === undefined || userId === null || userId === '') {
9824
11267
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['userId'], null, null, null);
@@ -9889,6 +11332,12 @@ class Servicenow extends AdapterBaseCl {
9889
11332
  const origin = `${this.id}-${meth}`;
9890
11333
  log.trace(origin);
9891
11334
 
11335
+ if (this.suspended && this.suspendMode === 'error') {
11336
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11337
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11338
+ return callback(null, errorObj);
11339
+ }
11340
+
9892
11341
  /* HERE IS WHERE YOU VALIDATE DATA */
9893
11342
  if (incidentId === undefined || incidentId === null || incidentId === '') {
9894
11343
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['incidentId'], null, null, null);
@@ -9960,6 +11409,12 @@ class Servicenow extends AdapterBaseCl {
9960
11409
  const origin = `${this.id}-${meth}`;
9961
11410
  log.trace(origin);
9962
11411
 
11412
+ if (this.suspended && this.suspendMode === 'error') {
11413
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11414
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11415
+ return callback(null, errorObj);
11416
+ }
11417
+
9963
11418
  /* HERE IS WHERE YOU VALIDATE DATA */
9964
11419
  if (incidentId === undefined || incidentId === null || incidentId === '') {
9965
11420
  const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['incidentId'], null, null, null);
@@ -10021,6 +11476,164 @@ class Servicenow extends AdapterBaseCl {
10021
11476
  return callback(null, errorObj);
10022
11477
  }
10023
11478
  }
11479
+
11480
+ /**
11481
+ * @summary Creates a change request risk assessment.
11482
+ *
11483
+ * @function createChangeRequestRiskAssessment
11484
+ * @param {object} riskAssessment - the risk assessment to add to the change request
11485
+ * @param {getCallback} callback - a callback function to return the result
11486
+ */
11487
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
11488
+ createChangeRequestRiskAssessment(riskAssessment, callback) {
11489
+ const meth = 'adapter-createChangeRequestRiskAssessment';
11490
+ const origin = `${this.id}-${meth}`;
11491
+ log.trace(origin);
11492
+
11493
+ if (this.suspended && this.suspendMode === 'error') {
11494
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11495
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11496
+ return callback(null, errorObj);
11497
+ }
11498
+
11499
+ /* HERE IS WHERE YOU VALIDATE DATA */
11500
+ if (riskAssessment === undefined || riskAssessment === null || riskAssessment === '') {
11501
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['riskAssessment'], null, null, null);
11502
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11503
+ return callback(null, errorObj);
11504
+ }
11505
+
11506
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
11507
+ const queryParamsAvailable = {};
11508
+ const queryParams = {};
11509
+ const pathVars = [];
11510
+ const bodyVars = riskAssessment;
11511
+
11512
+ // loop in template. long callback arg name to avoid identifier conflicts
11513
+ if (queryParamsAvailable && Object.keys(queryParamsAvailable).length > 0) {
11514
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
11515
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
11516
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
11517
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
11518
+ }
11519
+ });
11520
+ }
11521
+
11522
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
11523
+ const reqObj = {
11524
+ payload: bodyVars,
11525
+ uriPathVars: pathVars,
11526
+ uriQuery: queryParams
11527
+ };
11528
+
11529
+ try {
11530
+ // Make the call -
11531
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
11532
+ return this.requestHandlerInst.identifyRequest('ChangeManagement', 'createChangeRequestRiskAssessment', reqObj, true, (irReturnData, irReturnError) => {
11533
+ // if we received an error or their is no response on the results
11534
+ // return an error
11535
+ if (irReturnError) {
11536
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
11537
+ return callback(null, irReturnError);
11538
+ }
11539
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
11540
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createChangeRequestRiskAssessment'], null, null, null);
11541
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11542
+ return callback(null, errorObj);
11543
+ }
11544
+
11545
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
11546
+ // return the response
11547
+ return callback(irReturnData, null);
11548
+ });
11549
+ } catch (ex) {
11550
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
11551
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11552
+ return callback(null, errorObj);
11553
+ }
11554
+ }
11555
+
11556
+ /**
11557
+ * @summary auto approve change request
11558
+ *
11559
+ * @function autoApproveChangeRequest
11560
+ * @param {string} changeId - Unique identifier of the change request to approve.
11561
+ * @param {object} approval - the approval to add to the change request
11562
+ * @param {getCallback} callback - a callback function to return the result
11563
+ */
11564
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
11565
+ autoApproveChangeRequest(changeId, approval, callback) {
11566
+ const meth = 'adapter-autoApproveChangeRequest';
11567
+ const origin = `${this.id}-${meth}`;
11568
+ log.trace(origin);
11569
+
11570
+ if (this.suspended && this.suspendMode === 'error') {
11571
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
11572
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11573
+ return callback(null, errorObj);
11574
+ }
11575
+
11576
+ /* HERE IS WHERE YOU VALIDATE DATA */
11577
+ if (changeId === undefined || changeId === null || changeId === '') {
11578
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['changeId'], null, null, null);
11579
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11580
+ return callback(null, errorObj);
11581
+ }
11582
+ if (approval === undefined || approval === null || approval === '') {
11583
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['approval'], null, null, null);
11584
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11585
+ return callback(null, errorObj);
11586
+ }
11587
+
11588
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
11589
+ const queryParamsAvailable = {};
11590
+ const queryParams = {};
11591
+ const pathVars = [changeId];
11592
+ const bodyVars = approval;
11593
+
11594
+ // loop in template. long callback arg name to avoid identifier conflicts
11595
+ if (queryParamsAvailable && Object.keys(queryParamsAvailable).length > 0) {
11596
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
11597
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
11598
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
11599
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
11600
+ }
11601
+ });
11602
+ }
11603
+
11604
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
11605
+ const reqObj = {
11606
+ payload: bodyVars,
11607
+ uriPathVars: pathVars,
11608
+ uriQuery: queryParams
11609
+ };
11610
+
11611
+ try {
11612
+ // Make the call -
11613
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
11614
+ return this.requestHandlerInst.identifyRequest('ChangeManagement', 'autoApproveChangeRequest', reqObj, true, (irReturnData, irReturnError) => {
11615
+ // if we received an error or their is no response on the results
11616
+ // return an error
11617
+ if (irReturnError) {
11618
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
11619
+ return callback(null, irReturnError);
11620
+ }
11621
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
11622
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['autoApproveChangeRequest'], null, null, null);
11623
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11624
+ return callback(null, errorObj);
11625
+ }
11626
+
11627
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
11628
+ // return the response
11629
+ return callback(irReturnData, null);
11630
+ });
11631
+ } catch (ex) {
11632
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
11633
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
11634
+ return callback(null, errorObj);
11635
+ }
11636
+ }
10024
11637
  }
10025
11638
 
10026
11639
  module.exports = Servicenow;