@itentialopensource/adapter-paragon_dpm 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc.js +18 -0
  3. package/.gitlab/.gitkeep +0 -0
  4. package/.gitlab/issue_templates/.gitkeep +0 -0
  5. package/.gitlab/issue_templates/Default.md +17 -0
  6. package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
  7. package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
  8. package/.jshintrc +0 -0
  9. package/AUTH.md +39 -0
  10. package/BROKER.md +199 -0
  11. package/CALLS.md +170 -0
  12. package/CHANGELOG.md +9 -0
  13. package/CODE_OF_CONDUCT.md +43 -0
  14. package/CONTRIBUTING.md +172 -0
  15. package/ENHANCE.md +69 -0
  16. package/LICENSE +201 -0
  17. package/PROPERTIES.md +641 -0
  18. package/README.md +337 -0
  19. package/SUMMARY.md +9 -0
  20. package/SYSTEMINFO.md +11 -0
  21. package/TROUBLESHOOT.md +47 -0
  22. package/adapter.js +4665 -0
  23. package/adapterBase.js +1787 -0
  24. package/entities/.generic/action.json +214 -0
  25. package/entities/.generic/schema.json +28 -0
  26. package/entities/.system/action.json +50 -0
  27. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  28. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  29. package/entities/.system/schema.json +19 -0
  30. package/entities/.system/schemaTokenReq.json +53 -0
  31. package/entities/.system/schemaTokenResp.json +53 -0
  32. package/entities/DpmService/action.json +714 -0
  33. package/entities/DpmService/schema.json +306 -0
  34. package/entities/ImageManager/action.json +204 -0
  35. package/entities/ImageManager/schema.json +28 -0
  36. package/error.json +190 -0
  37. package/package.json +88 -0
  38. package/pronghorn.json +6810 -0
  39. package/propertiesDecorators.json +14 -0
  40. package/propertiesSchema.json +1248 -0
  41. package/refs?service=git-upload-pack +0 -0
  42. package/report/creationReport.json +450 -0
  43. package/report/paragon-dpm.json +5089 -0
  44. package/sampleProperties.json +195 -0
  45. package/test/integration/adapterTestBasicGet.js +83 -0
  46. package/test/integration/adapterTestConnectivity.js +93 -0
  47. package/test/integration/adapterTestIntegration.js +2615 -0
  48. package/test/unit/adapterBaseTestUnit.js +949 -0
  49. package/test/unit/adapterTestUnit.js +2616 -0
  50. package/utils/adapterInfo.js +206 -0
  51. package/utils/addAuth.js +94 -0
  52. package/utils/artifactize.js +146 -0
  53. package/utils/basicGet.js +50 -0
  54. package/utils/checkMigrate.js +63 -0
  55. package/utils/entitiesToDB.js +178 -0
  56. package/utils/findPath.js +74 -0
  57. package/utils/methodDocumentor.js +225 -0
  58. package/utils/modify.js +154 -0
  59. package/utils/packModificationScript.js +35 -0
  60. package/utils/patches2bundledDeps.js +90 -0
  61. package/utils/pre-commit.sh +32 -0
  62. package/utils/removeHooks.js +20 -0
  63. package/utils/setup.js +33 -0
  64. package/utils/tbScript.js +246 -0
  65. package/utils/tbUtils.js +490 -0
  66. package/utils/testRunner.js +298 -0
  67. package/utils/troubleshootingAdapter.js +195 -0
  68. package/workflows/README.md +3 -0
package/adapter.js ADDED
@@ -0,0 +1,4665 @@
1
+ /* @copyright Itential, LLC 2019 (pre-modifications) */
2
+
3
+ /* eslint import/no-dynamic-require: warn */
4
+ /* eslint object-curly-newline: warn */
5
+
6
+ // Set globals
7
+ /* global log */
8
+
9
+ /* Required libraries. */
10
+ const path = require('path');
11
+
12
+ /* Fetch in the other needed components for the this Adaptor */
13
+ const AdapterBaseCl = require(path.join(__dirname, 'adapterBase.js'));
14
+
15
+ /**
16
+ * This is the adapter/interface into Paragon_dpm
17
+ */
18
+
19
+ /* GENERAL ADAPTER FUNCTIONS */
20
+ class ParagonDpm extends AdapterBaseCl {
21
+ /**
22
+ * ParagonDpm Adapter
23
+ * @constructor
24
+ */
25
+ /* Working on changing the way we do Emit methods due to size and time constrainsts
26
+ constructor(prongid, properties) {
27
+ // Instantiate the AdapterBase super class
28
+ super(prongid, properties);
29
+
30
+ const restFunctionNames = this.iapGetAdapterWorkflowFunctions();
31
+
32
+ // Dynamically bind emit functions
33
+ for (let i = 0; i < restFunctionNames.length; i += 1) {
34
+ // Bind function to have name fnNameEmit for fnName
35
+ const version = restFunctionNames[i].match(/__v[0-9]+/);
36
+ const baseFnName = restFunctionNames[i].replace(/__v[0-9]+/, '');
37
+ const fnNameEmit = version ? `${baseFnName}Emit${version}` : `${baseFnName}Emit`;
38
+ this[fnNameEmit] = function (...args) {
39
+ // extract the callback
40
+ const callback = args[args.length - 1];
41
+ // slice the callback from args so we can insert our own
42
+ const functionArgs = args.slice(0, args.length - 1);
43
+ // create a random name for the listener
44
+ const eventName = `${restFunctionNames[i]}:${Math.random().toString(36)}`;
45
+ // tell the calling class to start listening
46
+ callback({ event: eventName, status: 'received' });
47
+ // store parent for use of this context later
48
+ const parent = this;
49
+ // store emission function
50
+ const func = function (val, err) {
51
+ parent.removeListener(eventName, func);
52
+ parent.emit(eventName, val, err);
53
+ };
54
+ // Use apply to call the function in a specific context
55
+ this[restFunctionNames[i]].apply(this, functionArgs.concat([func])); // eslint-disable-line prefer-spread
56
+ };
57
+ }
58
+
59
+ // Uncomment if you have things to add to the constructor like using your own properties.
60
+ // Otherwise the constructor in the adapterBase will be used.
61
+ // Capture my own properties - they need to be defined in propertiesSchema.json
62
+ // if (this.allProps && this.allProps.myownproperty) {
63
+ // mypropvariable = this.allProps.myownproperty;
64
+ // }
65
+ }
66
+ */
67
+
68
+ /**
69
+ * @callback healthCallback
70
+ * @param {Object} reqObj - the request to send into the healthcheck
71
+ * @param {Callback} callback - The results of the call
72
+ */
73
+ healthCheck(reqObj, callback) {
74
+ // you can modify what is passed into the healthcheck by changing things in the newReq
75
+ let newReq = null;
76
+ if (reqObj) {
77
+ newReq = Object.assign(...reqObj);
78
+ }
79
+ super.healthCheck(newReq, callback);
80
+ }
81
+
82
+ /**
83
+ * @iapGetAdapterWorkflowFunctions
84
+ */
85
+ iapGetAdapterWorkflowFunctions(inIgnore) {
86
+ let myIgnore = [
87
+ 'healthCheck',
88
+ 'iapGetAdapterWorkflowFunctions',
89
+ 'iapHasAdapterEntity',
90
+ 'iapVerifyAdapterCapability',
91
+ 'iapUpdateAdapterEntityCache',
92
+ 'hasEntities'
93
+ ];
94
+ if (!inIgnore && Array.isArray(inIgnore)) {
95
+ myIgnore = inIgnore;
96
+ } else if (!inIgnore && typeof inIgnore === 'string') {
97
+ myIgnore = [inIgnore];
98
+ }
99
+
100
+ // The generic adapter functions should already be ignored (e.g. healthCheck)
101
+ // you can add specific methods that you do not want to be workflow functions to ignore like below
102
+ // myIgnore.push('myMethodNotInWorkflow');
103
+
104
+ return super.iapGetAdapterWorkflowFunctions(myIgnore);
105
+ }
106
+
107
+ /**
108
+ * iapUpdateAdapterConfiguration is used to update any of the adapter configuration files. This
109
+ * allows customers to make changes to adapter configuration without having to be on the
110
+ * file system.
111
+ *
112
+ * @function iapUpdateAdapterConfiguration
113
+ * @param {string} configFile - the name of the file being updated (required)
114
+ * @param {Object} changes - an object containing all of the changes = formatted like the configuration file (required)
115
+ * @param {string} entity - the entity to be changed, if an action, schema or mock data file (optional)
116
+ * @param {string} type - the type of entity file to change, (action, schema, mock) (optional)
117
+ * @param {string} action - the action to be changed, if an action, schema or mock data file (optional)
118
+ * @param {Callback} callback - The results of the call
119
+ */
120
+ iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback) {
121
+ const meth = 'adapter-iapUpdateAdapterConfiguration';
122
+ const origin = `${this.id}-${meth}`;
123
+ log.trace(origin);
124
+
125
+ super.iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback);
126
+ }
127
+
128
+ /**
129
+ * See if the API path provided is found in this adapter
130
+ *
131
+ * @function iapFindAdapterPath
132
+ * @param {string} apiPath - the api path to check on
133
+ * @param {Callback} callback - The results of the call
134
+ */
135
+ iapFindAdapterPath(apiPath, callback) {
136
+ const meth = 'adapter-iapFindAdapterPath';
137
+ const origin = `${this.id}-${meth}`;
138
+ log.trace(origin);
139
+
140
+ super.iapFindAdapterPath(apiPath, callback);
141
+ }
142
+
143
+ /**
144
+ * @summary Suspends adapter
145
+ *
146
+ * @function iapSuspendAdapter
147
+ * @param {Callback} callback - callback function
148
+ */
149
+ iapSuspendAdapter(mode, callback) {
150
+ const meth = 'adapter-iapSuspendAdapter';
151
+ const origin = `${this.id}-${meth}`;
152
+ log.trace(origin);
153
+
154
+ try {
155
+ return super.iapSuspendAdapter(mode, callback);
156
+ } catch (error) {
157
+ log.error(`${origin}: ${error}`);
158
+ return callback(null, error);
159
+ }
160
+ }
161
+
162
+ /**
163
+ * @summary Unsuspends adapter
164
+ *
165
+ * @function iapUnsuspendAdapter
166
+ * @param {Callback} callback - callback function
167
+ */
168
+ iapUnsuspendAdapter(callback) {
169
+ const meth = 'adapter-iapUnsuspendAdapter';
170
+ const origin = `${this.id}-${meth}`;
171
+ log.trace(origin);
172
+
173
+ try {
174
+ return super.iapUnsuspendAdapter(callback);
175
+ } catch (error) {
176
+ log.error(`${origin}: ${error}`);
177
+ return callback(null, error);
178
+ }
179
+ }
180
+
181
+ /**
182
+ * @summary Get the Adaoter Queue
183
+ *
184
+ * @function iapGetAdapterQueue
185
+ * @param {Callback} callback - callback function
186
+ */
187
+ iapGetAdapterQueue(callback) {
188
+ const meth = 'adapter-iapGetAdapterQueue';
189
+ const origin = `${this.id}-${meth}`;
190
+ log.trace(origin);
191
+
192
+ return super.iapGetAdapterQueue(callback);
193
+ }
194
+
195
+ /**
196
+ * @summary Runs troubleshoot scripts for adapter
197
+ *
198
+ * @function iapTroubleshootAdapter
199
+ * @param {Object} props - the connection, healthcheck and authentication properties
200
+ *
201
+ * @param {boolean} persistFlag - whether the adapter properties should be updated
202
+ * @param {Callback} callback - The results of the call
203
+ */
204
+ iapTroubleshootAdapter(props, persistFlag, callback) {
205
+ const meth = 'adapter-iapTroubleshootAdapter';
206
+ const origin = `${this.id}-${meth}`;
207
+ log.trace(origin);
208
+
209
+ try {
210
+ return super.iapTroubleshootAdapter(props, persistFlag, this, callback);
211
+ } catch (error) {
212
+ log.error(`${origin}: ${error}`);
213
+ return callback(null, error);
214
+ }
215
+ }
216
+
217
+ /**
218
+ * @summary runs healthcheck script for adapter
219
+ *
220
+ * @function iapRunAdapterHealthcheck
221
+ * @param {Adapter} adapter - adapter instance to troubleshoot
222
+ * @param {Callback} callback - callback function
223
+ */
224
+ iapRunAdapterHealthcheck(callback) {
225
+ const meth = 'adapter-iapRunAdapterHealthcheck';
226
+ const origin = `${this.id}-${meth}`;
227
+ log.trace(origin);
228
+
229
+ try {
230
+ return super.iapRunAdapterHealthcheck(this, callback);
231
+ } catch (error) {
232
+ log.error(`${origin}: ${error}`);
233
+ return callback(null, error);
234
+ }
235
+ }
236
+
237
+ /**
238
+ * @summary runs connectivity check script for adapter
239
+ *
240
+ * @function iapRunAdapterConnectivity
241
+ * @param {Callback} callback - callback function
242
+ */
243
+ iapRunAdapterConnectivity(callback) {
244
+ const meth = 'adapter-iapRunAdapterConnectivity';
245
+ const origin = `${this.id}-${meth}`;
246
+ log.trace(origin);
247
+
248
+ try {
249
+ return super.iapRunAdapterConnectivity(callback);
250
+ } catch (error) {
251
+ log.error(`${origin}: ${error}`);
252
+ return callback(null, error);
253
+ }
254
+ }
255
+
256
+ /**
257
+ * @summary runs basicGet script for adapter
258
+ *
259
+ * @function iapRunAdapterBasicGet
260
+ * @param {Callback} callback - callback function
261
+ */
262
+ iapRunAdapterBasicGet(callback) {
263
+ const meth = 'adapter-iapRunAdapterBasicGet';
264
+ const origin = `${this.id}-${meth}`;
265
+ log.trace(origin);
266
+
267
+ try {
268
+ return super.iapRunAdapterBasicGet(callback);
269
+ } catch (error) {
270
+ log.error(`${origin}: ${error}`);
271
+ return callback(null, error);
272
+ }
273
+ }
274
+
275
+ /**
276
+ * @summary moves entites into Mongo DB
277
+ *
278
+ * @function iapMoveAdapterEntitiesToDB
279
+ * @param {getCallback} callback - a callback function to return the result (Generics)
280
+ * or the error
281
+ */
282
+ iapMoveAdapterEntitiesToDB(callback) {
283
+ const meth = 'adapter-iapMoveAdapterEntitiesToDB';
284
+ const origin = `${this.id}-${meth}`;
285
+ log.trace(origin);
286
+
287
+ try {
288
+ return super.iapMoveAdapterEntitiesToDB(callback);
289
+ } catch (err) {
290
+ log.error(`${origin}: ${err}`);
291
+ return callback(null, err);
292
+ }
293
+ }
294
+
295
+ /* BROKER CALLS */
296
+ /**
297
+ * @summary Determines if this adapter supports the specific entity
298
+ *
299
+ * @function iapHasAdapterEntity
300
+ * @param {String} entityType - the entity type to check for
301
+ * @param {String/Array} entityId - the specific entity we are looking for
302
+ *
303
+ * @param {Callback} callback - An array of whether the adapter can has the
304
+ * desired capability or an error
305
+ */
306
+ iapHasAdapterEntity(entityType, entityId, callback) {
307
+ const origin = `${this.id}-adapter-iapHasAdapterEntity`;
308
+ log.trace(origin);
309
+
310
+ // Make the call -
311
+ // iapVerifyAdapterCapability(entityType, actionType, entityId, callback)
312
+ return this.iapVerifyAdapterCapability(entityType, null, entityId, callback);
313
+ }
314
+
315
+ /**
316
+ * @summary Provides a way for the adapter to tell north bound integrations
317
+ * whether the adapter supports type, action and specific entity
318
+ *
319
+ * @function iapVerifyAdapterCapability
320
+ * @param {String} entityType - the entity type to check for
321
+ * @param {String} actionType - the action type to check for
322
+ * @param {String/Array} entityId - the specific entity we are looking for
323
+ *
324
+ * @param {Callback} callback - An array of whether the adapter can has the
325
+ * desired capability or an error
326
+ */
327
+ iapVerifyAdapterCapability(entityType, actionType, entityId, callback) {
328
+ const meth = 'adapterBase-iapVerifyAdapterCapability';
329
+ const origin = `${this.id}-${meth}`;
330
+ log.trace(origin);
331
+
332
+ // if caching
333
+ if (this.caching) {
334
+ // Make the call - iapVerifyAdapterCapability(entityType, actionType, entityId, callback)
335
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, entityId, (results, error) => {
336
+ if (error) {
337
+ return callback(null, error);
338
+ }
339
+
340
+ // if the cache needs to be updated, update and try again
341
+ if (results && results[0] === 'needupdate') {
342
+ switch (entityType) {
343
+ case 'template_entity': {
344
+ // if the cache is invalid, update the cache
345
+ return this.getEntities(null, null, null, null, (data, err) => {
346
+ if (err) {
347
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Could not update entity: $VARIABLE$, cache', [entityType], null, null, null);
348
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
349
+ return callback(null, errorObj);
350
+ }
351
+
352
+ // need to check the cache again since it has been updated
353
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, entityId, (vcapable, verror) => {
354
+ if (verror) {
355
+ return callback(null, verror);
356
+ }
357
+
358
+ return this.capabilityResults(vcapable, callback);
359
+ });
360
+ });
361
+ }
362
+ default: {
363
+ // unsupported entity type
364
+ const result = [false];
365
+
366
+ // put false in array for all entities
367
+ if (Array.isArray(entityId)) {
368
+ for (let e = 1; e < entityId.length; e += 1) {
369
+ result.push(false);
370
+ }
371
+ }
372
+
373
+ return callback(result);
374
+ }
375
+ }
376
+ }
377
+
378
+ // return the results
379
+ return this.capabilityResults(results, callback);
380
+ });
381
+ }
382
+
383
+ // if no entity id
384
+ if (!entityId) {
385
+ // need to check the cache again since it has been updated
386
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, null, (vcapable, verror) => {
387
+ if (verror) {
388
+ return callback(null, verror);
389
+ }
390
+
391
+ return this.capabilityResults(vcapable, callback);
392
+ });
393
+ }
394
+
395
+ // if not caching
396
+ switch (entityType) {
397
+ case 'template_entity': {
398
+ // need to get the entities to check
399
+ return this.getEntities(null, null, null, null, (data, err) => {
400
+ if (err) {
401
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Could not update entity: $VARIABLE$, cache', [entityType], null, null, null);
402
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
403
+ return callback(null, errorObj);
404
+ }
405
+
406
+ // need to check the cache again since it has been updated
407
+ return this.requestHandlerInst.iapVerifyAdapterCapability(entityType, actionType, null, (vcapable, verror) => {
408
+ if (verror) {
409
+ return callback(null, verror);
410
+ }
411
+
412
+ // is the entity in the list?
413
+ const isEntity = this.entityInList(entityId, data.response, callback);
414
+ const res = [];
415
+
416
+ // not found
417
+ for (let i = 0; i < isEntity.length; i += 1) {
418
+ if (vcapable) {
419
+ res.push(isEntity[i]);
420
+ } else {
421
+ res.push(false);
422
+ }
423
+ }
424
+
425
+ return callback(res);
426
+ });
427
+ });
428
+ }
429
+ default: {
430
+ // unsupported entity type
431
+ const result = [false];
432
+
433
+ // put false in array for all entities
434
+ if (Array.isArray(entityId)) {
435
+ for (let e = 1; e < entityId.length; e += 1) {
436
+ result.push(false);
437
+ }
438
+ }
439
+
440
+ return callback(result);
441
+ }
442
+ }
443
+ }
444
+
445
+ /**
446
+ * @summary Updates the cache for all entities by call the get All entity method
447
+ *
448
+ * @function iapUpdateAdapterEntityCache
449
+ *
450
+ */
451
+ iapUpdateAdapterEntityCache() {
452
+ const origin = `${this.id}-adapter-iapUpdateAdapterEntityCache`;
453
+ log.trace(origin);
454
+
455
+ if (this.caching) {
456
+ // if the cache is invalid, update the cache
457
+ this.getEntities(null, null, null, null, (data, err) => {
458
+ if (err) {
459
+ log.trace(`${origin}: Could not load template_entity into cache - ${err}`);
460
+ }
461
+ });
462
+ }
463
+ }
464
+
465
+ /**
466
+ * @summary Determines if this adapter supports any in a list of entities
467
+ *
468
+ * @function hasEntities
469
+ * @param {String} entityType - the entity type to check for
470
+ * @param {Array} entityList - the list of entities we are looking for
471
+ *
472
+ * @param {Callback} callback - A map where the entity is the key and the
473
+ * value is true or false
474
+ */
475
+ hasEntities(entityType, entityList, callback) {
476
+ const meth = 'adapter-hasEntities';
477
+ const origin = `${this.id}-${meth}`;
478
+ log.trace(origin);
479
+
480
+ try {
481
+ return super.hasEntities(entityType, entityList, callback);
482
+ } catch (err) {
483
+ log.error(`${origin}: ${err}`);
484
+ return callback(null, err);
485
+ }
486
+ }
487
+
488
+ /**
489
+ * @summary Get Appliance that match the deviceName
490
+ *
491
+ * @function getDevice
492
+ * @param {String} deviceName - the deviceName to find (required)
493
+ *
494
+ * @param {getCallback} callback - a callback function to return the result
495
+ * (appliance) or the error
496
+ */
497
+ getDevice(deviceName, callback) {
498
+ const meth = 'adapter-getDevice';
499
+ const origin = `${this.id}-${meth}`;
500
+ log.trace(origin);
501
+
502
+ try {
503
+ return super.getDevice(deviceName, callback);
504
+ } catch (err) {
505
+ log.error(`${origin}: ${err}`);
506
+ return callback(null, err);
507
+ }
508
+ }
509
+
510
+ /**
511
+ * @summary Get Appliances that match the filter
512
+ *
513
+ * @function getDevicesFiltered
514
+ * @param {Object} options - the data to use to filter the appliances (optional)
515
+ *
516
+ * @param {getCallback} callback - a callback function to return the result
517
+ * (appliances) or the error
518
+ */
519
+ getDevicesFiltered(options, callback) {
520
+ const meth = 'adapter-getDevicesFiltered';
521
+ const origin = `${this.id}-${meth}`;
522
+ log.trace(origin);
523
+
524
+ try {
525
+ return super.getDevicesFiltered(options, callback);
526
+ } catch (err) {
527
+ log.error(`${origin}: ${err}`);
528
+ return callback(null, err);
529
+ }
530
+ }
531
+
532
+ /**
533
+ * @summary Gets the status for the provided appliance
534
+ *
535
+ * @function isAlive
536
+ * @param {String} deviceName - the deviceName of the appliance. (required)
537
+ *
538
+ * @param {configCallback} callback - callback function to return the result
539
+ * (appliance isAlive) or the error
540
+ */
541
+ isAlive(deviceName, callback) {
542
+ const meth = 'adapter-isAlive';
543
+ const origin = `${this.id}-${meth}`;
544
+ log.trace(origin);
545
+
546
+ try {
547
+ return super.isAlive(deviceName, callback);
548
+ } catch (err) {
549
+ log.error(`${origin}: ${err}`);
550
+ return callback(null, err);
551
+ }
552
+ }
553
+
554
+ /**
555
+ * @summary Gets a config for the provided Appliance
556
+ *
557
+ * @function getConfig
558
+ * @param {String} deviceName - the deviceName of the appliance. (required)
559
+ * @param {String} format - the desired format of the config. (optional)
560
+ *
561
+ * @param {configCallback} callback - callback function to return the result
562
+ * (appliance config) or the error
563
+ */
564
+ getConfig(deviceName, format, callback) {
565
+ const meth = 'adapter-getConfig';
566
+ const origin = `${this.id}-${meth}`;
567
+ log.trace(origin);
568
+
569
+ try {
570
+ return super.getConfig(deviceName, format, callback);
571
+ } catch (err) {
572
+ log.error(`${origin}: ${err}`);
573
+ return callback(null, err);
574
+ }
575
+ }
576
+
577
+ /**
578
+ * @summary Gets the device count from the system
579
+ *
580
+ * @function iapGetDeviceCount
581
+ *
582
+ * @param {getCallback} callback - callback function to return the result
583
+ * (count) or the error
584
+ */
585
+ iapGetDeviceCount(callback) {
586
+ const meth = 'adapter-iapGetDeviceCount';
587
+ const origin = `${this.id}-${meth}`;
588
+ log.trace(origin);
589
+
590
+ try {
591
+ return super.iapGetDeviceCount(callback);
592
+ } catch (err) {
593
+ log.error(`${origin}: ${err}`);
594
+ return callback(null, err);
595
+ }
596
+ }
597
+
598
+ /* GENERIC ADAPTER REQUEST - allows extension of adapter without new calls being added */
599
+ /**
600
+ * Makes the requested generic call
601
+ *
602
+ * @function genericAdapterRequest
603
+ * @param {String} uriPath - the path of the api call - do not include the host, port, base path or version (required)
604
+ * @param {String} restMethod - the rest method (GET, POST, PUT, PATCH, DELETE) (required)
605
+ * @param {Object} queryData - the parameters to be put on the url (optional).
606
+ * Can be a stringified Object.
607
+ * @param {Object} requestBody - the body to add to the request (optional).
608
+ * Can be a stringified Object.
609
+ * @param {Object} addlHeaders - additional headers to be put on the call (optional).
610
+ * Can be a stringified Object.
611
+ * @param {getCallback} callback - a callback function to return the result (Generics)
612
+ * or the error
613
+ */
614
+ genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) {
615
+ const meth = 'adapter-genericAdapterRequest';
616
+ const origin = `${this.id}-${meth}`;
617
+ log.trace(origin);
618
+
619
+ if (this.suspended && this.suspendMode === 'error') {
620
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
621
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
622
+ return callback(null, errorObj);
623
+ }
624
+
625
+ /* HERE IS WHERE YOU VALIDATE DATA */
626
+ if (uriPath === undefined || uriPath === null || uriPath === '') {
627
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['uriPath'], null, null, null);
628
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
629
+ return callback(null, errorObj);
630
+ }
631
+ if (restMethod === undefined || restMethod === null || restMethod === '') {
632
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['restMethod'], null, null, null);
633
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
634
+ return callback(null, errorObj);
635
+ }
636
+
637
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
638
+ // remove any leading / and split the uripath into path variables
639
+ let myPath = uriPath;
640
+ while (myPath.indexOf('/') === 0) {
641
+ myPath = myPath.substring(1);
642
+ }
643
+ const pathVars = myPath.split('/');
644
+ const queryParamsAvailable = queryData;
645
+ const queryParams = {};
646
+ const bodyVars = requestBody;
647
+
648
+ // loop in template. long callback arg name to avoid identifier conflicts
649
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
650
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
651
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
652
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
653
+ }
654
+ });
655
+
656
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
657
+ const reqObj = {
658
+ payload: bodyVars,
659
+ uriPathVars: pathVars,
660
+ uriQuery: queryParams,
661
+ uriOptions: {}
662
+ };
663
+ // add headers if provided
664
+ if (addlHeaders) {
665
+ reqObj.addlHeaders = addlHeaders;
666
+ }
667
+
668
+ // determine the call and return flag
669
+ let action = 'getGenerics';
670
+ let returnF = true;
671
+ if (restMethod.toUpperCase() === 'POST') {
672
+ action = 'createGeneric';
673
+ } else if (restMethod.toUpperCase() === 'PUT') {
674
+ action = 'updateGeneric';
675
+ } else if (restMethod.toUpperCase() === 'PATCH') {
676
+ action = 'patchGeneric';
677
+ } else if (restMethod.toUpperCase() === 'DELETE') {
678
+ action = 'deleteGeneric';
679
+ returnF = false;
680
+ }
681
+
682
+ try {
683
+ // Make the call -
684
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
685
+ return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
686
+ // if we received an error or their is no response on the results
687
+ // return an error
688
+ if (irReturnError) {
689
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
690
+ return callback(null, irReturnError);
691
+ }
692
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
693
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['genericAdapterRequest'], null, null, null);
694
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
695
+ return callback(null, errorObj);
696
+ }
697
+
698
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
699
+ // return the response
700
+ return callback(irReturnData, null);
701
+ });
702
+ } catch (ex) {
703
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
704
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
705
+ return callback(null, errorObj);
706
+ }
707
+ }
708
+
709
+ /**
710
+ * Makes the requested generic call with no base path or version
711
+ *
712
+ * @function genericAdapterRequestNoBasePath
713
+ * @param {String} uriPath - the path of the api call - do not include the host, port, base path or version (required)
714
+ * @param {String} restMethod - the rest method (GET, POST, PUT, PATCH, DELETE) (required)
715
+ * @param {Object} queryData - the parameters to be put on the url (optional).
716
+ * Can be a stringified Object.
717
+ * @param {Object} requestBody - the body to add to the request (optional).
718
+ * Can be a stringified Object.
719
+ * @param {Object} addlHeaders - additional headers to be put on the call (optional).
720
+ * Can be a stringified Object.
721
+ * @param {getCallback} callback - a callback function to return the result (Generics)
722
+ * or the error
723
+ */
724
+ genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) {
725
+ const meth = 'adapter-genericAdapterRequestNoBasePath';
726
+ const origin = `${this.id}-${meth}`;
727
+ log.trace(origin);
728
+
729
+ if (this.suspended && this.suspendMode === 'error') {
730
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
731
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
732
+ return callback(null, errorObj);
733
+ }
734
+
735
+ /* HERE IS WHERE YOU VALIDATE DATA */
736
+ if (uriPath === undefined || uriPath === null || uriPath === '') {
737
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['uriPath'], null, null, null);
738
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
739
+ return callback(null, errorObj);
740
+ }
741
+ if (restMethod === undefined || restMethod === null || restMethod === '') {
742
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['restMethod'], null, null, null);
743
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
744
+ return callback(null, errorObj);
745
+ }
746
+
747
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
748
+ // remove any leading / and split the uripath into path variables
749
+ let myPath = uriPath;
750
+ while (myPath.indexOf('/') === 0) {
751
+ myPath = myPath.substring(1);
752
+ }
753
+ const pathVars = myPath.split('/');
754
+ const queryParamsAvailable = queryData;
755
+ const queryParams = {};
756
+ const bodyVars = requestBody;
757
+
758
+ // loop in template. long callback arg name to avoid identifier conflicts
759
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
760
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
761
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
762
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
763
+ }
764
+ });
765
+
766
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
767
+ const reqObj = {
768
+ payload: bodyVars,
769
+ uriPathVars: pathVars,
770
+ uriQuery: queryParams,
771
+ uriOptions: {}
772
+ };
773
+ // add headers if provided
774
+ if (addlHeaders) {
775
+ reqObj.addlHeaders = addlHeaders;
776
+ }
777
+
778
+ // determine the call and return flag
779
+ let action = 'getGenericsNoBase';
780
+ let returnF = true;
781
+ if (restMethod.toUpperCase() === 'POST') {
782
+ action = 'createGenericNoBase';
783
+ } else if (restMethod.toUpperCase() === 'PUT') {
784
+ action = 'updateGenericNoBase';
785
+ } else if (restMethod.toUpperCase() === 'PATCH') {
786
+ action = 'patchGenericNoBase';
787
+ } else if (restMethod.toUpperCase() === 'DELETE') {
788
+ action = 'deleteGenericNoBase';
789
+ returnF = false;
790
+ }
791
+
792
+ try {
793
+ // Make the call -
794
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
795
+ return this.requestHandlerInst.identifyRequest('.generic', action, reqObj, returnF, (irReturnData, irReturnError) => {
796
+ // if we received an error or their is no response on the results
797
+ // return an error
798
+ if (irReturnError) {
799
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
800
+ return callback(null, irReturnError);
801
+ }
802
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
803
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['genericAdapterRequestNoBasePath'], null, null, null);
804
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
805
+ return callback(null, errorObj);
806
+ }
807
+
808
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
809
+ // return the response
810
+ return callback(irReturnData, null);
811
+ });
812
+ } catch (ex) {
813
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
814
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
815
+ return callback(null, errorObj);
816
+ }
817
+ }
818
+
819
+ /**
820
+ * @callback healthCallback
821
+ * @param {Object} result - the result of the get request (contains an id and a status)
822
+ */
823
+ /**
824
+ * @callback getCallback
825
+ * @param {Object} result - the result of the get request (entity/ies)
826
+ * @param {String} error - any error that occurred
827
+ */
828
+ /**
829
+ * @callback createCallback
830
+ * @param {Object} item - the newly created entity
831
+ * @param {String} error - any error that occurred
832
+ */
833
+ /**
834
+ * @callback updateCallback
835
+ * @param {String} status - the status of the update action
836
+ * @param {String} error - any error that occurred
837
+ */
838
+ /**
839
+ * @callback deleteCallback
840
+ * @param {String} status - the status of the delete action
841
+ * @param {String} error - any error that occurred
842
+ */
843
+
844
+ /**
845
+ * @function dpmServiceExtRefUpdate
846
+ * @pronghornType method
847
+ * @name dpmServiceExtRefUpdate
848
+ * @summary External reference update
849
+ *
850
+ * @param {object} body - body param
851
+ * @param {getCallback} callback - a callback function to return the result
852
+ * @return {object} results - An object containing the response of the action
853
+ *
854
+ * @route {POST} /dpmServiceExtRefUpdate
855
+ * @roles admin
856
+ * @task true
857
+ */
858
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
859
+ dpmServiceExtRefUpdate(body, callback) {
860
+ const meth = 'adapter-dpmServiceExtRefUpdate';
861
+ const origin = `${this.id}-${meth}`;
862
+ log.trace(origin);
863
+
864
+ if (this.suspended && this.suspendMode === 'error') {
865
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
866
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
867
+ return callback(null, errorObj);
868
+ }
869
+
870
+ /* HERE IS WHERE YOU VALIDATE DATA */
871
+ if (body === undefined || body === null || body === '') {
872
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
873
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
874
+ return callback(null, errorObj);
875
+ }
876
+
877
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
878
+ const queryParamsAvailable = {};
879
+ const queryParams = {};
880
+ const pathVars = [];
881
+ const bodyVars = body;
882
+
883
+ // loop in template. long callback arg name to avoid identifier conflicts
884
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
885
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
886
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
887
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
888
+ }
889
+ });
890
+
891
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
892
+ // see adapter code documentation for more information on the request object's fields
893
+ const reqObj = {
894
+ payload: bodyVars,
895
+ uriPathVars: pathVars,
896
+ uriQuery: queryParams
897
+ };
898
+
899
+ try {
900
+ // Make the call -
901
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
902
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceExtRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
903
+ // if we received an error or their is no response on the results
904
+ // return an error
905
+ if (irReturnError) {
906
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
907
+ return callback(null, irReturnError);
908
+ }
909
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
910
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceExtRefUpdate'], null, null, null);
911
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
912
+ return callback(null, errorObj);
913
+ }
914
+
915
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
916
+ // return the response
917
+ return callback(irReturnData, null);
918
+ });
919
+ } catch (ex) {
920
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
921
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
922
+ return callback(null, errorObj);
923
+ }
924
+ }
925
+
926
+ /**
927
+ * @function dpmServiceBulkListDeletedResource
928
+ * @pronghornType method
929
+ * @name dpmServiceBulkListDeletedResource
930
+ * @summary Bulk list deleted-resources
931
+ *
932
+ * @param {object} body - body param
933
+ * @param {getCallback} callback - a callback function to return the result
934
+ * @return {object} results - An object containing the response of the action
935
+ *
936
+ * @route {POST} /dpmServiceBulkListDeletedResource
937
+ * @roles admin
938
+ * @task true
939
+ */
940
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
941
+ dpmServiceBulkListDeletedResource(body, callback) {
942
+ const meth = 'adapter-dpmServiceBulkListDeletedResource';
943
+ const origin = `${this.id}-${meth}`;
944
+ log.trace(origin);
945
+
946
+ if (this.suspended && this.suspendMode === 'error') {
947
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
948
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
949
+ return callback(null, errorObj);
950
+ }
951
+
952
+ /* HERE IS WHERE YOU VALIDATE DATA */
953
+ if (body === undefined || body === null || body === '') {
954
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
955
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
956
+ return callback(null, errorObj);
957
+ }
958
+
959
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
960
+ const queryParamsAvailable = {};
961
+ const queryParams = {};
962
+ const pathVars = [];
963
+ const bodyVars = body;
964
+
965
+ // loop in template. long callback arg name to avoid identifier conflicts
966
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
967
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
968
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
969
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
970
+ }
971
+ });
972
+
973
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
974
+ // see adapter code documentation for more information on the request object's fields
975
+ const reqObj = {
976
+ payload: bodyVars,
977
+ uriPathVars: pathVars,
978
+ uriQuery: queryParams
979
+ };
980
+
981
+ try {
982
+ // Make the call -
983
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
984
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkListDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
985
+ // if we received an error or their is no response on the results
986
+ // return an error
987
+ if (irReturnError) {
988
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
989
+ return callback(null, irReturnError);
990
+ }
991
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
992
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkListDeletedResource'], null, null, null);
993
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
994
+ return callback(null, errorObj);
995
+ }
996
+
997
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
998
+ // return the response
999
+ return callback(irReturnData, null);
1000
+ });
1001
+ } catch (ex) {
1002
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1003
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1004
+ return callback(null, errorObj);
1005
+ }
1006
+ }
1007
+
1008
+ /**
1009
+ * @function dpmServiceCreateCaCertificateBlob
1010
+ * @pronghornType method
1011
+ * @name dpmServiceCreateCaCertificateBlob
1012
+ * @summary Create ca-certificate-blob
1013
+ *
1014
+ * @param {object} body - body param
1015
+ * @param {getCallback} callback - a callback function to return the result
1016
+ * @return {object} results - An object containing the response of the action
1017
+ *
1018
+ * @route {POST} /dpmServiceCreateCaCertificateBlob
1019
+ * @roles admin
1020
+ * @task true
1021
+ */
1022
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1023
+ dpmServiceCreateCaCertificateBlob(body, callback) {
1024
+ const meth = 'adapter-dpmServiceCreateCaCertificateBlob';
1025
+ const origin = `${this.id}-${meth}`;
1026
+ log.trace(origin);
1027
+
1028
+ if (this.suspended && this.suspendMode === 'error') {
1029
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1030
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1031
+ return callback(null, errorObj);
1032
+ }
1033
+
1034
+ /* HERE IS WHERE YOU VALIDATE DATA */
1035
+ if (body === undefined || body === null || body === '') {
1036
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1037
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1038
+ return callback(null, errorObj);
1039
+ }
1040
+
1041
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1042
+ const queryParamsAvailable = {};
1043
+ const queryParams = {};
1044
+ const pathVars = [];
1045
+ const bodyVars = body;
1046
+
1047
+ // loop in template. long callback arg name to avoid identifier conflicts
1048
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1049
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1050
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1051
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1052
+ }
1053
+ });
1054
+
1055
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1056
+ // see adapter code documentation for more information on the request object's fields
1057
+ const reqObj = {
1058
+ payload: bodyVars,
1059
+ uriPathVars: pathVars,
1060
+ uriQuery: queryParams
1061
+ };
1062
+
1063
+ try {
1064
+ // Make the call -
1065
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1066
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceCreateCaCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
1067
+ // if we received an error or their is no response on the results
1068
+ // return an error
1069
+ if (irReturnError) {
1070
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1071
+ return callback(null, irReturnError);
1072
+ }
1073
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1074
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceCreateCaCertificateBlob'], null, null, null);
1075
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1076
+ return callback(null, errorObj);
1077
+ }
1078
+
1079
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1080
+ // return the response
1081
+ return callback(irReturnData, null);
1082
+ });
1083
+ } catch (ex) {
1084
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1085
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1086
+ return callback(null, errorObj);
1087
+ }
1088
+ }
1089
+
1090
+ /**
1091
+ * @function dpmServiceListCaCertificateBlob
1092
+ * @pronghornType method
1093
+ * @name dpmServiceListCaCertificateBlob
1094
+ * @summary List ca-certificate-blobs
1095
+ *
1096
+ * @param {string} [specSize] - Number of items expected to be returned.
1097
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
1098
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
1099
+ * @param {boolean} [specCount] - specCount param
1100
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
1101
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
1102
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
1103
+ * @param {string} [specParentType] - Filter by parent type.
1104
+ * @param {array} [specParentId] - Filter by parent UUIDs.
1105
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
1106
+ * @param {array} [specObjUuids] - Filter by UUIDs.
1107
+ * @param {array} [specFields] - limit displayed fields.
1108
+ * @param {array} [specFilters] - QueryFilter in string format.
1109
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
1110
+ introducing new fields which will take string as input.
1111
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
1112
+ * @param {string} [specFrom] - Start from items expected to be returned.
1113
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
1114
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
1115
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
1116
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
1117
+ * @param {array} [specRefFields] - limit displayed reference fields.
1118
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
1119
+ * @param {getCallback} callback - a callback function to return the result
1120
+ * @return {object} results - An object containing the response of the action
1121
+ *
1122
+ * @route {POST} /dpmServiceListCaCertificateBlob
1123
+ * @roles admin
1124
+ * @task true
1125
+ */
1126
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1127
+ dpmServiceListCaCertificateBlob(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
1128
+ const meth = 'adapter-dpmServiceListCaCertificateBlob';
1129
+ const origin = `${this.id}-${meth}`;
1130
+ log.trace(origin);
1131
+
1132
+ if (this.suspended && this.suspendMode === 'error') {
1133
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1134
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1135
+ return callback(null, errorObj);
1136
+ }
1137
+
1138
+ /* HERE IS WHERE YOU VALIDATE DATA */
1139
+
1140
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1141
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
1142
+ const queryParams = {};
1143
+ const pathVars = [];
1144
+ const bodyVars = {};
1145
+
1146
+ // loop in template. long callback arg name to avoid identifier conflicts
1147
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1148
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1149
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1150
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1151
+ }
1152
+ });
1153
+
1154
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1155
+ // see adapter code documentation for more information on the request object's fields
1156
+ const reqObj = {
1157
+ payload: bodyVars,
1158
+ uriPathVars: pathVars,
1159
+ uriQuery: queryParams
1160
+ };
1161
+
1162
+ try {
1163
+ // Make the call -
1164
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1165
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceListCaCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
1166
+ // if we received an error or their is no response on the results
1167
+ // return an error
1168
+ if (irReturnError) {
1169
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1170
+ return callback(null, irReturnError);
1171
+ }
1172
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1173
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceListCaCertificateBlob'], null, null, null);
1174
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1175
+ return callback(null, errorObj);
1176
+ }
1177
+
1178
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1179
+ // return the response
1180
+ return callback(irReturnData, null);
1181
+ });
1182
+ } catch (ex) {
1183
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1184
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1185
+ return callback(null, errorObj);
1186
+ }
1187
+ }
1188
+
1189
+ /**
1190
+ * @function dpmServiceCreateLastPublishedNotification
1191
+ * @pronghornType method
1192
+ * @name dpmServiceCreateLastPublishedNotification
1193
+ * @summary Create last-published-notification
1194
+ *
1195
+ * @param {object} body - body param
1196
+ * @param {getCallback} callback - a callback function to return the result
1197
+ * @return {object} results - An object containing the response of the action
1198
+ *
1199
+ * @route {POST} /dpmServiceCreateLastPublishedNotification
1200
+ * @roles admin
1201
+ * @task true
1202
+ */
1203
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1204
+ dpmServiceCreateLastPublishedNotification(body, callback) {
1205
+ const meth = 'adapter-dpmServiceCreateLastPublishedNotification';
1206
+ const origin = `${this.id}-${meth}`;
1207
+ log.trace(origin);
1208
+
1209
+ if (this.suspended && this.suspendMode === 'error') {
1210
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1211
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1212
+ return callback(null, errorObj);
1213
+ }
1214
+
1215
+ /* HERE IS WHERE YOU VALIDATE DATA */
1216
+ if (body === undefined || body === null || body === '') {
1217
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1218
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1219
+ return callback(null, errorObj);
1220
+ }
1221
+
1222
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1223
+ const queryParamsAvailable = {};
1224
+ const queryParams = {};
1225
+ const pathVars = [];
1226
+ const bodyVars = body;
1227
+
1228
+ // loop in template. long callback arg name to avoid identifier conflicts
1229
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1230
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1231
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1232
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1233
+ }
1234
+ });
1235
+
1236
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1237
+ // see adapter code documentation for more information on the request object's fields
1238
+ const reqObj = {
1239
+ payload: bodyVars,
1240
+ uriPathVars: pathVars,
1241
+ uriQuery: queryParams
1242
+ };
1243
+
1244
+ try {
1245
+ // Make the call -
1246
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1247
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceCreateLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
1248
+ // if we received an error or their is no response on the results
1249
+ // return an error
1250
+ if (irReturnError) {
1251
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1252
+ return callback(null, irReturnError);
1253
+ }
1254
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1255
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceCreateLastPublishedNotification'], null, null, null);
1256
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1257
+ return callback(null, errorObj);
1258
+ }
1259
+
1260
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1261
+ // return the response
1262
+ return callback(irReturnData, null);
1263
+ });
1264
+ } catch (ex) {
1265
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1266
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1267
+ return callback(null, errorObj);
1268
+ }
1269
+ }
1270
+
1271
+ /**
1272
+ * @function dpmServiceListLastPublishedNotification
1273
+ * @pronghornType method
1274
+ * @name dpmServiceListLastPublishedNotification
1275
+ * @summary List last-published-notifications
1276
+ *
1277
+ * @param {string} [specSize] - Number of items expected to be returned.
1278
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
1279
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
1280
+ * @param {boolean} [specCount] - specCount param
1281
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
1282
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
1283
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
1284
+ * @param {string} [specParentType] - Filter by parent type.
1285
+ * @param {array} [specParentId] - Filter by parent UUIDs.
1286
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
1287
+ * @param {array} [specObjUuids] - Filter by UUIDs.
1288
+ * @param {array} [specFields] - limit displayed fields.
1289
+ * @param {array} [specFilters] - QueryFilter in string format.
1290
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
1291
+ introducing new fields which will take string as input.
1292
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
1293
+ * @param {string} [specFrom] - Start from items expected to be returned.
1294
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
1295
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
1296
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
1297
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
1298
+ * @param {array} [specRefFields] - limit displayed reference fields.
1299
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
1300
+ * @param {getCallback} callback - a callback function to return the result
1301
+ * @return {object} results - An object containing the response of the action
1302
+ *
1303
+ * @route {POST} /dpmServiceListLastPublishedNotification
1304
+ * @roles admin
1305
+ * @task true
1306
+ */
1307
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1308
+ dpmServiceListLastPublishedNotification(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
1309
+ const meth = 'adapter-dpmServiceListLastPublishedNotification';
1310
+ const origin = `${this.id}-${meth}`;
1311
+ log.trace(origin);
1312
+
1313
+ if (this.suspended && this.suspendMode === 'error') {
1314
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1315
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1316
+ return callback(null, errorObj);
1317
+ }
1318
+
1319
+ /* HERE IS WHERE YOU VALIDATE DATA */
1320
+
1321
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1322
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
1323
+ const queryParams = {};
1324
+ const pathVars = [];
1325
+ const bodyVars = {};
1326
+
1327
+ // loop in template. long callback arg name to avoid identifier conflicts
1328
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1329
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1330
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1331
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1332
+ }
1333
+ });
1334
+
1335
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1336
+ // see adapter code documentation for more information on the request object's fields
1337
+ const reqObj = {
1338
+ payload: bodyVars,
1339
+ uriPathVars: pathVars,
1340
+ uriQuery: queryParams
1341
+ };
1342
+
1343
+ try {
1344
+ // Make the call -
1345
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1346
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceListLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
1347
+ // if we received an error or their is no response on the results
1348
+ // return an error
1349
+ if (irReturnError) {
1350
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1351
+ return callback(null, irReturnError);
1352
+ }
1353
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1354
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceListLastPublishedNotification'], null, null, null);
1355
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1356
+ return callback(null, errorObj);
1357
+ }
1358
+
1359
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1360
+ // return the response
1361
+ return callback(irReturnData, null);
1362
+ });
1363
+ } catch (ex) {
1364
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1365
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1366
+ return callback(null, errorObj);
1367
+ }
1368
+ }
1369
+
1370
+ /**
1371
+ * @function dpmServiceUpdateCertificateBlob
1372
+ * @pronghornType method
1373
+ * @name dpmServiceUpdateCertificateBlob
1374
+ * @summary Update certificate-blob by ID
1375
+ *
1376
+ * @param {string} iD - iD param
1377
+ * @param {object} body - body param
1378
+ * @param {getCallback} callback - a callback function to return the result
1379
+ * @return {object} results - An object containing the response of the action
1380
+ *
1381
+ * @route {POST} /dpmServiceUpdateCertificateBlob
1382
+ * @roles admin
1383
+ * @task true
1384
+ */
1385
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1386
+ dpmServiceUpdateCertificateBlob(iD, body, callback) {
1387
+ const meth = 'adapter-dpmServiceUpdateCertificateBlob';
1388
+ const origin = `${this.id}-${meth}`;
1389
+ log.trace(origin);
1390
+
1391
+ if (this.suspended && this.suspendMode === 'error') {
1392
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1393
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1394
+ return callback(null, errorObj);
1395
+ }
1396
+
1397
+ /* HERE IS WHERE YOU VALIDATE DATA */
1398
+ if (iD === undefined || iD === null || iD === '') {
1399
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1400
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1401
+ return callback(null, errorObj);
1402
+ }
1403
+ if (body === undefined || body === null || body === '') {
1404
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1405
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1406
+ return callback(null, errorObj);
1407
+ }
1408
+
1409
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1410
+ const queryParamsAvailable = {};
1411
+ const queryParams = {};
1412
+ const pathVars = [iD];
1413
+ const bodyVars = body;
1414
+
1415
+ // loop in template. long callback arg name to avoid identifier conflicts
1416
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1417
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1418
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1419
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1420
+ }
1421
+ });
1422
+
1423
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1424
+ // see adapter code documentation for more information on the request object's fields
1425
+ const reqObj = {
1426
+ payload: bodyVars,
1427
+ uriPathVars: pathVars,
1428
+ uriQuery: queryParams
1429
+ };
1430
+
1431
+ try {
1432
+ // Make the call -
1433
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1434
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceUpdateCertificateBlob', reqObj, false, (irReturnData, irReturnError) => {
1435
+ // if we received an error or their is no response on the results
1436
+ // return an error
1437
+ if (irReturnError) {
1438
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1439
+ return callback(null, irReturnError);
1440
+ }
1441
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1442
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceUpdateCertificateBlob'], null, null, null);
1443
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1444
+ return callback(null, errorObj);
1445
+ }
1446
+
1447
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1448
+ // return the response
1449
+ return callback(irReturnData, null);
1450
+ });
1451
+ } catch (ex) {
1452
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1453
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1454
+ return callback(null, errorObj);
1455
+ }
1456
+ }
1457
+
1458
+ /**
1459
+ * @function dpmServiceDeleteCertificateBlob
1460
+ * @pronghornType method
1461
+ * @name dpmServiceDeleteCertificateBlob
1462
+ * @summary Delete certificate-blob by ID
1463
+ *
1464
+ * @param {string} iD - iD param
1465
+ * @param {getCallback} callback - a callback function to return the result
1466
+ * @return {object} results - An object containing the response of the action
1467
+ *
1468
+ * @route {POST} /dpmServiceDeleteCertificateBlob
1469
+ * @roles admin
1470
+ * @task true
1471
+ */
1472
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1473
+ dpmServiceDeleteCertificateBlob(iD, callback) {
1474
+ const meth = 'adapter-dpmServiceDeleteCertificateBlob';
1475
+ const origin = `${this.id}-${meth}`;
1476
+ log.trace(origin);
1477
+
1478
+ if (this.suspended && this.suspendMode === 'error') {
1479
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1480
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1481
+ return callback(null, errorObj);
1482
+ }
1483
+
1484
+ /* HERE IS WHERE YOU VALIDATE DATA */
1485
+ if (iD === undefined || iD === null || iD === '') {
1486
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1487
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1488
+ return callback(null, errorObj);
1489
+ }
1490
+
1491
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1492
+ const queryParamsAvailable = {};
1493
+ const queryParams = {};
1494
+ const pathVars = [iD];
1495
+ const bodyVars = {};
1496
+
1497
+ // loop in template. long callback arg name to avoid identifier conflicts
1498
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1499
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1500
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1501
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1502
+ }
1503
+ });
1504
+
1505
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1506
+ // see adapter code documentation for more information on the request object's fields
1507
+ const reqObj = {
1508
+ payload: bodyVars,
1509
+ uriPathVars: pathVars,
1510
+ uriQuery: queryParams
1511
+ };
1512
+
1513
+ try {
1514
+ // Make the call -
1515
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1516
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceDeleteCertificateBlob', reqObj, false, (irReturnData, irReturnError) => {
1517
+ // if we received an error or their is no response on the results
1518
+ // return an error
1519
+ if (irReturnError) {
1520
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1521
+ return callback(null, irReturnError);
1522
+ }
1523
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1524
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceDeleteCertificateBlob'], null, null, null);
1525
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1526
+ return callback(null, errorObj);
1527
+ }
1528
+
1529
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1530
+ // return the response
1531
+ return callback(irReturnData, null);
1532
+ });
1533
+ } catch (ex) {
1534
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1535
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1536
+ return callback(null, errorObj);
1537
+ }
1538
+ }
1539
+
1540
+ /**
1541
+ * @function dpmServiceGetCertificateBlob
1542
+ * @pronghornType method
1543
+ * @name dpmServiceGetCertificateBlob
1544
+ * @summary Get certificate-blob by ID
1545
+ *
1546
+ * @param {string} iD - iD param
1547
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
1548
+ * @param {array} [fields] - limit displayed fields.
1549
+ * @param {array} [refFields] - limit displayed reference fields.
1550
+ * @param {getCallback} callback - a callback function to return the result
1551
+ * @return {object} results - An object containing the response of the action
1552
+ *
1553
+ * @route {POST} /dpmServiceGetCertificateBlob
1554
+ * @roles admin
1555
+ * @task true
1556
+ */
1557
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1558
+ dpmServiceGetCertificateBlob(iD, detail, fields, refFields, callback) {
1559
+ const meth = 'adapter-dpmServiceGetCertificateBlob';
1560
+ const origin = `${this.id}-${meth}`;
1561
+ log.trace(origin);
1562
+
1563
+ if (this.suspended && this.suspendMode === 'error') {
1564
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1565
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1566
+ return callback(null, errorObj);
1567
+ }
1568
+
1569
+ /* HERE IS WHERE YOU VALIDATE DATA */
1570
+ if (iD === undefined || iD === null || iD === '') {
1571
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1572
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1573
+ return callback(null, errorObj);
1574
+ }
1575
+
1576
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1577
+ const queryParamsAvailable = { detail, fields, refFields };
1578
+ const queryParams = {};
1579
+ const pathVars = [iD];
1580
+ const bodyVars = {};
1581
+
1582
+ // loop in template. long callback arg name to avoid identifier conflicts
1583
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1584
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1585
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1586
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1587
+ }
1588
+ });
1589
+
1590
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1591
+ // see adapter code documentation for more information on the request object's fields
1592
+ const reqObj = {
1593
+ payload: bodyVars,
1594
+ uriPathVars: pathVars,
1595
+ uriQuery: queryParams
1596
+ };
1597
+
1598
+ try {
1599
+ // Make the call -
1600
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1601
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceGetCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
1602
+ // if we received an error or their is no response on the results
1603
+ // return an error
1604
+ if (irReturnError) {
1605
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1606
+ return callback(null, irReturnError);
1607
+ }
1608
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1609
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceGetCertificateBlob'], null, null, null);
1610
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1611
+ return callback(null, errorObj);
1612
+ }
1613
+
1614
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1615
+ // return the response
1616
+ return callback(irReturnData, null);
1617
+ });
1618
+ } catch (ex) {
1619
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1620
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1621
+ return callback(null, errorObj);
1622
+ }
1623
+ }
1624
+
1625
+ /**
1626
+ * @function dpmServiceBulkExtRefUpdate
1627
+ * @pronghornType method
1628
+ * @name dpmServiceBulkExtRefUpdate
1629
+ * @summary Bulk external reference updates
1630
+ *
1631
+ * @param {object} body - body param
1632
+ * @param {getCallback} callback - a callback function to return the result
1633
+ * @return {object} results - An object containing the response of the action
1634
+ *
1635
+ * @route {POST} /dpmServiceBulkExtRefUpdate
1636
+ * @roles admin
1637
+ * @task true
1638
+ */
1639
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1640
+ dpmServiceBulkExtRefUpdate(body, callback) {
1641
+ const meth = 'adapter-dpmServiceBulkExtRefUpdate';
1642
+ const origin = `${this.id}-${meth}`;
1643
+ log.trace(origin);
1644
+
1645
+ if (this.suspended && this.suspendMode === 'error') {
1646
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1647
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1648
+ return callback(null, errorObj);
1649
+ }
1650
+
1651
+ /* HERE IS WHERE YOU VALIDATE DATA */
1652
+ if (body === undefined || body === null || body === '') {
1653
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1654
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1655
+ return callback(null, errorObj);
1656
+ }
1657
+
1658
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1659
+ const queryParamsAvailable = {};
1660
+ const queryParams = {};
1661
+ const pathVars = [];
1662
+ const bodyVars = body;
1663
+
1664
+ // loop in template. long callback arg name to avoid identifier conflicts
1665
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1666
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1667
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1668
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1669
+ }
1670
+ });
1671
+
1672
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1673
+ // see adapter code documentation for more information on the request object's fields
1674
+ const reqObj = {
1675
+ payload: bodyVars,
1676
+ uriPathVars: pathVars,
1677
+ uriQuery: queryParams
1678
+ };
1679
+
1680
+ try {
1681
+ // Make the call -
1682
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1683
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkExtRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
1684
+ // if we received an error or their is no response on the results
1685
+ // return an error
1686
+ if (irReturnError) {
1687
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1688
+ return callback(null, irReturnError);
1689
+ }
1690
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1691
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkExtRefUpdate'], null, null, null);
1692
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1693
+ return callback(null, errorObj);
1694
+ }
1695
+
1696
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1697
+ // return the response
1698
+ return callback(irReturnData, null);
1699
+ });
1700
+ } catch (ex) {
1701
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1702
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1703
+ return callback(null, errorObj);
1704
+ }
1705
+ }
1706
+
1707
+ /**
1708
+ * @function dpmServiceCreateDeletedResource
1709
+ * @pronghornType method
1710
+ * @name dpmServiceCreateDeletedResource
1711
+ * @summary Create deleted-resource
1712
+ *
1713
+ * @param {object} body - body param
1714
+ * @param {getCallback} callback - a callback function to return the result
1715
+ * @return {object} results - An object containing the response of the action
1716
+ *
1717
+ * @route {POST} /dpmServiceCreateDeletedResource
1718
+ * @roles admin
1719
+ * @task true
1720
+ */
1721
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1722
+ dpmServiceCreateDeletedResource(body, callback) {
1723
+ const meth = 'adapter-dpmServiceCreateDeletedResource';
1724
+ const origin = `${this.id}-${meth}`;
1725
+ log.trace(origin);
1726
+
1727
+ if (this.suspended && this.suspendMode === 'error') {
1728
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1729
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1730
+ return callback(null, errorObj);
1731
+ }
1732
+
1733
+ /* HERE IS WHERE YOU VALIDATE DATA */
1734
+ if (body === undefined || body === null || body === '') {
1735
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1736
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1737
+ return callback(null, errorObj);
1738
+ }
1739
+
1740
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1741
+ const queryParamsAvailable = {};
1742
+ const queryParams = {};
1743
+ const pathVars = [];
1744
+ const bodyVars = body;
1745
+
1746
+ // loop in template. long callback arg name to avoid identifier conflicts
1747
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1748
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1749
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1750
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1751
+ }
1752
+ });
1753
+
1754
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1755
+ // see adapter code documentation for more information on the request object's fields
1756
+ const reqObj = {
1757
+ payload: bodyVars,
1758
+ uriPathVars: pathVars,
1759
+ uriQuery: queryParams
1760
+ };
1761
+
1762
+ try {
1763
+ // Make the call -
1764
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1765
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceCreateDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
1766
+ // if we received an error or their is no response on the results
1767
+ // return an error
1768
+ if (irReturnError) {
1769
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1770
+ return callback(null, irReturnError);
1771
+ }
1772
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1773
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceCreateDeletedResource'], null, null, null);
1774
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1775
+ return callback(null, errorObj);
1776
+ }
1777
+
1778
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1779
+ // return the response
1780
+ return callback(irReturnData, null);
1781
+ });
1782
+ } catch (ex) {
1783
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1784
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1785
+ return callback(null, errorObj);
1786
+ }
1787
+ }
1788
+
1789
+ /**
1790
+ * @function dpmServiceListDeletedResource
1791
+ * @pronghornType method
1792
+ * @name dpmServiceListDeletedResource
1793
+ * @summary List deleted-resources
1794
+ *
1795
+ * @param {string} [specSize] - Number of items expected to be returned.
1796
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
1797
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
1798
+ * @param {boolean} [specCount] - specCount param
1799
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
1800
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
1801
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
1802
+ * @param {string} [specParentType] - Filter by parent type.
1803
+ * @param {array} [specParentId] - Filter by parent UUIDs.
1804
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
1805
+ * @param {array} [specObjUuids] - Filter by UUIDs.
1806
+ * @param {array} [specFields] - limit displayed fields.
1807
+ * @param {array} [specFilters] - QueryFilter in string format.
1808
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
1809
+ introducing new fields which will take string as input.
1810
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
1811
+ * @param {string} [specFrom] - Start from items expected to be returned.
1812
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
1813
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
1814
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
1815
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
1816
+ * @param {array} [specRefFields] - limit displayed reference fields.
1817
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
1818
+ * @param {getCallback} callback - a callback function to return the result
1819
+ * @return {object} results - An object containing the response of the action
1820
+ *
1821
+ * @route {POST} /dpmServiceListDeletedResource
1822
+ * @roles admin
1823
+ * @task true
1824
+ */
1825
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1826
+ dpmServiceListDeletedResource(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
1827
+ const meth = 'adapter-dpmServiceListDeletedResource';
1828
+ const origin = `${this.id}-${meth}`;
1829
+ log.trace(origin);
1830
+
1831
+ if (this.suspended && this.suspendMode === 'error') {
1832
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1833
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1834
+ return callback(null, errorObj);
1835
+ }
1836
+
1837
+ /* HERE IS WHERE YOU VALIDATE DATA */
1838
+
1839
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1840
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
1841
+ const queryParams = {};
1842
+ const pathVars = [];
1843
+ const bodyVars = {};
1844
+
1845
+ // loop in template. long callback arg name to avoid identifier conflicts
1846
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1847
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1848
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1849
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1850
+ }
1851
+ });
1852
+
1853
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1854
+ // see adapter code documentation for more information on the request object's fields
1855
+ const reqObj = {
1856
+ payload: bodyVars,
1857
+ uriPathVars: pathVars,
1858
+ uriQuery: queryParams
1859
+ };
1860
+
1861
+ try {
1862
+ // Make the call -
1863
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1864
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceListDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
1865
+ // if we received an error or their is no response on the results
1866
+ // return an error
1867
+ if (irReturnError) {
1868
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1869
+ return callback(null, irReturnError);
1870
+ }
1871
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1872
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceListDeletedResource'], null, null, null);
1873
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1874
+ return callback(null, errorObj);
1875
+ }
1876
+
1877
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1878
+ // return the response
1879
+ return callback(irReturnData, null);
1880
+ });
1881
+ } catch (ex) {
1882
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1883
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1884
+ return callback(null, errorObj);
1885
+ }
1886
+ }
1887
+
1888
+ /**
1889
+ * @function dpmServiceCreateCertificateBlob
1890
+ * @pronghornType method
1891
+ * @name dpmServiceCreateCertificateBlob
1892
+ * @summary Create certificate-blob
1893
+ *
1894
+ * @param {object} body - body param
1895
+ * @param {getCallback} callback - a callback function to return the result
1896
+ * @return {object} results - An object containing the response of the action
1897
+ *
1898
+ * @route {POST} /dpmServiceCreateCertificateBlob
1899
+ * @roles admin
1900
+ * @task true
1901
+ */
1902
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1903
+ dpmServiceCreateCertificateBlob(body, callback) {
1904
+ const meth = 'adapter-dpmServiceCreateCertificateBlob';
1905
+ const origin = `${this.id}-${meth}`;
1906
+ log.trace(origin);
1907
+
1908
+ if (this.suspended && this.suspendMode === 'error') {
1909
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1910
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1911
+ return callback(null, errorObj);
1912
+ }
1913
+
1914
+ /* HERE IS WHERE YOU VALIDATE DATA */
1915
+ if (body === undefined || body === null || body === '') {
1916
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1917
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1918
+ return callback(null, errorObj);
1919
+ }
1920
+
1921
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1922
+ const queryParamsAvailable = {};
1923
+ const queryParams = {};
1924
+ const pathVars = [];
1925
+ const bodyVars = body;
1926
+
1927
+ // loop in template. long callback arg name to avoid identifier conflicts
1928
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1929
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1930
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1931
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1932
+ }
1933
+ });
1934
+
1935
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1936
+ // see adapter code documentation for more information on the request object's fields
1937
+ const reqObj = {
1938
+ payload: bodyVars,
1939
+ uriPathVars: pathVars,
1940
+ uriQuery: queryParams
1941
+ };
1942
+
1943
+ try {
1944
+ // Make the call -
1945
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1946
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceCreateCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
1947
+ // if we received an error or their is no response on the results
1948
+ // return an error
1949
+ if (irReturnError) {
1950
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1951
+ return callback(null, irReturnError);
1952
+ }
1953
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1954
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceCreateCertificateBlob'], null, null, null);
1955
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1956
+ return callback(null, errorObj);
1957
+ }
1958
+
1959
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1960
+ // return the response
1961
+ return callback(irReturnData, null);
1962
+ });
1963
+ } catch (ex) {
1964
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1965
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1966
+ return callback(null, errorObj);
1967
+ }
1968
+ }
1969
+
1970
+ /**
1971
+ * @function dpmServiceListCertificateBlob
1972
+ * @pronghornType method
1973
+ * @name dpmServiceListCertificateBlob
1974
+ * @summary List certificate-blobs
1975
+ *
1976
+ * @param {string} [specSize] - Number of items expected to be returned.
1977
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
1978
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
1979
+ * @param {boolean} [specCount] - specCount param
1980
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
1981
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
1982
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
1983
+ * @param {string} [specParentType] - Filter by parent type.
1984
+ * @param {array} [specParentId] - Filter by parent UUIDs.
1985
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
1986
+ * @param {array} [specObjUuids] - Filter by UUIDs.
1987
+ * @param {array} [specFields] - limit displayed fields.
1988
+ * @param {array} [specFilters] - QueryFilter in string format.
1989
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
1990
+ introducing new fields which will take string as input.
1991
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
1992
+ * @param {string} [specFrom] - Start from items expected to be returned.
1993
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
1994
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
1995
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
1996
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
1997
+ * @param {array} [specRefFields] - limit displayed reference fields.
1998
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
1999
+ * @param {getCallback} callback - a callback function to return the result
2000
+ * @return {object} results - An object containing the response of the action
2001
+ *
2002
+ * @route {POST} /dpmServiceListCertificateBlob
2003
+ * @roles admin
2004
+ * @task true
2005
+ */
2006
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2007
+ dpmServiceListCertificateBlob(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
2008
+ const meth = 'adapter-dpmServiceListCertificateBlob';
2009
+ const origin = `${this.id}-${meth}`;
2010
+ log.trace(origin);
2011
+
2012
+ if (this.suspended && this.suspendMode === 'error') {
2013
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2014
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2015
+ return callback(null, errorObj);
2016
+ }
2017
+
2018
+ /* HERE IS WHERE YOU VALIDATE DATA */
2019
+
2020
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2021
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
2022
+ const queryParams = {};
2023
+ const pathVars = [];
2024
+ const bodyVars = {};
2025
+
2026
+ // loop in template. long callback arg name to avoid identifier conflicts
2027
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2028
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2029
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2030
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2031
+ }
2032
+ });
2033
+
2034
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2035
+ // see adapter code documentation for more information on the request object's fields
2036
+ const reqObj = {
2037
+ payload: bodyVars,
2038
+ uriPathVars: pathVars,
2039
+ uriQuery: queryParams
2040
+ };
2041
+
2042
+ try {
2043
+ // Make the call -
2044
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2045
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceListCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
2046
+ // if we received an error or their is no response on the results
2047
+ // return an error
2048
+ if (irReturnError) {
2049
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2050
+ return callback(null, irReturnError);
2051
+ }
2052
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2053
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceListCertificateBlob'], null, null, null);
2054
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2055
+ return callback(null, errorObj);
2056
+ }
2057
+
2058
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2059
+ // return the response
2060
+ return callback(irReturnData, null);
2061
+ });
2062
+ } catch (ex) {
2063
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2064
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2065
+ return callback(null, errorObj);
2066
+ }
2067
+ }
2068
+
2069
+ /**
2070
+ * @function dpmServiceSync
2071
+ * @pronghornType method
2072
+ * @name dpmServiceSync
2073
+ * @summary Sync
2074
+ *
2075
+ * @param {object} body - body param
2076
+ * @param {getCallback} callback - a callback function to return the result
2077
+ * @return {object} results - An object containing the response of the action
2078
+ *
2079
+ * @route {POST} /dpmServiceSync
2080
+ * @roles admin
2081
+ * @task true
2082
+ */
2083
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2084
+ dpmServiceSync(body, callback) {
2085
+ const meth = 'adapter-dpmServiceSync';
2086
+ const origin = `${this.id}-${meth}`;
2087
+ log.trace(origin);
2088
+
2089
+ if (this.suspended && this.suspendMode === 'error') {
2090
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2091
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2092
+ return callback(null, errorObj);
2093
+ }
2094
+
2095
+ /* HERE IS WHERE YOU VALIDATE DATA */
2096
+ if (body === undefined || body === null || body === '') {
2097
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2098
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2099
+ return callback(null, errorObj);
2100
+ }
2101
+
2102
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2103
+ const queryParamsAvailable = {};
2104
+ const queryParams = {};
2105
+ const pathVars = [];
2106
+ const bodyVars = body;
2107
+
2108
+ // loop in template. long callback arg name to avoid identifier conflicts
2109
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2110
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2111
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2112
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2113
+ }
2114
+ });
2115
+
2116
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2117
+ // see adapter code documentation for more information on the request object's fields
2118
+ const reqObj = {
2119
+ payload: bodyVars,
2120
+ uriPathVars: pathVars,
2121
+ uriQuery: queryParams
2122
+ };
2123
+
2124
+ try {
2125
+ // Make the call -
2126
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2127
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceSync', reqObj, true, (irReturnData, irReturnError) => {
2128
+ // if we received an error or their is no response on the results
2129
+ // return an error
2130
+ if (irReturnError) {
2131
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2132
+ return callback(null, irReturnError);
2133
+ }
2134
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2135
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceSync'], null, null, null);
2136
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2137
+ return callback(null, errorObj);
2138
+ }
2139
+
2140
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2141
+ // return the response
2142
+ return callback(irReturnData, null);
2143
+ });
2144
+ } catch (ex) {
2145
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2146
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2147
+ return callback(null, errorObj);
2148
+ }
2149
+ }
2150
+
2151
+ /**
2152
+ * @function dpmServiceBulkListCertificateBlob
2153
+ * @pronghornType method
2154
+ * @name dpmServiceBulkListCertificateBlob
2155
+ * @summary Bulk list certificate-blobs
2156
+ *
2157
+ * @param {object} body - body param
2158
+ * @param {getCallback} callback - a callback function to return the result
2159
+ * @return {object} results - An object containing the response of the action
2160
+ *
2161
+ * @route {POST} /dpmServiceBulkListCertificateBlob
2162
+ * @roles admin
2163
+ * @task true
2164
+ */
2165
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2166
+ dpmServiceBulkListCertificateBlob(body, callback) {
2167
+ const meth = 'adapter-dpmServiceBulkListCertificateBlob';
2168
+ const origin = `${this.id}-${meth}`;
2169
+ log.trace(origin);
2170
+
2171
+ if (this.suspended && this.suspendMode === 'error') {
2172
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2173
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2174
+ return callback(null, errorObj);
2175
+ }
2176
+
2177
+ /* HERE IS WHERE YOU VALIDATE DATA */
2178
+ if (body === undefined || body === null || body === '') {
2179
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2180
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2181
+ return callback(null, errorObj);
2182
+ }
2183
+
2184
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2185
+ const queryParamsAvailable = {};
2186
+ const queryParams = {};
2187
+ const pathVars = [];
2188
+ const bodyVars = body;
2189
+
2190
+ // loop in template. long callback arg name to avoid identifier conflicts
2191
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2192
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2193
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2194
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2195
+ }
2196
+ });
2197
+
2198
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2199
+ // see adapter code documentation for more information on the request object's fields
2200
+ const reqObj = {
2201
+ payload: bodyVars,
2202
+ uriPathVars: pathVars,
2203
+ uriQuery: queryParams
2204
+ };
2205
+
2206
+ try {
2207
+ // Make the call -
2208
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2209
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkListCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
2210
+ // if we received an error or their is no response on the results
2211
+ // return an error
2212
+ if (irReturnError) {
2213
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2214
+ return callback(null, irReturnError);
2215
+ }
2216
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2217
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkListCertificateBlob'], null, null, null);
2218
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2219
+ return callback(null, errorObj);
2220
+ }
2221
+
2222
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2223
+ // return the response
2224
+ return callback(irReturnData, null);
2225
+ });
2226
+ } catch (ex) {
2227
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2228
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2229
+ return callback(null, errorObj);
2230
+ }
2231
+ }
2232
+
2233
+ /**
2234
+ * @function dpmServiceBulkListCaCertificateBlob
2235
+ * @pronghornType method
2236
+ * @name dpmServiceBulkListCaCertificateBlob
2237
+ * @summary Bulk list ca-certificate-blobs
2238
+ *
2239
+ * @param {object} body - body param
2240
+ * @param {getCallback} callback - a callback function to return the result
2241
+ * @return {object} results - An object containing the response of the action
2242
+ *
2243
+ * @route {POST} /dpmServiceBulkListCaCertificateBlob
2244
+ * @roles admin
2245
+ * @task true
2246
+ */
2247
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2248
+ dpmServiceBulkListCaCertificateBlob(body, callback) {
2249
+ const meth = 'adapter-dpmServiceBulkListCaCertificateBlob';
2250
+ const origin = `${this.id}-${meth}`;
2251
+ log.trace(origin);
2252
+
2253
+ if (this.suspended && this.suspendMode === 'error') {
2254
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2255
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2256
+ return callback(null, errorObj);
2257
+ }
2258
+
2259
+ /* HERE IS WHERE YOU VALIDATE DATA */
2260
+ if (body === undefined || body === null || body === '') {
2261
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2262
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2263
+ return callback(null, errorObj);
2264
+ }
2265
+
2266
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2267
+ const queryParamsAvailable = {};
2268
+ const queryParams = {};
2269
+ const pathVars = [];
2270
+ const bodyVars = body;
2271
+
2272
+ // loop in template. long callback arg name to avoid identifier conflicts
2273
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2274
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2275
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2276
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2277
+ }
2278
+ });
2279
+
2280
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2281
+ // see adapter code documentation for more information on the request object's fields
2282
+ const reqObj = {
2283
+ payload: bodyVars,
2284
+ uriPathVars: pathVars,
2285
+ uriQuery: queryParams
2286
+ };
2287
+
2288
+ try {
2289
+ // Make the call -
2290
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2291
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkListCaCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
2292
+ // if we received an error or their is no response on the results
2293
+ // return an error
2294
+ if (irReturnError) {
2295
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2296
+ return callback(null, irReturnError);
2297
+ }
2298
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2299
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkListCaCertificateBlob'], null, null, null);
2300
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2301
+ return callback(null, errorObj);
2302
+ }
2303
+
2304
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2305
+ // return the response
2306
+ return callback(irReturnData, null);
2307
+ });
2308
+ } catch (ex) {
2309
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2310
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2311
+ return callback(null, errorObj);
2312
+ }
2313
+ }
2314
+
2315
+ /**
2316
+ * @function dpmServiceUpdateDeletedResource
2317
+ * @pronghornType method
2318
+ * @name dpmServiceUpdateDeletedResource
2319
+ * @summary Update deleted-resource by ID
2320
+ *
2321
+ * @param {string} iD - iD param
2322
+ * @param {object} body - body param
2323
+ * @param {getCallback} callback - a callback function to return the result
2324
+ * @return {object} results - An object containing the response of the action
2325
+ *
2326
+ * @route {POST} /dpmServiceUpdateDeletedResource
2327
+ * @roles admin
2328
+ * @task true
2329
+ */
2330
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2331
+ dpmServiceUpdateDeletedResource(iD, body, callback) {
2332
+ const meth = 'adapter-dpmServiceUpdateDeletedResource';
2333
+ const origin = `${this.id}-${meth}`;
2334
+ log.trace(origin);
2335
+
2336
+ if (this.suspended && this.suspendMode === 'error') {
2337
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2338
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2339
+ return callback(null, errorObj);
2340
+ }
2341
+
2342
+ /* HERE IS WHERE YOU VALIDATE DATA */
2343
+ if (iD === undefined || iD === null || iD === '') {
2344
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2345
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2346
+ return callback(null, errorObj);
2347
+ }
2348
+ if (body === undefined || body === null || body === '') {
2349
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2350
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2351
+ return callback(null, errorObj);
2352
+ }
2353
+
2354
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2355
+ const queryParamsAvailable = {};
2356
+ const queryParams = {};
2357
+ const pathVars = [iD];
2358
+ const bodyVars = body;
2359
+
2360
+ // loop in template. long callback arg name to avoid identifier conflicts
2361
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2362
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2363
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2364
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2365
+ }
2366
+ });
2367
+
2368
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2369
+ // see adapter code documentation for more information on the request object's fields
2370
+ const reqObj = {
2371
+ payload: bodyVars,
2372
+ uriPathVars: pathVars,
2373
+ uriQuery: queryParams
2374
+ };
2375
+
2376
+ try {
2377
+ // Make the call -
2378
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2379
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceUpdateDeletedResource', reqObj, false, (irReturnData, irReturnError) => {
2380
+ // if we received an error or their is no response on the results
2381
+ // return an error
2382
+ if (irReturnError) {
2383
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2384
+ return callback(null, irReturnError);
2385
+ }
2386
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2387
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceUpdateDeletedResource'], null, null, null);
2388
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2389
+ return callback(null, errorObj);
2390
+ }
2391
+
2392
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2393
+ // return the response
2394
+ return callback(irReturnData, null);
2395
+ });
2396
+ } catch (ex) {
2397
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2398
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2399
+ return callback(null, errorObj);
2400
+ }
2401
+ }
2402
+
2403
+ /**
2404
+ * @function dpmServiceDeleteDeletedResource
2405
+ * @pronghornType method
2406
+ * @name dpmServiceDeleteDeletedResource
2407
+ * @summary Delete deleted-resource by ID
2408
+ *
2409
+ * @param {string} iD - iD param
2410
+ * @param {getCallback} callback - a callback function to return the result
2411
+ * @return {object} results - An object containing the response of the action
2412
+ *
2413
+ * @route {POST} /dpmServiceDeleteDeletedResource
2414
+ * @roles admin
2415
+ * @task true
2416
+ */
2417
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2418
+ dpmServiceDeleteDeletedResource(iD, callback) {
2419
+ const meth = 'adapter-dpmServiceDeleteDeletedResource';
2420
+ const origin = `${this.id}-${meth}`;
2421
+ log.trace(origin);
2422
+
2423
+ if (this.suspended && this.suspendMode === 'error') {
2424
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2425
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2426
+ return callback(null, errorObj);
2427
+ }
2428
+
2429
+ /* HERE IS WHERE YOU VALIDATE DATA */
2430
+ if (iD === undefined || iD === null || iD === '') {
2431
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2432
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2433
+ return callback(null, errorObj);
2434
+ }
2435
+
2436
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2437
+ const queryParamsAvailable = {};
2438
+ const queryParams = {};
2439
+ const pathVars = [iD];
2440
+ const bodyVars = {};
2441
+
2442
+ // loop in template. long callback arg name to avoid identifier conflicts
2443
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2444
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2445
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2446
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2447
+ }
2448
+ });
2449
+
2450
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2451
+ // see adapter code documentation for more information on the request object's fields
2452
+ const reqObj = {
2453
+ payload: bodyVars,
2454
+ uriPathVars: pathVars,
2455
+ uriQuery: queryParams
2456
+ };
2457
+
2458
+ try {
2459
+ // Make the call -
2460
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2461
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceDeleteDeletedResource', reqObj, false, (irReturnData, irReturnError) => {
2462
+ // if we received an error or their is no response on the results
2463
+ // return an error
2464
+ if (irReturnError) {
2465
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2466
+ return callback(null, irReturnError);
2467
+ }
2468
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2469
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceDeleteDeletedResource'], null, null, null);
2470
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2471
+ return callback(null, errorObj);
2472
+ }
2473
+
2474
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2475
+ // return the response
2476
+ return callback(irReturnData, null);
2477
+ });
2478
+ } catch (ex) {
2479
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2480
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2481
+ return callback(null, errorObj);
2482
+ }
2483
+ }
2484
+
2485
+ /**
2486
+ * @function dpmServiceGetDeletedResource
2487
+ * @pronghornType method
2488
+ * @name dpmServiceGetDeletedResource
2489
+ * @summary Get deleted-resource by ID
2490
+ *
2491
+ * @param {string} iD - iD param
2492
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
2493
+ * @param {array} [fields] - limit displayed fields.
2494
+ * @param {array} [refFields] - limit displayed reference fields.
2495
+ * @param {getCallback} callback - a callback function to return the result
2496
+ * @return {object} results - An object containing the response of the action
2497
+ *
2498
+ * @route {POST} /dpmServiceGetDeletedResource
2499
+ * @roles admin
2500
+ * @task true
2501
+ */
2502
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2503
+ dpmServiceGetDeletedResource(iD, detail, fields, refFields, callback) {
2504
+ const meth = 'adapter-dpmServiceGetDeletedResource';
2505
+ const origin = `${this.id}-${meth}`;
2506
+ log.trace(origin);
2507
+
2508
+ if (this.suspended && this.suspendMode === 'error') {
2509
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2510
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2511
+ return callback(null, errorObj);
2512
+ }
2513
+
2514
+ /* HERE IS WHERE YOU VALIDATE DATA */
2515
+ if (iD === undefined || iD === null || iD === '') {
2516
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2517
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2518
+ return callback(null, errorObj);
2519
+ }
2520
+
2521
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2522
+ const queryParamsAvailable = { detail, fields, refFields };
2523
+ const queryParams = {};
2524
+ const pathVars = [iD];
2525
+ const bodyVars = {};
2526
+
2527
+ // loop in template. long callback arg name to avoid identifier conflicts
2528
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2529
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2530
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2531
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2532
+ }
2533
+ });
2534
+
2535
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2536
+ // see adapter code documentation for more information on the request object's fields
2537
+ const reqObj = {
2538
+ payload: bodyVars,
2539
+ uriPathVars: pathVars,
2540
+ uriQuery: queryParams
2541
+ };
2542
+
2543
+ try {
2544
+ // Make the call -
2545
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2546
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceGetDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
2547
+ // if we received an error or their is no response on the results
2548
+ // return an error
2549
+ if (irReturnError) {
2550
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2551
+ return callback(null, irReturnError);
2552
+ }
2553
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2554
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceGetDeletedResource'], null, null, null);
2555
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2556
+ return callback(null, errorObj);
2557
+ }
2558
+
2559
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2560
+ // return the response
2561
+ return callback(irReturnData, null);
2562
+ });
2563
+ } catch (ex) {
2564
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2565
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2566
+ return callback(null, errorObj);
2567
+ }
2568
+ }
2569
+
2570
+ /**
2571
+ * @function dpmServiceUpdateCaCertificateBlob
2572
+ * @pronghornType method
2573
+ * @name dpmServiceUpdateCaCertificateBlob
2574
+ * @summary Update ca-certificate-blob by ID
2575
+ *
2576
+ * @param {string} iD - iD param
2577
+ * @param {object} body - body param
2578
+ * @param {getCallback} callback - a callback function to return the result
2579
+ * @return {object} results - An object containing the response of the action
2580
+ *
2581
+ * @route {POST} /dpmServiceUpdateCaCertificateBlob
2582
+ * @roles admin
2583
+ * @task true
2584
+ */
2585
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2586
+ dpmServiceUpdateCaCertificateBlob(iD, body, callback) {
2587
+ const meth = 'adapter-dpmServiceUpdateCaCertificateBlob';
2588
+ const origin = `${this.id}-${meth}`;
2589
+ log.trace(origin);
2590
+
2591
+ if (this.suspended && this.suspendMode === 'error') {
2592
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2593
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2594
+ return callback(null, errorObj);
2595
+ }
2596
+
2597
+ /* HERE IS WHERE YOU VALIDATE DATA */
2598
+ if (iD === undefined || iD === null || iD === '') {
2599
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2600
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2601
+ return callback(null, errorObj);
2602
+ }
2603
+ if (body === undefined || body === null || body === '') {
2604
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2605
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2606
+ return callback(null, errorObj);
2607
+ }
2608
+
2609
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2610
+ const queryParamsAvailable = {};
2611
+ const queryParams = {};
2612
+ const pathVars = [iD];
2613
+ const bodyVars = body;
2614
+
2615
+ // loop in template. long callback arg name to avoid identifier conflicts
2616
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2617
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2618
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2619
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2620
+ }
2621
+ });
2622
+
2623
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2624
+ // see adapter code documentation for more information on the request object's fields
2625
+ const reqObj = {
2626
+ payload: bodyVars,
2627
+ uriPathVars: pathVars,
2628
+ uriQuery: queryParams
2629
+ };
2630
+
2631
+ try {
2632
+ // Make the call -
2633
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2634
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceUpdateCaCertificateBlob', reqObj, false, (irReturnData, irReturnError) => {
2635
+ // if we received an error or their is no response on the results
2636
+ // return an error
2637
+ if (irReturnError) {
2638
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2639
+ return callback(null, irReturnError);
2640
+ }
2641
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2642
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceUpdateCaCertificateBlob'], null, null, null);
2643
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2644
+ return callback(null, errorObj);
2645
+ }
2646
+
2647
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2648
+ // return the response
2649
+ return callback(irReturnData, null);
2650
+ });
2651
+ } catch (ex) {
2652
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2653
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2654
+ return callback(null, errorObj);
2655
+ }
2656
+ }
2657
+
2658
+ /**
2659
+ * @function dpmServiceDeleteCaCertificateBlob
2660
+ * @pronghornType method
2661
+ * @name dpmServiceDeleteCaCertificateBlob
2662
+ * @summary Delete ca-certificate-blob by ID
2663
+ *
2664
+ * @param {string} iD - iD param
2665
+ * @param {getCallback} callback - a callback function to return the result
2666
+ * @return {object} results - An object containing the response of the action
2667
+ *
2668
+ * @route {POST} /dpmServiceDeleteCaCertificateBlob
2669
+ * @roles admin
2670
+ * @task true
2671
+ */
2672
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2673
+ dpmServiceDeleteCaCertificateBlob(iD, callback) {
2674
+ const meth = 'adapter-dpmServiceDeleteCaCertificateBlob';
2675
+ const origin = `${this.id}-${meth}`;
2676
+ log.trace(origin);
2677
+
2678
+ if (this.suspended && this.suspendMode === 'error') {
2679
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2680
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2681
+ return callback(null, errorObj);
2682
+ }
2683
+
2684
+ /* HERE IS WHERE YOU VALIDATE DATA */
2685
+ if (iD === undefined || iD === null || iD === '') {
2686
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2687
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2688
+ return callback(null, errorObj);
2689
+ }
2690
+
2691
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2692
+ const queryParamsAvailable = {};
2693
+ const queryParams = {};
2694
+ const pathVars = [iD];
2695
+ const bodyVars = {};
2696
+
2697
+ // loop in template. long callback arg name to avoid identifier conflicts
2698
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2699
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2700
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2701
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2702
+ }
2703
+ });
2704
+
2705
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2706
+ // see adapter code documentation for more information on the request object's fields
2707
+ const reqObj = {
2708
+ payload: bodyVars,
2709
+ uriPathVars: pathVars,
2710
+ uriQuery: queryParams
2711
+ };
2712
+
2713
+ try {
2714
+ // Make the call -
2715
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2716
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceDeleteCaCertificateBlob', reqObj, false, (irReturnData, irReturnError) => {
2717
+ // if we received an error or their is no response on the results
2718
+ // return an error
2719
+ if (irReturnError) {
2720
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2721
+ return callback(null, irReturnError);
2722
+ }
2723
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2724
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceDeleteCaCertificateBlob'], null, null, null);
2725
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2726
+ return callback(null, errorObj);
2727
+ }
2728
+
2729
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2730
+ // return the response
2731
+ return callback(irReturnData, null);
2732
+ });
2733
+ } catch (ex) {
2734
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2735
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2736
+ return callback(null, errorObj);
2737
+ }
2738
+ }
2739
+
2740
+ /**
2741
+ * @function dpmServiceGetCaCertificateBlob
2742
+ * @pronghornType method
2743
+ * @name dpmServiceGetCaCertificateBlob
2744
+ * @summary Get ca-certificate-blob by ID
2745
+ *
2746
+ * @param {string} iD - iD param
2747
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
2748
+ * @param {array} [fields] - limit displayed fields.
2749
+ * @param {array} [refFields] - limit displayed reference fields.
2750
+ * @param {getCallback} callback - a callback function to return the result
2751
+ * @return {object} results - An object containing the response of the action
2752
+ *
2753
+ * @route {POST} /dpmServiceGetCaCertificateBlob
2754
+ * @roles admin
2755
+ * @task true
2756
+ */
2757
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2758
+ dpmServiceGetCaCertificateBlob(iD, detail, fields, refFields, callback) {
2759
+ const meth = 'adapter-dpmServiceGetCaCertificateBlob';
2760
+ const origin = `${this.id}-${meth}`;
2761
+ log.trace(origin);
2762
+
2763
+ if (this.suspended && this.suspendMode === 'error') {
2764
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2765
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2766
+ return callback(null, errorObj);
2767
+ }
2768
+
2769
+ /* HERE IS WHERE YOU VALIDATE DATA */
2770
+ if (iD === undefined || iD === null || iD === '') {
2771
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2772
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2773
+ return callback(null, errorObj);
2774
+ }
2775
+
2776
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2777
+ const queryParamsAvailable = { detail, fields, refFields };
2778
+ const queryParams = {};
2779
+ const pathVars = [iD];
2780
+ const bodyVars = {};
2781
+
2782
+ // loop in template. long callback arg name to avoid identifier conflicts
2783
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2784
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2785
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2786
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2787
+ }
2788
+ });
2789
+
2790
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2791
+ // see adapter code documentation for more information on the request object's fields
2792
+ const reqObj = {
2793
+ payload: bodyVars,
2794
+ uriPathVars: pathVars,
2795
+ uriQuery: queryParams
2796
+ };
2797
+
2798
+ try {
2799
+ // Make the call -
2800
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2801
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceGetCaCertificateBlob', reqObj, true, (irReturnData, irReturnError) => {
2802
+ // if we received an error or their is no response on the results
2803
+ // return an error
2804
+ if (irReturnError) {
2805
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2806
+ return callback(null, irReturnError);
2807
+ }
2808
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2809
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceGetCaCertificateBlob'], null, null, null);
2810
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2811
+ return callback(null, errorObj);
2812
+ }
2813
+
2814
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2815
+ // return the response
2816
+ return callback(irReturnData, null);
2817
+ });
2818
+ } catch (ex) {
2819
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2820
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2821
+ return callback(null, errorObj);
2822
+ }
2823
+ }
2824
+
2825
+ /**
2826
+ * @function dpmServiceBulkListLastPublishedNotification
2827
+ * @pronghornType method
2828
+ * @name dpmServiceBulkListLastPublishedNotification
2829
+ * @summary Bulk list last-published-notifications
2830
+ *
2831
+ * @param {object} body - body param
2832
+ * @param {getCallback} callback - a callback function to return the result
2833
+ * @return {object} results - An object containing the response of the action
2834
+ *
2835
+ * @route {POST} /dpmServiceBulkListLastPublishedNotification
2836
+ * @roles admin
2837
+ * @task true
2838
+ */
2839
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2840
+ dpmServiceBulkListLastPublishedNotification(body, callback) {
2841
+ const meth = 'adapter-dpmServiceBulkListLastPublishedNotification';
2842
+ const origin = `${this.id}-${meth}`;
2843
+ log.trace(origin);
2844
+
2845
+ if (this.suspended && this.suspendMode === 'error') {
2846
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2847
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2848
+ return callback(null, errorObj);
2849
+ }
2850
+
2851
+ /* HERE IS WHERE YOU VALIDATE DATA */
2852
+ if (body === undefined || body === null || body === '') {
2853
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2854
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2855
+ return callback(null, errorObj);
2856
+ }
2857
+
2858
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2859
+ const queryParamsAvailable = {};
2860
+ const queryParams = {};
2861
+ const pathVars = [];
2862
+ const bodyVars = body;
2863
+
2864
+ // loop in template. long callback arg name to avoid identifier conflicts
2865
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2866
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2867
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2868
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2869
+ }
2870
+ });
2871
+
2872
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2873
+ // see adapter code documentation for more information on the request object's fields
2874
+ const reqObj = {
2875
+ payload: bodyVars,
2876
+ uriPathVars: pathVars,
2877
+ uriQuery: queryParams
2878
+ };
2879
+
2880
+ try {
2881
+ // Make the call -
2882
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2883
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkListLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
2884
+ // if we received an error or their is no response on the results
2885
+ // return an error
2886
+ if (irReturnError) {
2887
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2888
+ return callback(null, irReturnError);
2889
+ }
2890
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2891
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkListLastPublishedNotification'], null, null, null);
2892
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2893
+ return callback(null, errorObj);
2894
+ }
2895
+
2896
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2897
+ // return the response
2898
+ return callback(irReturnData, null);
2899
+ });
2900
+ } catch (ex) {
2901
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2902
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2903
+ return callback(null, errorObj);
2904
+ }
2905
+ }
2906
+
2907
+ /**
2908
+ * @function dpmServiceBulkRefUpdate
2909
+ * @pronghornType method
2910
+ * @name dpmServiceBulkRefUpdate
2911
+ * @summary Bulk reference updates
2912
+ *
2913
+ * @param {object} body - body param
2914
+ * @param {getCallback} callback - a callback function to return the result
2915
+ * @return {object} results - An object containing the response of the action
2916
+ *
2917
+ * @route {POST} /dpmServiceBulkRefUpdate
2918
+ * @roles admin
2919
+ * @task true
2920
+ */
2921
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2922
+ dpmServiceBulkRefUpdate(body, callback) {
2923
+ const meth = 'adapter-dpmServiceBulkRefUpdate';
2924
+ const origin = `${this.id}-${meth}`;
2925
+ log.trace(origin);
2926
+
2927
+ if (this.suspended && this.suspendMode === 'error') {
2928
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2929
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2930
+ return callback(null, errorObj);
2931
+ }
2932
+
2933
+ /* HERE IS WHERE YOU VALIDATE DATA */
2934
+ if (body === undefined || body === null || body === '') {
2935
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2936
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2937
+ return callback(null, errorObj);
2938
+ }
2939
+
2940
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2941
+ const queryParamsAvailable = {};
2942
+ const queryParams = {};
2943
+ const pathVars = [];
2944
+ const bodyVars = body;
2945
+
2946
+ // loop in template. long callback arg name to avoid identifier conflicts
2947
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2948
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2949
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2950
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2951
+ }
2952
+ });
2953
+
2954
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2955
+ // see adapter code documentation for more information on the request object's fields
2956
+ const reqObj = {
2957
+ payload: bodyVars,
2958
+ uriPathVars: pathVars,
2959
+ uriQuery: queryParams
2960
+ };
2961
+
2962
+ try {
2963
+ // Make the call -
2964
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2965
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
2966
+ // if we received an error or their is no response on the results
2967
+ // return an error
2968
+ if (irReturnError) {
2969
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2970
+ return callback(null, irReturnError);
2971
+ }
2972
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2973
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkRefUpdate'], null, null, null);
2974
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2975
+ return callback(null, errorObj);
2976
+ }
2977
+
2978
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2979
+ // return the response
2980
+ return callback(irReturnData, null);
2981
+ });
2982
+ } catch (ex) {
2983
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2984
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2985
+ return callback(null, errorObj);
2986
+ }
2987
+ }
2988
+
2989
+ /**
2990
+ * @function dpmServiceBulkListImage
2991
+ * @pronghornType method
2992
+ * @name dpmServiceBulkListImage
2993
+ * @summary Bulk list images
2994
+ *
2995
+ * @param {object} body - body param
2996
+ * @param {getCallback} callback - a callback function to return the result
2997
+ * @return {object} results - An object containing the response of the action
2998
+ *
2999
+ * @route {POST} /dpmServiceBulkListImage
3000
+ * @roles admin
3001
+ * @task true
3002
+ */
3003
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3004
+ dpmServiceBulkListImage(body, callback) {
3005
+ const meth = 'adapter-dpmServiceBulkListImage';
3006
+ const origin = `${this.id}-${meth}`;
3007
+ log.trace(origin);
3008
+
3009
+ if (this.suspended && this.suspendMode === 'error') {
3010
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3011
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3012
+ return callback(null, errorObj);
3013
+ }
3014
+
3015
+ /* HERE IS WHERE YOU VALIDATE DATA */
3016
+ if (body === undefined || body === null || body === '') {
3017
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3018
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3019
+ return callback(null, errorObj);
3020
+ }
3021
+
3022
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3023
+ const queryParamsAvailable = {};
3024
+ const queryParams = {};
3025
+ const pathVars = [];
3026
+ const bodyVars = body;
3027
+
3028
+ // loop in template. long callback arg name to avoid identifier conflicts
3029
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3030
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3031
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3032
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3033
+ }
3034
+ });
3035
+
3036
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3037
+ // see adapter code documentation for more information on the request object's fields
3038
+ const reqObj = {
3039
+ payload: bodyVars,
3040
+ uriPathVars: pathVars,
3041
+ uriQuery: queryParams
3042
+ };
3043
+
3044
+ try {
3045
+ // Make the call -
3046
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3047
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceBulkListImage', reqObj, true, (irReturnData, irReturnError) => {
3048
+ // if we received an error or their is no response on the results
3049
+ // return an error
3050
+ if (irReturnError) {
3051
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3052
+ return callback(null, irReturnError);
3053
+ }
3054
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3055
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceBulkListImage'], null, null, null);
3056
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3057
+ return callback(null, errorObj);
3058
+ }
3059
+
3060
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3061
+ // return the response
3062
+ return callback(irReturnData, null);
3063
+ });
3064
+ } catch (ex) {
3065
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3066
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3067
+ return callback(null, errorObj);
3068
+ }
3069
+ }
3070
+
3071
+ /**
3072
+ * @function dpmServiceCreateImage
3073
+ * @pronghornType method
3074
+ * @name dpmServiceCreateImage
3075
+ * @summary Create image
3076
+ *
3077
+ * @param {object} body - body param
3078
+ * @param {getCallback} callback - a callback function to return the result
3079
+ * @return {object} results - An object containing the response of the action
3080
+ *
3081
+ * @route {POST} /dpmServiceCreateImage
3082
+ * @roles admin
3083
+ * @task true
3084
+ */
3085
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3086
+ dpmServiceCreateImage(body, callback) {
3087
+ const meth = 'adapter-dpmServiceCreateImage';
3088
+ const origin = `${this.id}-${meth}`;
3089
+ log.trace(origin);
3090
+
3091
+ if (this.suspended && this.suspendMode === 'error') {
3092
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3093
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3094
+ return callback(null, errorObj);
3095
+ }
3096
+
3097
+ /* HERE IS WHERE YOU VALIDATE DATA */
3098
+ if (body === undefined || body === null || body === '') {
3099
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3100
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3101
+ return callback(null, errorObj);
3102
+ }
3103
+
3104
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3105
+ const queryParamsAvailable = {};
3106
+ const queryParams = {};
3107
+ const pathVars = [];
3108
+ const bodyVars = body;
3109
+
3110
+ // loop in template. long callback arg name to avoid identifier conflicts
3111
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3112
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3113
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3114
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3115
+ }
3116
+ });
3117
+
3118
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3119
+ // see adapter code documentation for more information on the request object's fields
3120
+ const reqObj = {
3121
+ payload: bodyVars,
3122
+ uriPathVars: pathVars,
3123
+ uriQuery: queryParams
3124
+ };
3125
+
3126
+ try {
3127
+ // Make the call -
3128
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3129
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceCreateImage', reqObj, true, (irReturnData, irReturnError) => {
3130
+ // if we received an error or their is no response on the results
3131
+ // return an error
3132
+ if (irReturnError) {
3133
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3134
+ return callback(null, irReturnError);
3135
+ }
3136
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3137
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceCreateImage'], null, null, null);
3138
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3139
+ return callback(null, errorObj);
3140
+ }
3141
+
3142
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3143
+ // return the response
3144
+ return callback(irReturnData, null);
3145
+ });
3146
+ } catch (ex) {
3147
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3148
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3149
+ return callback(null, errorObj);
3150
+ }
3151
+ }
3152
+
3153
+ /**
3154
+ * @function dpmServiceListImage
3155
+ * @pronghornType method
3156
+ * @name dpmServiceListImage
3157
+ * @summary List images
3158
+ *
3159
+ * @param {string} [specSize] - Number of items expected to be returned.
3160
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
3161
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
3162
+ * @param {boolean} [specCount] - specCount param
3163
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
3164
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
3165
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
3166
+ * @param {string} [specParentType] - Filter by parent type.
3167
+ * @param {array} [specParentId] - Filter by parent UUIDs.
3168
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
3169
+ * @param {array} [specObjUuids] - Filter by UUIDs.
3170
+ * @param {array} [specFields] - limit displayed fields.
3171
+ * @param {array} [specFilters] - QueryFilter in string format.
3172
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
3173
+ introducing new fields which will take string as input.
3174
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
3175
+ * @param {string} [specFrom] - Start from items expected to be returned.
3176
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
3177
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
3178
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
3179
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
3180
+ * @param {array} [specRefFields] - limit displayed reference fields.
3181
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
3182
+ * @param {getCallback} callback - a callback function to return the result
3183
+ * @return {object} results - An object containing the response of the action
3184
+ *
3185
+ * @route {POST} /dpmServiceListImage
3186
+ * @roles admin
3187
+ * @task true
3188
+ */
3189
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3190
+ dpmServiceListImage(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
3191
+ const meth = 'adapter-dpmServiceListImage';
3192
+ const origin = `${this.id}-${meth}`;
3193
+ log.trace(origin);
3194
+
3195
+ if (this.suspended && this.suspendMode === 'error') {
3196
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3197
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3198
+ return callback(null, errorObj);
3199
+ }
3200
+
3201
+ /* HERE IS WHERE YOU VALIDATE DATA */
3202
+
3203
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3204
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
3205
+ const queryParams = {};
3206
+ const pathVars = [];
3207
+ const bodyVars = {};
3208
+
3209
+ // loop in template. long callback arg name to avoid identifier conflicts
3210
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3211
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3212
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3213
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3214
+ }
3215
+ });
3216
+
3217
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3218
+ // see adapter code documentation for more information on the request object's fields
3219
+ const reqObj = {
3220
+ payload: bodyVars,
3221
+ uriPathVars: pathVars,
3222
+ uriQuery: queryParams
3223
+ };
3224
+
3225
+ try {
3226
+ // Make the call -
3227
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3228
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceListImage', reqObj, true, (irReturnData, irReturnError) => {
3229
+ // if we received an error or their is no response on the results
3230
+ // return an error
3231
+ if (irReturnError) {
3232
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3233
+ return callback(null, irReturnError);
3234
+ }
3235
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3236
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceListImage'], null, null, null);
3237
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3238
+ return callback(null, errorObj);
3239
+ }
3240
+
3241
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3242
+ // return the response
3243
+ return callback(irReturnData, null);
3244
+ });
3245
+ } catch (ex) {
3246
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3247
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3248
+ return callback(null, errorObj);
3249
+ }
3250
+ }
3251
+
3252
+ /**
3253
+ * @function dpmServiceUpdateImage
3254
+ * @pronghornType method
3255
+ * @name dpmServiceUpdateImage
3256
+ * @summary Update image by ID
3257
+ *
3258
+ * @param {string} iD - iD param
3259
+ * @param {object} body - body param
3260
+ * @param {getCallback} callback - a callback function to return the result
3261
+ * @return {object} results - An object containing the response of the action
3262
+ *
3263
+ * @route {POST} /dpmServiceUpdateImage
3264
+ * @roles admin
3265
+ * @task true
3266
+ */
3267
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3268
+ dpmServiceUpdateImage(iD, body, callback) {
3269
+ const meth = 'adapter-dpmServiceUpdateImage';
3270
+ const origin = `${this.id}-${meth}`;
3271
+ log.trace(origin);
3272
+
3273
+ if (this.suspended && this.suspendMode === 'error') {
3274
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3275
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3276
+ return callback(null, errorObj);
3277
+ }
3278
+
3279
+ /* HERE IS WHERE YOU VALIDATE DATA */
3280
+ if (iD === undefined || iD === null || iD === '') {
3281
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3282
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3283
+ return callback(null, errorObj);
3284
+ }
3285
+ if (body === undefined || body === null || body === '') {
3286
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3287
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3288
+ return callback(null, errorObj);
3289
+ }
3290
+
3291
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3292
+ const queryParamsAvailable = {};
3293
+ const queryParams = {};
3294
+ const pathVars = [iD];
3295
+ const bodyVars = body;
3296
+
3297
+ // loop in template. long callback arg name to avoid identifier conflicts
3298
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3299
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3300
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3301
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3302
+ }
3303
+ });
3304
+
3305
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3306
+ // see adapter code documentation for more information on the request object's fields
3307
+ const reqObj = {
3308
+ payload: bodyVars,
3309
+ uriPathVars: pathVars,
3310
+ uriQuery: queryParams
3311
+ };
3312
+
3313
+ try {
3314
+ // Make the call -
3315
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3316
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceUpdateImage', reqObj, false, (irReturnData, irReturnError) => {
3317
+ // if we received an error or their is no response on the results
3318
+ // return an error
3319
+ if (irReturnError) {
3320
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3321
+ return callback(null, irReturnError);
3322
+ }
3323
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3324
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceUpdateImage'], null, null, null);
3325
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3326
+ return callback(null, errorObj);
3327
+ }
3328
+
3329
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3330
+ // return the response
3331
+ return callback(irReturnData, null);
3332
+ });
3333
+ } catch (ex) {
3334
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3335
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3336
+ return callback(null, errorObj);
3337
+ }
3338
+ }
3339
+
3340
+ /**
3341
+ * @function dpmServiceDeleteImage
3342
+ * @pronghornType method
3343
+ * @name dpmServiceDeleteImage
3344
+ * @summary Delete image by ID
3345
+ *
3346
+ * @param {string} iD - iD param
3347
+ * @param {getCallback} callback - a callback function to return the result
3348
+ * @return {object} results - An object containing the response of the action
3349
+ *
3350
+ * @route {POST} /dpmServiceDeleteImage
3351
+ * @roles admin
3352
+ * @task true
3353
+ */
3354
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3355
+ dpmServiceDeleteImage(iD, callback) {
3356
+ const meth = 'adapter-dpmServiceDeleteImage';
3357
+ const origin = `${this.id}-${meth}`;
3358
+ log.trace(origin);
3359
+
3360
+ if (this.suspended && this.suspendMode === 'error') {
3361
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3362
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3363
+ return callback(null, errorObj);
3364
+ }
3365
+
3366
+ /* HERE IS WHERE YOU VALIDATE DATA */
3367
+ if (iD === undefined || iD === null || iD === '') {
3368
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3369
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3370
+ return callback(null, errorObj);
3371
+ }
3372
+
3373
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3374
+ const queryParamsAvailable = {};
3375
+ const queryParams = {};
3376
+ const pathVars = [iD];
3377
+ const bodyVars = {};
3378
+
3379
+ // loop in template. long callback arg name to avoid identifier conflicts
3380
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3381
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3382
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3383
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3384
+ }
3385
+ });
3386
+
3387
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3388
+ // see adapter code documentation for more information on the request object's fields
3389
+ const reqObj = {
3390
+ payload: bodyVars,
3391
+ uriPathVars: pathVars,
3392
+ uriQuery: queryParams
3393
+ };
3394
+
3395
+ try {
3396
+ // Make the call -
3397
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3398
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceDeleteImage', reqObj, false, (irReturnData, irReturnError) => {
3399
+ // if we received an error or their is no response on the results
3400
+ // return an error
3401
+ if (irReturnError) {
3402
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3403
+ return callback(null, irReturnError);
3404
+ }
3405
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3406
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceDeleteImage'], null, null, null);
3407
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3408
+ return callback(null, errorObj);
3409
+ }
3410
+
3411
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3412
+ // return the response
3413
+ return callback(irReturnData, null);
3414
+ });
3415
+ } catch (ex) {
3416
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3417
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3418
+ return callback(null, errorObj);
3419
+ }
3420
+ }
3421
+
3422
+ /**
3423
+ * @function dpmServiceGetImage
3424
+ * @pronghornType method
3425
+ * @name dpmServiceGetImage
3426
+ * @summary Get image by ID
3427
+ *
3428
+ * @param {string} iD - iD param
3429
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
3430
+ * @param {array} [fields] - limit displayed fields.
3431
+ * @param {array} [refFields] - limit displayed reference fields.
3432
+ * @param {getCallback} callback - a callback function to return the result
3433
+ * @return {object} results - An object containing the response of the action
3434
+ *
3435
+ * @route {POST} /dpmServiceGetImage
3436
+ * @roles admin
3437
+ * @task true
3438
+ */
3439
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3440
+ dpmServiceGetImage(iD, detail, fields, refFields, callback) {
3441
+ const meth = 'adapter-dpmServiceGetImage';
3442
+ const origin = `${this.id}-${meth}`;
3443
+ log.trace(origin);
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
+
3451
+ /* HERE IS WHERE YOU VALIDATE DATA */
3452
+ if (iD === undefined || iD === null || iD === '') {
3453
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3454
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3455
+ return callback(null, errorObj);
3456
+ }
3457
+
3458
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3459
+ const queryParamsAvailable = { detail, fields, refFields };
3460
+ const queryParams = {};
3461
+ const pathVars = [iD];
3462
+ const bodyVars = {};
3463
+
3464
+ // loop in template. long callback arg name to avoid identifier conflicts
3465
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3466
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3467
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3468
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3469
+ }
3470
+ });
3471
+
3472
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3473
+ // see adapter code documentation for more information on the request object's fields
3474
+ const reqObj = {
3475
+ payload: bodyVars,
3476
+ uriPathVars: pathVars,
3477
+ uriQuery: queryParams
3478
+ };
3479
+
3480
+ try {
3481
+ // Make the call -
3482
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3483
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceGetImage', reqObj, true, (irReturnData, irReturnError) => {
3484
+ // if we received an error or their is no response on the results
3485
+ // return an error
3486
+ if (irReturnError) {
3487
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3488
+ return callback(null, irReturnError);
3489
+ }
3490
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3491
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceGetImage'], null, null, null);
3492
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3493
+ return callback(null, errorObj);
3494
+ }
3495
+
3496
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3497
+ // return the response
3498
+ return callback(irReturnData, null);
3499
+ });
3500
+ } catch (ex) {
3501
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3502
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3503
+ return callback(null, errorObj);
3504
+ }
3505
+ }
3506
+
3507
+ /**
3508
+ * @function dpmServiceUpdateLastPublishedNotification
3509
+ * @pronghornType method
3510
+ * @name dpmServiceUpdateLastPublishedNotification
3511
+ * @summary Update last-published-notification by ID
3512
+ *
3513
+ * @param {string} iD - iD param
3514
+ * @param {object} body - body param
3515
+ * @param {getCallback} callback - a callback function to return the result
3516
+ * @return {object} results - An object containing the response of the action
3517
+ *
3518
+ * @route {POST} /dpmServiceUpdateLastPublishedNotification
3519
+ * @roles admin
3520
+ * @task true
3521
+ */
3522
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3523
+ dpmServiceUpdateLastPublishedNotification(iD, body, callback) {
3524
+ const meth = 'adapter-dpmServiceUpdateLastPublishedNotification';
3525
+ const origin = `${this.id}-${meth}`;
3526
+ log.trace(origin);
3527
+
3528
+ if (this.suspended && this.suspendMode === 'error') {
3529
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3530
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3531
+ return callback(null, errorObj);
3532
+ }
3533
+
3534
+ /* HERE IS WHERE YOU VALIDATE DATA */
3535
+ if (iD === undefined || iD === null || iD === '') {
3536
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3537
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3538
+ return callback(null, errorObj);
3539
+ }
3540
+ if (body === undefined || body === null || body === '') {
3541
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3542
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3543
+ return callback(null, errorObj);
3544
+ }
3545
+
3546
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3547
+ const queryParamsAvailable = {};
3548
+ const queryParams = {};
3549
+ const pathVars = [iD];
3550
+ const bodyVars = body;
3551
+
3552
+ // loop in template. long callback arg name to avoid identifier conflicts
3553
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3554
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3555
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3556
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3557
+ }
3558
+ });
3559
+
3560
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3561
+ // see adapter code documentation for more information on the request object's fields
3562
+ const reqObj = {
3563
+ payload: bodyVars,
3564
+ uriPathVars: pathVars,
3565
+ uriQuery: queryParams
3566
+ };
3567
+
3568
+ try {
3569
+ // Make the call -
3570
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3571
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceUpdateLastPublishedNotification', reqObj, false, (irReturnData, irReturnError) => {
3572
+ // if we received an error or their is no response on the results
3573
+ // return an error
3574
+ if (irReturnError) {
3575
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3576
+ return callback(null, irReturnError);
3577
+ }
3578
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3579
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceUpdateLastPublishedNotification'], null, null, null);
3580
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3581
+ return callback(null, errorObj);
3582
+ }
3583
+
3584
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3585
+ // return the response
3586
+ return callback(irReturnData, null);
3587
+ });
3588
+ } catch (ex) {
3589
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3590
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3591
+ return callback(null, errorObj);
3592
+ }
3593
+ }
3594
+
3595
+ /**
3596
+ * @function dpmServiceDeleteLastPublishedNotification
3597
+ * @pronghornType method
3598
+ * @name dpmServiceDeleteLastPublishedNotification
3599
+ * @summary Delete last-published-notification by ID
3600
+ *
3601
+ * @param {string} iD - iD param
3602
+ * @param {getCallback} callback - a callback function to return the result
3603
+ * @return {object} results - An object containing the response of the action
3604
+ *
3605
+ * @route {POST} /dpmServiceDeleteLastPublishedNotification
3606
+ * @roles admin
3607
+ * @task true
3608
+ */
3609
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3610
+ dpmServiceDeleteLastPublishedNotification(iD, callback) {
3611
+ const meth = 'adapter-dpmServiceDeleteLastPublishedNotification';
3612
+ const origin = `${this.id}-${meth}`;
3613
+ log.trace(origin);
3614
+
3615
+ if (this.suspended && this.suspendMode === 'error') {
3616
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3617
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3618
+ return callback(null, errorObj);
3619
+ }
3620
+
3621
+ /* HERE IS WHERE YOU VALIDATE DATA */
3622
+ if (iD === undefined || iD === null || iD === '') {
3623
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3624
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3625
+ return callback(null, errorObj);
3626
+ }
3627
+
3628
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3629
+ const queryParamsAvailable = {};
3630
+ const queryParams = {};
3631
+ const pathVars = [iD];
3632
+ const bodyVars = {};
3633
+
3634
+ // loop in template. long callback arg name to avoid identifier conflicts
3635
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3636
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3637
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3638
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3639
+ }
3640
+ });
3641
+
3642
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3643
+ // see adapter code documentation for more information on the request object's fields
3644
+ const reqObj = {
3645
+ payload: bodyVars,
3646
+ uriPathVars: pathVars,
3647
+ uriQuery: queryParams
3648
+ };
3649
+
3650
+ try {
3651
+ // Make the call -
3652
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3653
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceDeleteLastPublishedNotification', reqObj, false, (irReturnData, irReturnError) => {
3654
+ // if we received an error or their is no response on the results
3655
+ // return an error
3656
+ if (irReturnError) {
3657
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3658
+ return callback(null, irReturnError);
3659
+ }
3660
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3661
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceDeleteLastPublishedNotification'], null, null, null);
3662
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3663
+ return callback(null, errorObj);
3664
+ }
3665
+
3666
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3667
+ // return the response
3668
+ return callback(irReturnData, null);
3669
+ });
3670
+ } catch (ex) {
3671
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3672
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3673
+ return callback(null, errorObj);
3674
+ }
3675
+ }
3676
+
3677
+ /**
3678
+ * @function dpmServiceGetLastPublishedNotification
3679
+ * @pronghornType method
3680
+ * @name dpmServiceGetLastPublishedNotification
3681
+ * @summary Get last-published-notification by ID
3682
+ *
3683
+ * @param {string} iD - iD param
3684
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
3685
+ * @param {array} [fields] - limit displayed fields.
3686
+ * @param {array} [refFields] - limit displayed reference fields.
3687
+ * @param {getCallback} callback - a callback function to return the result
3688
+ * @return {object} results - An object containing the response of the action
3689
+ *
3690
+ * @route {POST} /dpmServiceGetLastPublishedNotification
3691
+ * @roles admin
3692
+ * @task true
3693
+ */
3694
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3695
+ dpmServiceGetLastPublishedNotification(iD, detail, fields, refFields, callback) {
3696
+ const meth = 'adapter-dpmServiceGetLastPublishedNotification';
3697
+ const origin = `${this.id}-${meth}`;
3698
+ log.trace(origin);
3699
+
3700
+ if (this.suspended && this.suspendMode === 'error') {
3701
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3702
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3703
+ return callback(null, errorObj);
3704
+ }
3705
+
3706
+ /* HERE IS WHERE YOU VALIDATE DATA */
3707
+ if (iD === undefined || iD === null || iD === '') {
3708
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3709
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3710
+ return callback(null, errorObj);
3711
+ }
3712
+
3713
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3714
+ const queryParamsAvailable = { detail, fields, refFields };
3715
+ const queryParams = {};
3716
+ const pathVars = [iD];
3717
+ const bodyVars = {};
3718
+
3719
+ // loop in template. long callback arg name to avoid identifier conflicts
3720
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3721
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3722
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3723
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3724
+ }
3725
+ });
3726
+
3727
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3728
+ // see adapter code documentation for more information on the request object's fields
3729
+ const reqObj = {
3730
+ payload: bodyVars,
3731
+ uriPathVars: pathVars,
3732
+ uriQuery: queryParams
3733
+ };
3734
+
3735
+ try {
3736
+ // Make the call -
3737
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3738
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceGetLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
3739
+ // if we received an error or their is no response on the results
3740
+ // return an error
3741
+ if (irReturnError) {
3742
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3743
+ return callback(null, irReturnError);
3744
+ }
3745
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3746
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceGetLastPublishedNotification'], null, null, null);
3747
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3748
+ return callback(null, errorObj);
3749
+ }
3750
+
3751
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3752
+ // return the response
3753
+ return callback(irReturnData, null);
3754
+ });
3755
+ } catch (ex) {
3756
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3757
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3758
+ return callback(null, errorObj);
3759
+ }
3760
+ }
3761
+
3762
+ /**
3763
+ * @function dpmServiceRefUpdate
3764
+ * @pronghornType method
3765
+ * @name dpmServiceRefUpdate
3766
+ * @summary Reference update
3767
+ *
3768
+ * @param {object} body - body param
3769
+ * @param {getCallback} callback - a callback function to return the result
3770
+ * @return {object} results - An object containing the response of the action
3771
+ *
3772
+ * @route {POST} /dpmServiceRefUpdate
3773
+ * @roles admin
3774
+ * @task true
3775
+ */
3776
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3777
+ dpmServiceRefUpdate(body, callback) {
3778
+ const meth = 'adapter-dpmServiceRefUpdate';
3779
+ const origin = `${this.id}-${meth}`;
3780
+ log.trace(origin);
3781
+
3782
+ if (this.suspended && this.suspendMode === 'error') {
3783
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3784
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3785
+ return callback(null, errorObj);
3786
+ }
3787
+
3788
+ /* HERE IS WHERE YOU VALIDATE DATA */
3789
+ if (body === undefined || body === null || body === '') {
3790
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3791
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3792
+ return callback(null, errorObj);
3793
+ }
3794
+
3795
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3796
+ const queryParamsAvailable = {};
3797
+ const queryParams = {};
3798
+ const pathVars = [];
3799
+ const bodyVars = body;
3800
+
3801
+ // loop in template. long callback arg name to avoid identifier conflicts
3802
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3803
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3804
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3805
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3806
+ }
3807
+ });
3808
+
3809
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3810
+ // see adapter code documentation for more information on the request object's fields
3811
+ const reqObj = {
3812
+ payload: bodyVars,
3813
+ uriPathVars: pathVars,
3814
+ uriQuery: queryParams
3815
+ };
3816
+
3817
+ try {
3818
+ // Make the call -
3819
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3820
+ return this.requestHandlerInst.identifyRequest('DpmService', 'dpmServiceRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
3821
+ // if we received an error or their is no response on the results
3822
+ // return an error
3823
+ if (irReturnError) {
3824
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3825
+ return callback(null, irReturnError);
3826
+ }
3827
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3828
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['dpmServiceRefUpdate'], null, null, null);
3829
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3830
+ return callback(null, errorObj);
3831
+ }
3832
+
3833
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3834
+ // return the response
3835
+ return callback(irReturnData, null);
3836
+ });
3837
+ } catch (ex) {
3838
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3839
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3840
+ return callback(null, errorObj);
3841
+ }
3842
+ }
3843
+
3844
+ /**
3845
+ * @function imageManagerDeleteCertificate
3846
+ * @pronghornType method
3847
+ * @name imageManagerDeleteCertificate
3848
+ * @summary DeleteCertificate
3849
+ *
3850
+ * @param {object} body - body param
3851
+ * @param {getCallback} callback - a callback function to return the result
3852
+ * @return {object} results - An object containing the response of the action
3853
+ *
3854
+ * @route {POST} /imageManagerDeleteCertificate
3855
+ * @roles admin
3856
+ * @task true
3857
+ */
3858
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3859
+ imageManagerDeleteCertificate(body, callback) {
3860
+ const meth = 'adapter-imageManagerDeleteCertificate';
3861
+ const origin = `${this.id}-${meth}`;
3862
+ log.trace(origin);
3863
+
3864
+ if (this.suspended && this.suspendMode === 'error') {
3865
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3866
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3867
+ return callback(null, errorObj);
3868
+ }
3869
+
3870
+ /* HERE IS WHERE YOU VALIDATE DATA */
3871
+ if (body === undefined || body === null || body === '') {
3872
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3873
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3874
+ return callback(null, errorObj);
3875
+ }
3876
+
3877
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3878
+ const queryParamsAvailable = {};
3879
+ const queryParams = {};
3880
+ const pathVars = [];
3881
+ const bodyVars = body;
3882
+
3883
+ // loop in template. long callback arg name to avoid identifier conflicts
3884
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3885
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3886
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3887
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3888
+ }
3889
+ });
3890
+
3891
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3892
+ // see adapter code documentation for more information on the request object's fields
3893
+ const reqObj = {
3894
+ payload: bodyVars,
3895
+ uriPathVars: pathVars,
3896
+ uriQuery: queryParams
3897
+ };
3898
+
3899
+ try {
3900
+ // Make the call -
3901
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3902
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerDeleteCertificate', reqObj, true, (irReturnData, irReturnError) => {
3903
+ // if we received an error or their is no response on the results
3904
+ // return an error
3905
+ if (irReturnError) {
3906
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3907
+ return callback(null, irReturnError);
3908
+ }
3909
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3910
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerDeleteCertificate'], null, null, null);
3911
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3912
+ return callback(null, errorObj);
3913
+ }
3914
+
3915
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3916
+ // return the response
3917
+ return callback(irReturnData, null);
3918
+ });
3919
+ } catch (ex) {
3920
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3921
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3922
+ return callback(null, errorObj);
3923
+ }
3924
+ }
3925
+
3926
+ /**
3927
+ * @function imageManagerDeleteImages
3928
+ * @pronghornType method
3929
+ * @name imageManagerDeleteImages
3930
+ * @summary DeleteImages
3931
+ *
3932
+ * @param {object} body - body param
3933
+ * @param {getCallback} callback - a callback function to return the result
3934
+ * @return {object} results - An object containing the response of the action
3935
+ *
3936
+ * @route {POST} /imageManagerDeleteImages
3937
+ * @roles admin
3938
+ * @task true
3939
+ */
3940
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3941
+ imageManagerDeleteImages(body, callback) {
3942
+ const meth = 'adapter-imageManagerDeleteImages';
3943
+ const origin = `${this.id}-${meth}`;
3944
+ log.trace(origin);
3945
+
3946
+ if (this.suspended && this.suspendMode === 'error') {
3947
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3948
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3949
+ return callback(null, errorObj);
3950
+ }
3951
+
3952
+ /* HERE IS WHERE YOU VALIDATE DATA */
3953
+ if (body === undefined || body === null || body === '') {
3954
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3955
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3956
+ return callback(null, errorObj);
3957
+ }
3958
+
3959
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3960
+ const queryParamsAvailable = {};
3961
+ const queryParams = {};
3962
+ const pathVars = [];
3963
+ const bodyVars = body;
3964
+
3965
+ // loop in template. long callback arg name to avoid identifier conflicts
3966
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3967
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3968
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3969
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3970
+ }
3971
+ });
3972
+
3973
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3974
+ // see adapter code documentation for more information on the request object's fields
3975
+ const reqObj = {
3976
+ payload: bodyVars,
3977
+ uriPathVars: pathVars,
3978
+ uriQuery: queryParams
3979
+ };
3980
+
3981
+ try {
3982
+ // Make the call -
3983
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3984
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerDeleteImages', reqObj, true, (irReturnData, irReturnError) => {
3985
+ // if we received an error or their is no response on the results
3986
+ // return an error
3987
+ if (irReturnError) {
3988
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3989
+ return callback(null, irReturnError);
3990
+ }
3991
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3992
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerDeleteImages'], null, null, null);
3993
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3994
+ return callback(null, errorObj);
3995
+ }
3996
+
3997
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3998
+ // return the response
3999
+ return callback(irReturnData, null);
4000
+ });
4001
+ } catch (ex) {
4002
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4003
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4004
+ return callback(null, errorObj);
4005
+ }
4006
+ }
4007
+
4008
+ /**
4009
+ * @function imageManagerEnableDefaultCAProfile
4010
+ * @pronghornType method
4011
+ * @name imageManagerEnableDefaultCAProfile
4012
+ * @summary EnableDefaultCAProfile
4013
+ *
4014
+ * @param {object} body - body param
4015
+ * @param {getCallback} callback - a callback function to return the result
4016
+ * @return {object} results - An object containing the response of the action
4017
+ *
4018
+ * @route {POST} /imageManagerEnableDefaultCAProfile
4019
+ * @roles admin
4020
+ * @task true
4021
+ */
4022
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4023
+ imageManagerEnableDefaultCAProfile(body, callback) {
4024
+ const meth = 'adapter-imageManagerEnableDefaultCAProfile';
4025
+ const origin = `${this.id}-${meth}`;
4026
+ log.trace(origin);
4027
+
4028
+ if (this.suspended && this.suspendMode === 'error') {
4029
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4030
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4031
+ return callback(null, errorObj);
4032
+ }
4033
+
4034
+ /* HERE IS WHERE YOU VALIDATE DATA */
4035
+ if (body === undefined || body === null || body === '') {
4036
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4037
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4038
+ return callback(null, errorObj);
4039
+ }
4040
+
4041
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4042
+ const queryParamsAvailable = {};
4043
+ const queryParams = {};
4044
+ const pathVars = [];
4045
+ const bodyVars = body;
4046
+
4047
+ // loop in template. long callback arg name to avoid identifier conflicts
4048
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4049
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4050
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4051
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4052
+ }
4053
+ });
4054
+
4055
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4056
+ // see adapter code documentation for more information on the request object's fields
4057
+ const reqObj = {
4058
+ payload: bodyVars,
4059
+ uriPathVars: pathVars,
4060
+ uriQuery: queryParams
4061
+ };
4062
+
4063
+ try {
4064
+ // Make the call -
4065
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4066
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerEnableDefaultCAProfile', reqObj, true, (irReturnData, irReturnError) => {
4067
+ // if we received an error or their is no response on the results
4068
+ // return an error
4069
+ if (irReturnError) {
4070
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4071
+ return callback(null, irReturnError);
4072
+ }
4073
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4074
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerEnableDefaultCAProfile'], null, null, null);
4075
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4076
+ return callback(null, errorObj);
4077
+ }
4078
+
4079
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4080
+ // return the response
4081
+ return callback(irReturnData, null);
4082
+ });
4083
+ } catch (ex) {
4084
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4085
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4086
+ return callback(null, errorObj);
4087
+ }
4088
+ }
4089
+
4090
+ /**
4091
+ * @function imageManagerDeployCACertificate
4092
+ * @pronghornType method
4093
+ * @name imageManagerDeployCACertificate
4094
+ * @summary DeployCACertificate
4095
+ *
4096
+ * @param {object} body - body param
4097
+ * @param {getCallback} callback - a callback function to return the result
4098
+ * @return {object} results - An object containing the response of the action
4099
+ *
4100
+ * @route {POST} /imageManagerDeployCACertificate
4101
+ * @roles admin
4102
+ * @task true
4103
+ */
4104
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4105
+ imageManagerDeployCACertificate(body, callback) {
4106
+ const meth = 'adapter-imageManagerDeployCACertificate';
4107
+ const origin = `${this.id}-${meth}`;
4108
+ log.trace(origin);
4109
+
4110
+ if (this.suspended && this.suspendMode === 'error') {
4111
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4112
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4113
+ return callback(null, errorObj);
4114
+ }
4115
+
4116
+ /* HERE IS WHERE YOU VALIDATE DATA */
4117
+ if (body === undefined || body === null || body === '') {
4118
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4119
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4120
+ return callback(null, errorObj);
4121
+ }
4122
+
4123
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4124
+ const queryParamsAvailable = {};
4125
+ const queryParams = {};
4126
+ const pathVars = [];
4127
+ const bodyVars = body;
4128
+
4129
+ // loop in template. long callback arg name to avoid identifier conflicts
4130
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4131
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4132
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4133
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4134
+ }
4135
+ });
4136
+
4137
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4138
+ // see adapter code documentation for more information on the request object's fields
4139
+ const reqObj = {
4140
+ payload: bodyVars,
4141
+ uriPathVars: pathVars,
4142
+ uriQuery: queryParams
4143
+ };
4144
+
4145
+ try {
4146
+ // Make the call -
4147
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4148
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerDeployCACertificate', reqObj, true, (irReturnData, irReturnError) => {
4149
+ // if we received an error or their is no response on the results
4150
+ // return an error
4151
+ if (irReturnError) {
4152
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4153
+ return callback(null, irReturnError);
4154
+ }
4155
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4156
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerDeployCACertificate'], null, null, null);
4157
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4158
+ return callback(null, errorObj);
4159
+ }
4160
+
4161
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4162
+ // return the response
4163
+ return callback(irReturnData, null);
4164
+ });
4165
+ } catch (ex) {
4166
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4167
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4168
+ return callback(null, errorObj);
4169
+ }
4170
+ }
4171
+
4172
+ /**
4173
+ * @function imageManagerDeployLicense
4174
+ * @pronghornType method
4175
+ * @name imageManagerDeployLicense
4176
+ * @summary DeployLicense
4177
+ *
4178
+ * @param {object} body - body param
4179
+ * @param {getCallback} callback - a callback function to return the result
4180
+ * @return {object} results - An object containing the response of the action
4181
+ *
4182
+ * @route {POST} /imageManagerDeployLicense
4183
+ * @roles admin
4184
+ * @task true
4185
+ */
4186
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4187
+ imageManagerDeployLicense(body, callback) {
4188
+ const meth = 'adapter-imageManagerDeployLicense';
4189
+ const origin = `${this.id}-${meth}`;
4190
+ log.trace(origin);
4191
+
4192
+ if (this.suspended && this.suspendMode === 'error') {
4193
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4194
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4195
+ return callback(null, errorObj);
4196
+ }
4197
+
4198
+ /* HERE IS WHERE YOU VALIDATE DATA */
4199
+ if (body === undefined || body === null || body === '') {
4200
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4201
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4202
+ return callback(null, errorObj);
4203
+ }
4204
+
4205
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4206
+ const queryParamsAvailable = {};
4207
+ const queryParams = {};
4208
+ const pathVars = [];
4209
+ const bodyVars = body;
4210
+
4211
+ // loop in template. long callback arg name to avoid identifier conflicts
4212
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4213
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4214
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4215
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4216
+ }
4217
+ });
4218
+
4219
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4220
+ // see adapter code documentation for more information on the request object's fields
4221
+ const reqObj = {
4222
+ payload: bodyVars,
4223
+ uriPathVars: pathVars,
4224
+ uriQuery: queryParams
4225
+ };
4226
+
4227
+ try {
4228
+ // Make the call -
4229
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4230
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerDeployLicense', reqObj, true, (irReturnData, irReturnError) => {
4231
+ // if we received an error or their is no response on the results
4232
+ // return an error
4233
+ if (irReturnError) {
4234
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4235
+ return callback(null, irReturnError);
4236
+ }
4237
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4238
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerDeployLicense'], null, null, null);
4239
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4240
+ return callback(null, errorObj);
4241
+ }
4242
+
4243
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4244
+ // return the response
4245
+ return callback(irReturnData, null);
4246
+ });
4247
+ } catch (ex) {
4248
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4249
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4250
+ return callback(null, errorObj);
4251
+ }
4252
+ }
4253
+
4254
+ /**
4255
+ * @function imageManagerAddImage
4256
+ * @pronghornType method
4257
+ * @name imageManagerAddImage
4258
+ * @summary AddImage
4259
+ *
4260
+ * @param {object} body - body param
4261
+ * @param {getCallback} callback - a callback function to return the result
4262
+ * @return {object} results - An object containing the response of the action
4263
+ *
4264
+ * @route {POST} /imageManagerAddImage
4265
+ * @roles admin
4266
+ * @task true
4267
+ */
4268
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4269
+ imageManagerAddImage(body, callback) {
4270
+ const meth = 'adapter-imageManagerAddImage';
4271
+ const origin = `${this.id}-${meth}`;
4272
+ log.trace(origin);
4273
+
4274
+ if (this.suspended && this.suspendMode === 'error') {
4275
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4276
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4277
+ return callback(null, errorObj);
4278
+ }
4279
+
4280
+ /* HERE IS WHERE YOU VALIDATE DATA */
4281
+ if (body === undefined || body === null || body === '') {
4282
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4283
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4284
+ return callback(null, errorObj);
4285
+ }
4286
+
4287
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4288
+ const queryParamsAvailable = {};
4289
+ const queryParams = {};
4290
+ const pathVars = [];
4291
+ const bodyVars = body;
4292
+
4293
+ // loop in template. long callback arg name to avoid identifier conflicts
4294
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4295
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4296
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4297
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4298
+ }
4299
+ });
4300
+
4301
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4302
+ // see adapter code documentation for more information on the request object's fields
4303
+ const reqObj = {
4304
+ payload: bodyVars,
4305
+ uriPathVars: pathVars,
4306
+ uriQuery: queryParams
4307
+ };
4308
+
4309
+ try {
4310
+ // Make the call -
4311
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4312
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerAddImage', reqObj, true, (irReturnData, irReturnError) => {
4313
+ // if we received an error or their is no response on the results
4314
+ // return an error
4315
+ if (irReturnError) {
4316
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4317
+ return callback(null, irReturnError);
4318
+ }
4319
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4320
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerAddImage'], null, null, null);
4321
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4322
+ return callback(null, errorObj);
4323
+ }
4324
+
4325
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4326
+ // return the response
4327
+ return callback(irReturnData, null);
4328
+ });
4329
+ } catch (ex) {
4330
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4331
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4332
+ return callback(null, errorObj);
4333
+ }
4334
+ }
4335
+
4336
+ /**
4337
+ * @function imageManagerDeployImage
4338
+ * @pronghornType method
4339
+ * @name imageManagerDeployImage
4340
+ * @summary DeployImage
4341
+ *
4342
+ * @param {object} body - body param
4343
+ * @param {getCallback} callback - a callback function to return the result
4344
+ * @return {object} results - An object containing the response of the action
4345
+ *
4346
+ * @route {POST} /imageManagerDeployImage
4347
+ * @roles admin
4348
+ * @task true
4349
+ */
4350
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4351
+ imageManagerDeployImage(body, callback) {
4352
+ const meth = 'adapter-imageManagerDeployImage';
4353
+ const origin = `${this.id}-${meth}`;
4354
+ log.trace(origin);
4355
+
4356
+ if (this.suspended && this.suspendMode === 'error') {
4357
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4358
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4359
+ return callback(null, errorObj);
4360
+ }
4361
+
4362
+ /* HERE IS WHERE YOU VALIDATE DATA */
4363
+ if (body === undefined || body === null || body === '') {
4364
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4365
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4366
+ return callback(null, errorObj);
4367
+ }
4368
+
4369
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4370
+ const queryParamsAvailable = {};
4371
+ const queryParams = {};
4372
+ const pathVars = [];
4373
+ const bodyVars = body;
4374
+
4375
+ // loop in template. long callback arg name to avoid identifier conflicts
4376
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4377
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4378
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4379
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4380
+ }
4381
+ });
4382
+
4383
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4384
+ // see adapter code documentation for more information on the request object's fields
4385
+ const reqObj = {
4386
+ payload: bodyVars,
4387
+ uriPathVars: pathVars,
4388
+ uriQuery: queryParams
4389
+ };
4390
+
4391
+ try {
4392
+ // Make the call -
4393
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4394
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerDeployImage', reqObj, true, (irReturnData, irReturnError) => {
4395
+ // if we received an error or their is no response on the results
4396
+ // return an error
4397
+ if (irReturnError) {
4398
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4399
+ return callback(null, irReturnError);
4400
+ }
4401
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4402
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerDeployImage'], null, null, null);
4403
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4404
+ return callback(null, errorObj);
4405
+ }
4406
+
4407
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4408
+ // return the response
4409
+ return callback(irReturnData, null);
4410
+ });
4411
+ } catch (ex) {
4412
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4413
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4414
+ return callback(null, errorObj);
4415
+ }
4416
+ }
4417
+
4418
+ /**
4419
+ * @function imageManagerUploadImageURL
4420
+ * @pronghornType method
4421
+ * @name imageManagerUploadImageURL
4422
+ * @summary UploadImageURL
4423
+ *
4424
+ * @param {object} body - body param
4425
+ * @param {getCallback} callback - a callback function to return the result
4426
+ * @return {object} results - An object containing the response of the action
4427
+ *
4428
+ * @route {POST} /imageManagerUploadImageURL
4429
+ * @roles admin
4430
+ * @task true
4431
+ */
4432
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4433
+ imageManagerUploadImageURL(body, callback) {
4434
+ const meth = 'adapter-imageManagerUploadImageURL';
4435
+ const origin = `${this.id}-${meth}`;
4436
+ log.trace(origin);
4437
+
4438
+ if (this.suspended && this.suspendMode === 'error') {
4439
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4440
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4441
+ return callback(null, errorObj);
4442
+ }
4443
+
4444
+ /* HERE IS WHERE YOU VALIDATE DATA */
4445
+ if (body === undefined || body === null || body === '') {
4446
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4447
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4448
+ return callback(null, errorObj);
4449
+ }
4450
+
4451
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4452
+ const queryParamsAvailable = {};
4453
+ const queryParams = {};
4454
+ const pathVars = [];
4455
+ const bodyVars = body;
4456
+
4457
+ // loop in template. long callback arg name to avoid identifier conflicts
4458
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4459
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4460
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4461
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4462
+ }
4463
+ });
4464
+
4465
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4466
+ // see adapter code documentation for more information on the request object's fields
4467
+ const reqObj = {
4468
+ payload: bodyVars,
4469
+ uriPathVars: pathVars,
4470
+ uriQuery: queryParams
4471
+ };
4472
+
4473
+ try {
4474
+ // Make the call -
4475
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4476
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerUploadImageURL', reqObj, true, (irReturnData, irReturnError) => {
4477
+ // if we received an error or their is no response on the results
4478
+ // return an error
4479
+ if (irReturnError) {
4480
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4481
+ return callback(null, irReturnError);
4482
+ }
4483
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4484
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerUploadImageURL'], null, null, null);
4485
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4486
+ return callback(null, errorObj);
4487
+ }
4488
+
4489
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4490
+ // return the response
4491
+ return callback(irReturnData, null);
4492
+ });
4493
+ } catch (ex) {
4494
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4495
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4496
+ return callback(null, errorObj);
4497
+ }
4498
+ }
4499
+
4500
+ /**
4501
+ * @function imageManagerDeployLocalCertificate
4502
+ * @pronghornType method
4503
+ * @name imageManagerDeployLocalCertificate
4504
+ * @summary DeployLocalCertificate
4505
+ *
4506
+ * @param {object} body - body param
4507
+ * @param {getCallback} callback - a callback function to return the result
4508
+ * @return {object} results - An object containing the response of the action
4509
+ *
4510
+ * @route {POST} /imageManagerDeployLocalCertificate
4511
+ * @roles admin
4512
+ * @task true
4513
+ */
4514
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4515
+ imageManagerDeployLocalCertificate(body, callback) {
4516
+ const meth = 'adapter-imageManagerDeployLocalCertificate';
4517
+ const origin = `${this.id}-${meth}`;
4518
+ log.trace(origin);
4519
+
4520
+ if (this.suspended && this.suspendMode === 'error') {
4521
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4522
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4523
+ return callback(null, errorObj);
4524
+ }
4525
+
4526
+ /* HERE IS WHERE YOU VALIDATE DATA */
4527
+ if (body === undefined || body === null || body === '') {
4528
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4529
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4530
+ return callback(null, errorObj);
4531
+ }
4532
+
4533
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4534
+ const queryParamsAvailable = {};
4535
+ const queryParams = {};
4536
+ const pathVars = [];
4537
+ const bodyVars = body;
4538
+
4539
+ // loop in template. long callback arg name to avoid identifier conflicts
4540
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4541
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4542
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4543
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4544
+ }
4545
+ });
4546
+
4547
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4548
+ // see adapter code documentation for more information on the request object's fields
4549
+ const reqObj = {
4550
+ payload: bodyVars,
4551
+ uriPathVars: pathVars,
4552
+ uriQuery: queryParams
4553
+ };
4554
+
4555
+ try {
4556
+ // Make the call -
4557
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4558
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerDeployLocalCertificate', reqObj, true, (irReturnData, irReturnError) => {
4559
+ // if we received an error or their is no response on the results
4560
+ // return an error
4561
+ if (irReturnError) {
4562
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4563
+ return callback(null, irReturnError);
4564
+ }
4565
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4566
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerDeployLocalCertificate'], null, null, null);
4567
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4568
+ return callback(null, errorObj);
4569
+ }
4570
+
4571
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4572
+ // return the response
4573
+ return callback(irReturnData, null);
4574
+ });
4575
+ } catch (ex) {
4576
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4577
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4578
+ return callback(null, errorObj);
4579
+ }
4580
+ }
4581
+
4582
+ /**
4583
+ * @function imageManagerStageImage
4584
+ * @pronghornType method
4585
+ * @name imageManagerStageImage
4586
+ * @summary StateImage
4587
+ *
4588
+ * @param {object} body - body param
4589
+ * @param {getCallback} callback - a callback function to return the result
4590
+ * @return {object} results - An object containing the response of the action
4591
+ *
4592
+ * @route {POST} /imageManagerStageImage
4593
+ * @roles admin
4594
+ * @task true
4595
+ */
4596
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
4597
+ imageManagerStageImage(body, callback) {
4598
+ const meth = 'adapter-imageManagerStageImage';
4599
+ const origin = `${this.id}-${meth}`;
4600
+ log.trace(origin);
4601
+
4602
+ if (this.suspended && this.suspendMode === 'error') {
4603
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
4604
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4605
+ return callback(null, errorObj);
4606
+ }
4607
+
4608
+ /* HERE IS WHERE YOU VALIDATE DATA */
4609
+ if (body === undefined || body === null || body === '') {
4610
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
4611
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4612
+ return callback(null, errorObj);
4613
+ }
4614
+
4615
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
4616
+ const queryParamsAvailable = {};
4617
+ const queryParams = {};
4618
+ const pathVars = [];
4619
+ const bodyVars = body;
4620
+
4621
+ // loop in template. long callback arg name to avoid identifier conflicts
4622
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
4623
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
4624
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
4625
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
4626
+ }
4627
+ });
4628
+
4629
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
4630
+ // see adapter code documentation for more information on the request object's fields
4631
+ const reqObj = {
4632
+ payload: bodyVars,
4633
+ uriPathVars: pathVars,
4634
+ uriQuery: queryParams
4635
+ };
4636
+
4637
+ try {
4638
+ // Make the call -
4639
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
4640
+ return this.requestHandlerInst.identifyRequest('ImageManager', 'imageManagerStageImage', reqObj, true, (irReturnData, irReturnError) => {
4641
+ // if we received an error or their is no response on the results
4642
+ // return an error
4643
+ if (irReturnError) {
4644
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
4645
+ return callback(null, irReturnError);
4646
+ }
4647
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
4648
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['imageManagerStageImage'], null, null, null);
4649
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4650
+ return callback(null, errorObj);
4651
+ }
4652
+
4653
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
4654
+ // return the response
4655
+ return callback(irReturnData, null);
4656
+ });
4657
+ } catch (ex) {
4658
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
4659
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
4660
+ return callback(null, errorObj);
4661
+ }
4662
+ }
4663
+ }
4664
+
4665
+ module.exports = ParagonDpm;