@itentialopensource/adapter-paragon_job_store 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 +3927 -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/JobstoreManager/action.json +24 -0
  33. package/entities/JobstoreManager/schema.json +19 -0
  34. package/entities/JobstoreService/action.json +714 -0
  35. package/entities/JobstoreService/schema.json +306 -0
  36. package/error.json +190 -0
  37. package/package.json +89 -0
  38. package/pronghorn.json +6409 -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 +405 -0
  43. package/report/paragon-job-store.json +4333 -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 +2354 -0
  48. package/test/unit/adapterBaseTestUnit.js +949 -0
  49. package/test/unit/adapterTestUnit.js +2355 -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,3927 @@
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_job_store
17
+ */
18
+
19
+ /* GENERAL ADAPTER FUNCTIONS */
20
+ class ParagonJobStore extends AdapterBaseCl {
21
+ /**
22
+ * ParagonJobStore 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 jobstoreServiceUpdateJob
846
+ * @pronghornType method
847
+ * @name jobstoreServiceUpdateJob
848
+ * @summary Update job by ID
849
+ *
850
+ * @param {string} iD - iD param
851
+ * @param {object} body - body param
852
+ * @param {getCallback} callback - a callback function to return the result
853
+ * @return {object} results - An object containing the response of the action
854
+ *
855
+ * @route {POST} /jobstoreServiceUpdateJob
856
+ * @roles admin
857
+ * @task true
858
+ */
859
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
860
+ jobstoreServiceUpdateJob(iD, body, callback) {
861
+ const meth = 'adapter-jobstoreServiceUpdateJob';
862
+ const origin = `${this.id}-${meth}`;
863
+ log.trace(origin);
864
+
865
+ if (this.suspended && this.suspendMode === 'error') {
866
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
867
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
868
+ return callback(null, errorObj);
869
+ }
870
+
871
+ /* HERE IS WHERE YOU VALIDATE DATA */
872
+ if (iD === undefined || iD === null || iD === '') {
873
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
874
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
875
+ return callback(null, errorObj);
876
+ }
877
+ if (body === undefined || body === null || body === '') {
878
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
879
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
880
+ return callback(null, errorObj);
881
+ }
882
+
883
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
884
+ const queryParamsAvailable = {};
885
+ const queryParams = {};
886
+ const pathVars = [iD];
887
+ const bodyVars = body;
888
+
889
+ // loop in template. long callback arg name to avoid identifier conflicts
890
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
891
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
892
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
893
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
894
+ }
895
+ });
896
+
897
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
898
+ // see adapter code documentation for more information on the request object's fields
899
+ const reqObj = {
900
+ payload: bodyVars,
901
+ uriPathVars: pathVars,
902
+ uriQuery: queryParams
903
+ };
904
+
905
+ try {
906
+ // Make the call -
907
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
908
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceUpdateJob', reqObj, false, (irReturnData, irReturnError) => {
909
+ // if we received an error or their is no response on the results
910
+ // return an error
911
+ if (irReturnError) {
912
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
913
+ return callback(null, irReturnError);
914
+ }
915
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
916
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceUpdateJob'], null, null, null);
917
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
918
+ return callback(null, errorObj);
919
+ }
920
+
921
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
922
+ // return the response
923
+ return callback(irReturnData, null);
924
+ });
925
+ } catch (ex) {
926
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
927
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
928
+ return callback(null, errorObj);
929
+ }
930
+ }
931
+
932
+ /**
933
+ * @function jobstoreServiceGetJob
934
+ * @pronghornType method
935
+ * @name jobstoreServiceGetJob
936
+ * @summary Get job by ID
937
+ *
938
+ * @param {string} iD - iD param
939
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
940
+ * @param {array} [fields] - limit displayed fields.
941
+ * @param {array} [refFields] - limit displayed reference fields.
942
+ * @param {getCallback} callback - a callback function to return the result
943
+ * @return {object} results - An object containing the response of the action
944
+ *
945
+ * @route {POST} /jobstoreServiceGetJob
946
+ * @roles admin
947
+ * @task true
948
+ */
949
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
950
+ jobstoreServiceGetJob(iD, detail, fields, refFields, callback) {
951
+ const meth = 'adapter-jobstoreServiceGetJob';
952
+ const origin = `${this.id}-${meth}`;
953
+ log.trace(origin);
954
+
955
+ if (this.suspended && this.suspendMode === 'error') {
956
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
957
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
958
+ return callback(null, errorObj);
959
+ }
960
+
961
+ /* HERE IS WHERE YOU VALIDATE DATA */
962
+ if (iD === undefined || iD === null || iD === '') {
963
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
964
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
965
+ return callback(null, errorObj);
966
+ }
967
+
968
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
969
+ const queryParamsAvailable = { detail, fields, refFields };
970
+ const queryParams = {};
971
+ const pathVars = [iD];
972
+ const bodyVars = {};
973
+
974
+ // loop in template. long callback arg name to avoid identifier conflicts
975
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
976
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
977
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
978
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
979
+ }
980
+ });
981
+
982
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
983
+ // see adapter code documentation for more information on the request object's fields
984
+ const reqObj = {
985
+ payload: bodyVars,
986
+ uriPathVars: pathVars,
987
+ uriQuery: queryParams
988
+ };
989
+
990
+ try {
991
+ // Make the call -
992
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
993
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceGetJob', reqObj, true, (irReturnData, irReturnError) => {
994
+ // if we received an error or their is no response on the results
995
+ // return an error
996
+ if (irReturnError) {
997
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
998
+ return callback(null, irReturnError);
999
+ }
1000
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1001
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceGetJob'], null, null, null);
1002
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1003
+ return callback(null, errorObj);
1004
+ }
1005
+
1006
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1007
+ // return the response
1008
+ return callback(irReturnData, null);
1009
+ });
1010
+ } catch (ex) {
1011
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1012
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1013
+ return callback(null, errorObj);
1014
+ }
1015
+ }
1016
+
1017
+ /**
1018
+ * @function jobstoreServiceDeleteJob
1019
+ * @pronghornType method
1020
+ * @name jobstoreServiceDeleteJob
1021
+ * @summary Delete job by ID
1022
+ *
1023
+ * @param {string} iD - iD param
1024
+ * @param {getCallback} callback - a callback function to return the result
1025
+ * @return {object} results - An object containing the response of the action
1026
+ *
1027
+ * @route {POST} /jobstoreServiceDeleteJob
1028
+ * @roles admin
1029
+ * @task true
1030
+ */
1031
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1032
+ jobstoreServiceDeleteJob(iD, callback) {
1033
+ const meth = 'adapter-jobstoreServiceDeleteJob';
1034
+ const origin = `${this.id}-${meth}`;
1035
+ log.trace(origin);
1036
+
1037
+ if (this.suspended && this.suspendMode === 'error') {
1038
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1039
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1040
+ return callback(null, errorObj);
1041
+ }
1042
+
1043
+ /* HERE IS WHERE YOU VALIDATE DATA */
1044
+ if (iD === undefined || iD === null || iD === '') {
1045
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1046
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1047
+ return callback(null, errorObj);
1048
+ }
1049
+
1050
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1051
+ const queryParamsAvailable = {};
1052
+ const queryParams = {};
1053
+ const pathVars = [iD];
1054
+ const bodyVars = {};
1055
+
1056
+ // loop in template. long callback arg name to avoid identifier conflicts
1057
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1058
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1059
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1060
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1061
+ }
1062
+ });
1063
+
1064
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1065
+ // see adapter code documentation for more information on the request object's fields
1066
+ const reqObj = {
1067
+ payload: bodyVars,
1068
+ uriPathVars: pathVars,
1069
+ uriQuery: queryParams
1070
+ };
1071
+
1072
+ try {
1073
+ // Make the call -
1074
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1075
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceDeleteJob', reqObj, false, (irReturnData, irReturnError) => {
1076
+ // if we received an error or their is no response on the results
1077
+ // return an error
1078
+ if (irReturnError) {
1079
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1080
+ return callback(null, irReturnError);
1081
+ }
1082
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1083
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceDeleteJob'], null, null, null);
1084
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1085
+ return callback(null, errorObj);
1086
+ }
1087
+
1088
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1089
+ // return the response
1090
+ return callback(irReturnData, null);
1091
+ });
1092
+ } catch (ex) {
1093
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1094
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1095
+ return callback(null, errorObj);
1096
+ }
1097
+ }
1098
+
1099
+ /**
1100
+ * @function jobstoreServiceBulkListJob
1101
+ * @pronghornType method
1102
+ * @name jobstoreServiceBulkListJob
1103
+ * @summary Bulk list jobs
1104
+ *
1105
+ * @param {object} body - body param
1106
+ * @param {getCallback} callback - a callback function to return the result
1107
+ * @return {object} results - An object containing the response of the action
1108
+ *
1109
+ * @route {POST} /jobstoreServiceBulkListJob
1110
+ * @roles admin
1111
+ * @task true
1112
+ */
1113
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1114
+ jobstoreServiceBulkListJob(body, callback) {
1115
+ const meth = 'adapter-jobstoreServiceBulkListJob';
1116
+ const origin = `${this.id}-${meth}`;
1117
+ log.trace(origin);
1118
+
1119
+ if (this.suspended && this.suspendMode === 'error') {
1120
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1121
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1122
+ return callback(null, errorObj);
1123
+ }
1124
+
1125
+ /* HERE IS WHERE YOU VALIDATE DATA */
1126
+ if (body === undefined || body === null || body === '') {
1127
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1128
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1129
+ return callback(null, errorObj);
1130
+ }
1131
+
1132
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1133
+ const queryParamsAvailable = {};
1134
+ const queryParams = {};
1135
+ const pathVars = [];
1136
+ const bodyVars = body;
1137
+
1138
+ // loop in template. long callback arg name to avoid identifier conflicts
1139
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1140
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1141
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1142
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1143
+ }
1144
+ });
1145
+
1146
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1147
+ // see adapter code documentation for more information on the request object's fields
1148
+ const reqObj = {
1149
+ payload: bodyVars,
1150
+ uriPathVars: pathVars,
1151
+ uriQuery: queryParams
1152
+ };
1153
+
1154
+ try {
1155
+ // Make the call -
1156
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1157
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceBulkListJob', reqObj, true, (irReturnData, irReturnError) => {
1158
+ // if we received an error or their is no response on the results
1159
+ // return an error
1160
+ if (irReturnError) {
1161
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1162
+ return callback(null, irReturnError);
1163
+ }
1164
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1165
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceBulkListJob'], null, null, null);
1166
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1167
+ return callback(null, errorObj);
1168
+ }
1169
+
1170
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1171
+ // return the response
1172
+ return callback(irReturnData, null);
1173
+ });
1174
+ } catch (ex) {
1175
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1176
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1177
+ return callback(null, errorObj);
1178
+ }
1179
+ }
1180
+
1181
+ /**
1182
+ * @function jobstoreServiceBulkExtRefUpdate
1183
+ * @pronghornType method
1184
+ * @name jobstoreServiceBulkExtRefUpdate
1185
+ * @summary Bulk external reference updates
1186
+ *
1187
+ * @param {object} body - body param
1188
+ * @param {getCallback} callback - a callback function to return the result
1189
+ * @return {object} results - An object containing the response of the action
1190
+ *
1191
+ * @route {POST} /jobstoreServiceBulkExtRefUpdate
1192
+ * @roles admin
1193
+ * @task true
1194
+ */
1195
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1196
+ jobstoreServiceBulkExtRefUpdate(body, callback) {
1197
+ const meth = 'adapter-jobstoreServiceBulkExtRefUpdate';
1198
+ const origin = `${this.id}-${meth}`;
1199
+ log.trace(origin);
1200
+
1201
+ if (this.suspended && this.suspendMode === 'error') {
1202
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1203
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1204
+ return callback(null, errorObj);
1205
+ }
1206
+
1207
+ /* HERE IS WHERE YOU VALIDATE DATA */
1208
+ if (body === undefined || body === null || body === '') {
1209
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1210
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1211
+ return callback(null, errorObj);
1212
+ }
1213
+
1214
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1215
+ const queryParamsAvailable = {};
1216
+ const queryParams = {};
1217
+ const pathVars = [];
1218
+ const bodyVars = body;
1219
+
1220
+ // loop in template. long callback arg name to avoid identifier conflicts
1221
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1222
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1223
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1224
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1225
+ }
1226
+ });
1227
+
1228
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1229
+ // see adapter code documentation for more information on the request object's fields
1230
+ const reqObj = {
1231
+ payload: bodyVars,
1232
+ uriPathVars: pathVars,
1233
+ uriQuery: queryParams
1234
+ };
1235
+
1236
+ try {
1237
+ // Make the call -
1238
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1239
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceBulkExtRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
1240
+ // if we received an error or their is no response on the results
1241
+ // return an error
1242
+ if (irReturnError) {
1243
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1244
+ return callback(null, irReturnError);
1245
+ }
1246
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1247
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceBulkExtRefUpdate'], null, null, null);
1248
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1249
+ return callback(null, errorObj);
1250
+ }
1251
+
1252
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1253
+ // return the response
1254
+ return callback(irReturnData, null);
1255
+ });
1256
+ } catch (ex) {
1257
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1258
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1259
+ return callback(null, errorObj);
1260
+ }
1261
+ }
1262
+
1263
+ /**
1264
+ * @function jobstoreServiceBulkRefUpdate
1265
+ * @pronghornType method
1266
+ * @name jobstoreServiceBulkRefUpdate
1267
+ * @summary Bulk reference updates
1268
+ *
1269
+ * @param {object} body - body param
1270
+ * @param {getCallback} callback - a callback function to return the result
1271
+ * @return {object} results - An object containing the response of the action
1272
+ *
1273
+ * @route {POST} /jobstoreServiceBulkRefUpdate
1274
+ * @roles admin
1275
+ * @task true
1276
+ */
1277
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1278
+ jobstoreServiceBulkRefUpdate(body, callback) {
1279
+ const meth = 'adapter-jobstoreServiceBulkRefUpdate';
1280
+ const origin = `${this.id}-${meth}`;
1281
+ log.trace(origin);
1282
+
1283
+ if (this.suspended && this.suspendMode === 'error') {
1284
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1285
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1286
+ return callback(null, errorObj);
1287
+ }
1288
+
1289
+ /* HERE IS WHERE YOU VALIDATE DATA */
1290
+ if (body === undefined || body === null || body === '') {
1291
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1292
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1293
+ return callback(null, errorObj);
1294
+ }
1295
+
1296
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1297
+ const queryParamsAvailable = {};
1298
+ const queryParams = {};
1299
+ const pathVars = [];
1300
+ const bodyVars = body;
1301
+
1302
+ // loop in template. long callback arg name to avoid identifier conflicts
1303
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1304
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1305
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1306
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1307
+ }
1308
+ });
1309
+
1310
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1311
+ // see adapter code documentation for more information on the request object's fields
1312
+ const reqObj = {
1313
+ payload: bodyVars,
1314
+ uriPathVars: pathVars,
1315
+ uriQuery: queryParams
1316
+ };
1317
+
1318
+ try {
1319
+ // Make the call -
1320
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1321
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceBulkRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
1322
+ // if we received an error or their is no response on the results
1323
+ // return an error
1324
+ if (irReturnError) {
1325
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1326
+ return callback(null, irReturnError);
1327
+ }
1328
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1329
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceBulkRefUpdate'], null, null, null);
1330
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1331
+ return callback(null, errorObj);
1332
+ }
1333
+
1334
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1335
+ // return the response
1336
+ return callback(irReturnData, null);
1337
+ });
1338
+ } catch (ex) {
1339
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1340
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1341
+ return callback(null, errorObj);
1342
+ }
1343
+ }
1344
+
1345
+ /**
1346
+ * @function jobstoreServiceBulkListJobPurgePolicy
1347
+ * @pronghornType method
1348
+ * @name jobstoreServiceBulkListJobPurgePolicy
1349
+ * @summary Bulk list job-purge-policys
1350
+ *
1351
+ * @param {object} body - body param
1352
+ * @param {getCallback} callback - a callback function to return the result
1353
+ * @return {object} results - An object containing the response of the action
1354
+ *
1355
+ * @route {POST} /jobstoreServiceBulkListJobPurgePolicy
1356
+ * @roles admin
1357
+ * @task true
1358
+ */
1359
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1360
+ jobstoreServiceBulkListJobPurgePolicy(body, callback) {
1361
+ const meth = 'adapter-jobstoreServiceBulkListJobPurgePolicy';
1362
+ const origin = `${this.id}-${meth}`;
1363
+ log.trace(origin);
1364
+
1365
+ if (this.suspended && this.suspendMode === 'error') {
1366
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1367
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1368
+ return callback(null, errorObj);
1369
+ }
1370
+
1371
+ /* HERE IS WHERE YOU VALIDATE DATA */
1372
+ if (body === undefined || body === null || body === '') {
1373
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1374
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1375
+ return callback(null, errorObj);
1376
+ }
1377
+
1378
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1379
+ const queryParamsAvailable = {};
1380
+ const queryParams = {};
1381
+ const pathVars = [];
1382
+ const bodyVars = body;
1383
+
1384
+ // loop in template. long callback arg name to avoid identifier conflicts
1385
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1386
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1387
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1388
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1389
+ }
1390
+ });
1391
+
1392
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1393
+ // see adapter code documentation for more information on the request object's fields
1394
+ const reqObj = {
1395
+ payload: bodyVars,
1396
+ uriPathVars: pathVars,
1397
+ uriQuery: queryParams
1398
+ };
1399
+
1400
+ try {
1401
+ // Make the call -
1402
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1403
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceBulkListJobPurgePolicy', reqObj, true, (irReturnData, irReturnError) => {
1404
+ // if we received an error or their is no response on the results
1405
+ // return an error
1406
+ if (irReturnError) {
1407
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1408
+ return callback(null, irReturnError);
1409
+ }
1410
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1411
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceBulkListJobPurgePolicy'], null, null, null);
1412
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1413
+ return callback(null, errorObj);
1414
+ }
1415
+
1416
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1417
+ // return the response
1418
+ return callback(irReturnData, null);
1419
+ });
1420
+ } catch (ex) {
1421
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1422
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1423
+ return callback(null, errorObj);
1424
+ }
1425
+ }
1426
+
1427
+ /**
1428
+ * @function jobstoreServiceUpdateLastPublishedNotification
1429
+ * @pronghornType method
1430
+ * @name jobstoreServiceUpdateLastPublishedNotification
1431
+ * @summary Update last-published-notification by ID
1432
+ *
1433
+ * @param {string} iD - iD param
1434
+ * @param {object} body - body param
1435
+ * @param {getCallback} callback - a callback function to return the result
1436
+ * @return {object} results - An object containing the response of the action
1437
+ *
1438
+ * @route {POST} /jobstoreServiceUpdateLastPublishedNotification
1439
+ * @roles admin
1440
+ * @task true
1441
+ */
1442
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1443
+ jobstoreServiceUpdateLastPublishedNotification(iD, body, callback) {
1444
+ const meth = 'adapter-jobstoreServiceUpdateLastPublishedNotification';
1445
+ const origin = `${this.id}-${meth}`;
1446
+ log.trace(origin);
1447
+
1448
+ if (this.suspended && this.suspendMode === 'error') {
1449
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1450
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1451
+ return callback(null, errorObj);
1452
+ }
1453
+
1454
+ /* HERE IS WHERE YOU VALIDATE DATA */
1455
+ if (iD === undefined || iD === null || iD === '') {
1456
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1457
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1458
+ return callback(null, errorObj);
1459
+ }
1460
+ if (body === undefined || body === null || body === '') {
1461
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1462
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1463
+ return callback(null, errorObj);
1464
+ }
1465
+
1466
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1467
+ const queryParamsAvailable = {};
1468
+ const queryParams = {};
1469
+ const pathVars = [iD];
1470
+ const bodyVars = body;
1471
+
1472
+ // loop in template. long callback arg name to avoid identifier conflicts
1473
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1474
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1475
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1476
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1477
+ }
1478
+ });
1479
+
1480
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1481
+ // see adapter code documentation for more information on the request object's fields
1482
+ const reqObj = {
1483
+ payload: bodyVars,
1484
+ uriPathVars: pathVars,
1485
+ uriQuery: queryParams
1486
+ };
1487
+
1488
+ try {
1489
+ // Make the call -
1490
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1491
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceUpdateLastPublishedNotification', reqObj, false, (irReturnData, irReturnError) => {
1492
+ // if we received an error or their is no response on the results
1493
+ // return an error
1494
+ if (irReturnError) {
1495
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1496
+ return callback(null, irReturnError);
1497
+ }
1498
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1499
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceUpdateLastPublishedNotification'], null, null, null);
1500
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1501
+ return callback(null, errorObj);
1502
+ }
1503
+
1504
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1505
+ // return the response
1506
+ return callback(irReturnData, null);
1507
+ });
1508
+ } catch (ex) {
1509
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1510
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1511
+ return callback(null, errorObj);
1512
+ }
1513
+ }
1514
+
1515
+ /**
1516
+ * @function jobstoreServiceGetLastPublishedNotification
1517
+ * @pronghornType method
1518
+ * @name jobstoreServiceGetLastPublishedNotification
1519
+ * @summary Get last-published-notification by ID
1520
+ *
1521
+ * @param {string} iD - iD param
1522
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
1523
+ * @param {array} [fields] - limit displayed fields.
1524
+ * @param {array} [refFields] - limit displayed reference fields.
1525
+ * @param {getCallback} callback - a callback function to return the result
1526
+ * @return {object} results - An object containing the response of the action
1527
+ *
1528
+ * @route {POST} /jobstoreServiceGetLastPublishedNotification
1529
+ * @roles admin
1530
+ * @task true
1531
+ */
1532
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1533
+ jobstoreServiceGetLastPublishedNotification(iD, detail, fields, refFields, callback) {
1534
+ const meth = 'adapter-jobstoreServiceGetLastPublishedNotification';
1535
+ const origin = `${this.id}-${meth}`;
1536
+ log.trace(origin);
1537
+
1538
+ if (this.suspended && this.suspendMode === 'error') {
1539
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1540
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1541
+ return callback(null, errorObj);
1542
+ }
1543
+
1544
+ /* HERE IS WHERE YOU VALIDATE DATA */
1545
+ if (iD === undefined || iD === null || iD === '') {
1546
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1547
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1548
+ return callback(null, errorObj);
1549
+ }
1550
+
1551
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1552
+ const queryParamsAvailable = { detail, fields, refFields };
1553
+ const queryParams = {};
1554
+ const pathVars = [iD];
1555
+ const bodyVars = {};
1556
+
1557
+ // loop in template. long callback arg name to avoid identifier conflicts
1558
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1559
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1560
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1561
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1562
+ }
1563
+ });
1564
+
1565
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1566
+ // see adapter code documentation for more information on the request object's fields
1567
+ const reqObj = {
1568
+ payload: bodyVars,
1569
+ uriPathVars: pathVars,
1570
+ uriQuery: queryParams
1571
+ };
1572
+
1573
+ try {
1574
+ // Make the call -
1575
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1576
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceGetLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
1577
+ // if we received an error or their is no response on the results
1578
+ // return an error
1579
+ if (irReturnError) {
1580
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1581
+ return callback(null, irReturnError);
1582
+ }
1583
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1584
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceGetLastPublishedNotification'], null, null, null);
1585
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1586
+ return callback(null, errorObj);
1587
+ }
1588
+
1589
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1590
+ // return the response
1591
+ return callback(irReturnData, null);
1592
+ });
1593
+ } catch (ex) {
1594
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1595
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1596
+ return callback(null, errorObj);
1597
+ }
1598
+ }
1599
+
1600
+ /**
1601
+ * @function jobstoreServiceDeleteLastPublishedNotification
1602
+ * @pronghornType method
1603
+ * @name jobstoreServiceDeleteLastPublishedNotification
1604
+ * @summary Delete last-published-notification by ID
1605
+ *
1606
+ * @param {string} iD - iD param
1607
+ * @param {getCallback} callback - a callback function to return the result
1608
+ * @return {object} results - An object containing the response of the action
1609
+ *
1610
+ * @route {POST} /jobstoreServiceDeleteLastPublishedNotification
1611
+ * @roles admin
1612
+ * @task true
1613
+ */
1614
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1615
+ jobstoreServiceDeleteLastPublishedNotification(iD, callback) {
1616
+ const meth = 'adapter-jobstoreServiceDeleteLastPublishedNotification';
1617
+ const origin = `${this.id}-${meth}`;
1618
+ log.trace(origin);
1619
+
1620
+ if (this.suspended && this.suspendMode === 'error') {
1621
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1622
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1623
+ return callback(null, errorObj);
1624
+ }
1625
+
1626
+ /* HERE IS WHERE YOU VALIDATE DATA */
1627
+ if (iD === undefined || iD === null || iD === '') {
1628
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
1629
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1630
+ return callback(null, errorObj);
1631
+ }
1632
+
1633
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1634
+ const queryParamsAvailable = {};
1635
+ const queryParams = {};
1636
+ const pathVars = [iD];
1637
+ const bodyVars = {};
1638
+
1639
+ // loop in template. long callback arg name to avoid identifier conflicts
1640
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1641
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1642
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1643
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1644
+ }
1645
+ });
1646
+
1647
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1648
+ // see adapter code documentation for more information on the request object's fields
1649
+ const reqObj = {
1650
+ payload: bodyVars,
1651
+ uriPathVars: pathVars,
1652
+ uriQuery: queryParams
1653
+ };
1654
+
1655
+ try {
1656
+ // Make the call -
1657
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1658
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceDeleteLastPublishedNotification', reqObj, false, (irReturnData, irReturnError) => {
1659
+ // if we received an error or their is no response on the results
1660
+ // return an error
1661
+ if (irReturnError) {
1662
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1663
+ return callback(null, irReturnError);
1664
+ }
1665
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1666
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceDeleteLastPublishedNotification'], null, null, null);
1667
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1668
+ return callback(null, errorObj);
1669
+ }
1670
+
1671
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1672
+ // return the response
1673
+ return callback(irReturnData, null);
1674
+ });
1675
+ } catch (ex) {
1676
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1677
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1678
+ return callback(null, errorObj);
1679
+ }
1680
+ }
1681
+
1682
+ /**
1683
+ * @function jobstoreServiceBulkListTask
1684
+ * @pronghornType method
1685
+ * @name jobstoreServiceBulkListTask
1686
+ * @summary Bulk list tasks
1687
+ *
1688
+ * @param {object} body - body param
1689
+ * @param {getCallback} callback - a callback function to return the result
1690
+ * @return {object} results - An object containing the response of the action
1691
+ *
1692
+ * @route {POST} /jobstoreServiceBulkListTask
1693
+ * @roles admin
1694
+ * @task true
1695
+ */
1696
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1697
+ jobstoreServiceBulkListTask(body, callback) {
1698
+ const meth = 'adapter-jobstoreServiceBulkListTask';
1699
+ const origin = `${this.id}-${meth}`;
1700
+ log.trace(origin);
1701
+
1702
+ if (this.suspended && this.suspendMode === 'error') {
1703
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1704
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1705
+ return callback(null, errorObj);
1706
+ }
1707
+
1708
+ /* HERE IS WHERE YOU VALIDATE DATA */
1709
+ if (body === undefined || body === null || body === '') {
1710
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1711
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1712
+ return callback(null, errorObj);
1713
+ }
1714
+
1715
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1716
+ const queryParamsAvailable = {};
1717
+ const queryParams = {};
1718
+ const pathVars = [];
1719
+ const bodyVars = body;
1720
+
1721
+ // loop in template. long callback arg name to avoid identifier conflicts
1722
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1723
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1724
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1725
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1726
+ }
1727
+ });
1728
+
1729
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1730
+ // see adapter code documentation for more information on the request object's fields
1731
+ const reqObj = {
1732
+ payload: bodyVars,
1733
+ uriPathVars: pathVars,
1734
+ uriQuery: queryParams
1735
+ };
1736
+
1737
+ try {
1738
+ // Make the call -
1739
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1740
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceBulkListTask', reqObj, true, (irReturnData, irReturnError) => {
1741
+ // if we received an error or their is no response on the results
1742
+ // return an error
1743
+ if (irReturnError) {
1744
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1745
+ return callback(null, irReturnError);
1746
+ }
1747
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1748
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceBulkListTask'], null, null, null);
1749
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1750
+ return callback(null, errorObj);
1751
+ }
1752
+
1753
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1754
+ // return the response
1755
+ return callback(irReturnData, null);
1756
+ });
1757
+ } catch (ex) {
1758
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1759
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1760
+ return callback(null, errorObj);
1761
+ }
1762
+ }
1763
+
1764
+ /**
1765
+ * @function jobstoreServiceCreateLastPublishedNotification
1766
+ * @pronghornType method
1767
+ * @name jobstoreServiceCreateLastPublishedNotification
1768
+ * @summary Create last-published-notification
1769
+ *
1770
+ * @param {object} body - body param
1771
+ * @param {getCallback} callback - a callback function to return the result
1772
+ * @return {object} results - An object containing the response of the action
1773
+ *
1774
+ * @route {POST} /jobstoreServiceCreateLastPublishedNotification
1775
+ * @roles admin
1776
+ * @task true
1777
+ */
1778
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1779
+ jobstoreServiceCreateLastPublishedNotification(body, callback) {
1780
+ const meth = 'adapter-jobstoreServiceCreateLastPublishedNotification';
1781
+ const origin = `${this.id}-${meth}`;
1782
+ log.trace(origin);
1783
+
1784
+ if (this.suspended && this.suspendMode === 'error') {
1785
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1786
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1787
+ return callback(null, errorObj);
1788
+ }
1789
+
1790
+ /* HERE IS WHERE YOU VALIDATE DATA */
1791
+ if (body === undefined || body === null || body === '') {
1792
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1793
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1794
+ return callback(null, errorObj);
1795
+ }
1796
+
1797
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1798
+ const queryParamsAvailable = {};
1799
+ const queryParams = {};
1800
+ const pathVars = [];
1801
+ const bodyVars = body;
1802
+
1803
+ // loop in template. long callback arg name to avoid identifier conflicts
1804
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1805
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1806
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1807
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1808
+ }
1809
+ });
1810
+
1811
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1812
+ // see adapter code documentation for more information on the request object's fields
1813
+ const reqObj = {
1814
+ payload: bodyVars,
1815
+ uriPathVars: pathVars,
1816
+ uriQuery: queryParams
1817
+ };
1818
+
1819
+ try {
1820
+ // Make the call -
1821
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1822
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceCreateLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
1823
+ // if we received an error or their is no response on the results
1824
+ // return an error
1825
+ if (irReturnError) {
1826
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1827
+ return callback(null, irReturnError);
1828
+ }
1829
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1830
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceCreateLastPublishedNotification'], null, null, null);
1831
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1832
+ return callback(null, errorObj);
1833
+ }
1834
+
1835
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1836
+ // return the response
1837
+ return callback(irReturnData, null);
1838
+ });
1839
+ } catch (ex) {
1840
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1841
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1842
+ return callback(null, errorObj);
1843
+ }
1844
+ }
1845
+
1846
+ /**
1847
+ * @function jobstoreServiceListLastPublishedNotification
1848
+ * @pronghornType method
1849
+ * @name jobstoreServiceListLastPublishedNotification
1850
+ * @summary List last-published-notifications
1851
+ *
1852
+ * @param {string} [specSize] - Number of items expected to be returned.
1853
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
1854
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
1855
+ * @param {boolean} [specCount] - specCount param
1856
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
1857
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
1858
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
1859
+ * @param {string} [specParentType] - Filter by parent type.
1860
+ * @param {array} [specParentId] - Filter by parent UUIDs.
1861
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
1862
+ * @param {array} [specObjUuids] - Filter by UUIDs.
1863
+ * @param {array} [specFields] - limit displayed fields.
1864
+ * @param {array} [specFilters] - QueryFilter in string format.
1865
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
1866
+ introducing new fields which will take string as input.
1867
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
1868
+ * @param {string} [specFrom] - Start from items expected to be returned.
1869
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
1870
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
1871
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
1872
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
1873
+ * @param {array} [specRefFields] - limit displayed reference fields.
1874
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
1875
+ * @param {getCallback} callback - a callback function to return the result
1876
+ * @return {object} results - An object containing the response of the action
1877
+ *
1878
+ * @route {POST} /jobstoreServiceListLastPublishedNotification
1879
+ * @roles admin
1880
+ * @task true
1881
+ */
1882
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1883
+ jobstoreServiceListLastPublishedNotification(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
1884
+ const meth = 'adapter-jobstoreServiceListLastPublishedNotification';
1885
+ const origin = `${this.id}-${meth}`;
1886
+ log.trace(origin);
1887
+
1888
+ if (this.suspended && this.suspendMode === 'error') {
1889
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1890
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1891
+ return callback(null, errorObj);
1892
+ }
1893
+
1894
+ /* HERE IS WHERE YOU VALIDATE DATA */
1895
+
1896
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1897
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
1898
+ const queryParams = {};
1899
+ const pathVars = [];
1900
+ const bodyVars = {};
1901
+
1902
+ // loop in template. long callback arg name to avoid identifier conflicts
1903
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1904
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1905
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1906
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1907
+ }
1908
+ });
1909
+
1910
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1911
+ // see adapter code documentation for more information on the request object's fields
1912
+ const reqObj = {
1913
+ payload: bodyVars,
1914
+ uriPathVars: pathVars,
1915
+ uriQuery: queryParams
1916
+ };
1917
+
1918
+ try {
1919
+ // Make the call -
1920
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
1921
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceListLastPublishedNotification', reqObj, true, (irReturnData, irReturnError) => {
1922
+ // if we received an error or their is no response on the results
1923
+ // return an error
1924
+ if (irReturnError) {
1925
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
1926
+ return callback(null, irReturnError);
1927
+ }
1928
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
1929
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceListLastPublishedNotification'], null, null, null);
1930
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1931
+ return callback(null, errorObj);
1932
+ }
1933
+
1934
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
1935
+ // return the response
1936
+ return callback(irReturnData, null);
1937
+ });
1938
+ } catch (ex) {
1939
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
1940
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1941
+ return callback(null, errorObj);
1942
+ }
1943
+ }
1944
+
1945
+ /**
1946
+ * @function jobstoreServiceCreateJobPurgePolicy
1947
+ * @pronghornType method
1948
+ * @name jobstoreServiceCreateJobPurgePolicy
1949
+ * @summary Create job-purge-policy
1950
+ *
1951
+ * @param {object} body - body param
1952
+ * @param {getCallback} callback - a callback function to return the result
1953
+ * @return {object} results - An object containing the response of the action
1954
+ *
1955
+ * @route {POST} /jobstoreServiceCreateJobPurgePolicy
1956
+ * @roles admin
1957
+ * @task true
1958
+ */
1959
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
1960
+ jobstoreServiceCreateJobPurgePolicy(body, callback) {
1961
+ const meth = 'adapter-jobstoreServiceCreateJobPurgePolicy';
1962
+ const origin = `${this.id}-${meth}`;
1963
+ log.trace(origin);
1964
+
1965
+ if (this.suspended && this.suspendMode === 'error') {
1966
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
1967
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1968
+ return callback(null, errorObj);
1969
+ }
1970
+
1971
+ /* HERE IS WHERE YOU VALIDATE DATA */
1972
+ if (body === undefined || body === null || body === '') {
1973
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
1974
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
1975
+ return callback(null, errorObj);
1976
+ }
1977
+
1978
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
1979
+ const queryParamsAvailable = {};
1980
+ const queryParams = {};
1981
+ const pathVars = [];
1982
+ const bodyVars = body;
1983
+
1984
+ // loop in template. long callback arg name to avoid identifier conflicts
1985
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
1986
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
1987
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
1988
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
1989
+ }
1990
+ });
1991
+
1992
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
1993
+ // see adapter code documentation for more information on the request object's fields
1994
+ const reqObj = {
1995
+ payload: bodyVars,
1996
+ uriPathVars: pathVars,
1997
+ uriQuery: queryParams
1998
+ };
1999
+
2000
+ try {
2001
+ // Make the call -
2002
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2003
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceCreateJobPurgePolicy', reqObj, true, (irReturnData, irReturnError) => {
2004
+ // if we received an error or their is no response on the results
2005
+ // return an error
2006
+ if (irReturnError) {
2007
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2008
+ return callback(null, irReturnError);
2009
+ }
2010
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2011
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceCreateJobPurgePolicy'], null, null, null);
2012
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2013
+ return callback(null, errorObj);
2014
+ }
2015
+
2016
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2017
+ // return the response
2018
+ return callback(irReturnData, null);
2019
+ });
2020
+ } catch (ex) {
2021
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2022
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2023
+ return callback(null, errorObj);
2024
+ }
2025
+ }
2026
+
2027
+ /**
2028
+ * @function jobstoreServiceListJobPurgePolicy
2029
+ * @pronghornType method
2030
+ * @name jobstoreServiceListJobPurgePolicy
2031
+ * @summary List job-purge-policys
2032
+ *
2033
+ * @param {string} [specSize] - Number of items expected to be returned.
2034
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
2035
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
2036
+ * @param {boolean} [specCount] - specCount param
2037
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
2038
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
2039
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
2040
+ * @param {string} [specParentType] - Filter by parent type.
2041
+ * @param {array} [specParentId] - Filter by parent UUIDs.
2042
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
2043
+ * @param {array} [specObjUuids] - Filter by UUIDs.
2044
+ * @param {array} [specFields] - limit displayed fields.
2045
+ * @param {array} [specFilters] - QueryFilter in string format.
2046
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
2047
+ introducing new fields which will take string as input.
2048
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
2049
+ * @param {string} [specFrom] - Start from items expected to be returned.
2050
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
2051
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
2052
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
2053
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
2054
+ * @param {array} [specRefFields] - limit displayed reference fields.
2055
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
2056
+ * @param {getCallback} callback - a callback function to return the result
2057
+ * @return {object} results - An object containing the response of the action
2058
+ *
2059
+ * @route {POST} /jobstoreServiceListJobPurgePolicy
2060
+ * @roles admin
2061
+ * @task true
2062
+ */
2063
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2064
+ jobstoreServiceListJobPurgePolicy(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
2065
+ const meth = 'adapter-jobstoreServiceListJobPurgePolicy';
2066
+ const origin = `${this.id}-${meth}`;
2067
+ log.trace(origin);
2068
+
2069
+ if (this.suspended && this.suspendMode === 'error') {
2070
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2071
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2072
+ return callback(null, errorObj);
2073
+ }
2074
+
2075
+ /* HERE IS WHERE YOU VALIDATE DATA */
2076
+
2077
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2078
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
2079
+ const queryParams = {};
2080
+ const pathVars = [];
2081
+ const bodyVars = {};
2082
+
2083
+ // loop in template. long callback arg name to avoid identifier conflicts
2084
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2085
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2086
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2087
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2088
+ }
2089
+ });
2090
+
2091
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2092
+ // see adapter code documentation for more information on the request object's fields
2093
+ const reqObj = {
2094
+ payload: bodyVars,
2095
+ uriPathVars: pathVars,
2096
+ uriQuery: queryParams
2097
+ };
2098
+
2099
+ try {
2100
+ // Make the call -
2101
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2102
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceListJobPurgePolicy', reqObj, true, (irReturnData, irReturnError) => {
2103
+ // if we received an error or their is no response on the results
2104
+ // return an error
2105
+ if (irReturnError) {
2106
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2107
+ return callback(null, irReturnError);
2108
+ }
2109
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2110
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceListJobPurgePolicy'], null, null, null);
2111
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2112
+ return callback(null, errorObj);
2113
+ }
2114
+
2115
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2116
+ // return the response
2117
+ return callback(irReturnData, null);
2118
+ });
2119
+ } catch (ex) {
2120
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2121
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2122
+ return callback(null, errorObj);
2123
+ }
2124
+ }
2125
+
2126
+ /**
2127
+ * @function jobstoreServiceCreateTask
2128
+ * @pronghornType method
2129
+ * @name jobstoreServiceCreateTask
2130
+ * @summary Create task
2131
+ *
2132
+ * @param {object} body - body param
2133
+ * @param {getCallback} callback - a callback function to return the result
2134
+ * @return {object} results - An object containing the response of the action
2135
+ *
2136
+ * @route {POST} /jobstoreServiceCreateTask
2137
+ * @roles admin
2138
+ * @task true
2139
+ */
2140
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2141
+ jobstoreServiceCreateTask(body, callback) {
2142
+ const meth = 'adapter-jobstoreServiceCreateTask';
2143
+ const origin = `${this.id}-${meth}`;
2144
+ log.trace(origin);
2145
+
2146
+ if (this.suspended && this.suspendMode === 'error') {
2147
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2148
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2149
+ return callback(null, errorObj);
2150
+ }
2151
+
2152
+ /* HERE IS WHERE YOU VALIDATE DATA */
2153
+ if (body === undefined || body === null || body === '') {
2154
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2155
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2156
+ return callback(null, errorObj);
2157
+ }
2158
+
2159
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2160
+ const queryParamsAvailable = {};
2161
+ const queryParams = {};
2162
+ const pathVars = [];
2163
+ const bodyVars = body;
2164
+
2165
+ // loop in template. long callback arg name to avoid identifier conflicts
2166
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2167
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2168
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2169
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2170
+ }
2171
+ });
2172
+
2173
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2174
+ // see adapter code documentation for more information on the request object's fields
2175
+ const reqObj = {
2176
+ payload: bodyVars,
2177
+ uriPathVars: pathVars,
2178
+ uriQuery: queryParams
2179
+ };
2180
+
2181
+ try {
2182
+ // Make the call -
2183
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2184
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceCreateTask', reqObj, true, (irReturnData, irReturnError) => {
2185
+ // if we received an error or their is no response on the results
2186
+ // return an error
2187
+ if (irReturnError) {
2188
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2189
+ return callback(null, irReturnError);
2190
+ }
2191
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2192
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceCreateTask'], null, null, null);
2193
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2194
+ return callback(null, errorObj);
2195
+ }
2196
+
2197
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2198
+ // return the response
2199
+ return callback(irReturnData, null);
2200
+ });
2201
+ } catch (ex) {
2202
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2203
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2204
+ return callback(null, errorObj);
2205
+ }
2206
+ }
2207
+
2208
+ /**
2209
+ * @function jobstoreServiceListTask
2210
+ * @pronghornType method
2211
+ * @name jobstoreServiceListTask
2212
+ * @summary List tasks
2213
+ *
2214
+ * @param {string} [specSize] - Number of items expected to be returned.
2215
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
2216
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
2217
+ * @param {boolean} [specCount] - specCount param
2218
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
2219
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
2220
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
2221
+ * @param {string} [specParentType] - Filter by parent type.
2222
+ * @param {array} [specParentId] - Filter by parent UUIDs.
2223
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
2224
+ * @param {array} [specObjUuids] - Filter by UUIDs.
2225
+ * @param {array} [specFields] - limit displayed fields.
2226
+ * @param {array} [specFilters] - QueryFilter in string format.
2227
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
2228
+ introducing new fields which will take string as input.
2229
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
2230
+ * @param {string} [specFrom] - Start from items expected to be returned.
2231
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
2232
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
2233
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
2234
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
2235
+ * @param {array} [specRefFields] - limit displayed reference fields.
2236
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
2237
+ * @param {getCallback} callback - a callback function to return the result
2238
+ * @return {object} results - An object containing the response of the action
2239
+ *
2240
+ * @route {POST} /jobstoreServiceListTask
2241
+ * @roles admin
2242
+ * @task true
2243
+ */
2244
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2245
+ jobstoreServiceListTask(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
2246
+ const meth = 'adapter-jobstoreServiceListTask';
2247
+ const origin = `${this.id}-${meth}`;
2248
+ log.trace(origin);
2249
+
2250
+ if (this.suspended && this.suspendMode === 'error') {
2251
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2252
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2253
+ return callback(null, errorObj);
2254
+ }
2255
+
2256
+ /* HERE IS WHERE YOU VALIDATE DATA */
2257
+
2258
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2259
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
2260
+ const queryParams = {};
2261
+ const pathVars = [];
2262
+ const bodyVars = {};
2263
+
2264
+ // loop in template. long callback arg name to avoid identifier conflicts
2265
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2266
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2267
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2268
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2269
+ }
2270
+ });
2271
+
2272
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2273
+ // see adapter code documentation for more information on the request object's fields
2274
+ const reqObj = {
2275
+ payload: bodyVars,
2276
+ uriPathVars: pathVars,
2277
+ uriQuery: queryParams
2278
+ };
2279
+
2280
+ try {
2281
+ // Make the call -
2282
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2283
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceListTask', reqObj, true, (irReturnData, irReturnError) => {
2284
+ // if we received an error or their is no response on the results
2285
+ // return an error
2286
+ if (irReturnError) {
2287
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2288
+ return callback(null, irReturnError);
2289
+ }
2290
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2291
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceListTask'], null, null, null);
2292
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2293
+ return callback(null, errorObj);
2294
+ }
2295
+
2296
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2297
+ // return the response
2298
+ return callback(irReturnData, null);
2299
+ });
2300
+ } catch (ex) {
2301
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2302
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2303
+ return callback(null, errorObj);
2304
+ }
2305
+ }
2306
+
2307
+ /**
2308
+ * @function jobstoreServiceRefUpdate
2309
+ * @pronghornType method
2310
+ * @name jobstoreServiceRefUpdate
2311
+ * @summary Reference update
2312
+ *
2313
+ * @param {object} body - body param
2314
+ * @param {getCallback} callback - a callback function to return the result
2315
+ * @return {object} results - An object containing the response of the action
2316
+ *
2317
+ * @route {POST} /jobstoreServiceRefUpdate
2318
+ * @roles admin
2319
+ * @task true
2320
+ */
2321
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2322
+ jobstoreServiceRefUpdate(body, callback) {
2323
+ const meth = 'adapter-jobstoreServiceRefUpdate';
2324
+ const origin = `${this.id}-${meth}`;
2325
+ log.trace(origin);
2326
+
2327
+ if (this.suspended && this.suspendMode === 'error') {
2328
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2329
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2330
+ return callback(null, errorObj);
2331
+ }
2332
+
2333
+ /* HERE IS WHERE YOU VALIDATE DATA */
2334
+ if (body === undefined || body === null || body === '') {
2335
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2336
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2337
+ return callback(null, errorObj);
2338
+ }
2339
+
2340
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2341
+ const queryParamsAvailable = {};
2342
+ const queryParams = {};
2343
+ const pathVars = [];
2344
+ const bodyVars = body;
2345
+
2346
+ // loop in template. long callback arg name to avoid identifier conflicts
2347
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2348
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2349
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2350
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2351
+ }
2352
+ });
2353
+
2354
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2355
+ // see adapter code documentation for more information on the request object's fields
2356
+ const reqObj = {
2357
+ payload: bodyVars,
2358
+ uriPathVars: pathVars,
2359
+ uriQuery: queryParams
2360
+ };
2361
+
2362
+ try {
2363
+ // Make the call -
2364
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2365
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
2366
+ // if we received an error or their is no response on the results
2367
+ // return an error
2368
+ if (irReturnError) {
2369
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2370
+ return callback(null, irReturnError);
2371
+ }
2372
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2373
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceRefUpdate'], null, null, null);
2374
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2375
+ return callback(null, errorObj);
2376
+ }
2377
+
2378
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2379
+ // return the response
2380
+ return callback(irReturnData, null);
2381
+ });
2382
+ } catch (ex) {
2383
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2384
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2385
+ return callback(null, errorObj);
2386
+ }
2387
+ }
2388
+
2389
+ /**
2390
+ * @function jobstoreServiceExtRefUpdate
2391
+ * @pronghornType method
2392
+ * @name jobstoreServiceExtRefUpdate
2393
+ * @summary External reference update
2394
+ *
2395
+ * @param {object} body - body param
2396
+ * @param {getCallback} callback - a callback function to return the result
2397
+ * @return {object} results - An object containing the response of the action
2398
+ *
2399
+ * @route {POST} /jobstoreServiceExtRefUpdate
2400
+ * @roles admin
2401
+ * @task true
2402
+ */
2403
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2404
+ jobstoreServiceExtRefUpdate(body, callback) {
2405
+ const meth = 'adapter-jobstoreServiceExtRefUpdate';
2406
+ const origin = `${this.id}-${meth}`;
2407
+ log.trace(origin);
2408
+
2409
+ if (this.suspended && this.suspendMode === 'error') {
2410
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2411
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2412
+ return callback(null, errorObj);
2413
+ }
2414
+
2415
+ /* HERE IS WHERE YOU VALIDATE DATA */
2416
+ if (body === undefined || body === null || body === '') {
2417
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2418
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2419
+ return callback(null, errorObj);
2420
+ }
2421
+
2422
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2423
+ const queryParamsAvailable = {};
2424
+ const queryParams = {};
2425
+ const pathVars = [];
2426
+ const bodyVars = body;
2427
+
2428
+ // loop in template. long callback arg name to avoid identifier conflicts
2429
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2430
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2431
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2432
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2433
+ }
2434
+ });
2435
+
2436
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2437
+ // see adapter code documentation for more information on the request object's fields
2438
+ const reqObj = {
2439
+ payload: bodyVars,
2440
+ uriPathVars: pathVars,
2441
+ uriQuery: queryParams
2442
+ };
2443
+
2444
+ try {
2445
+ // Make the call -
2446
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2447
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceExtRefUpdate', reqObj, true, (irReturnData, irReturnError) => {
2448
+ // if we received an error or their is no response on the results
2449
+ // return an error
2450
+ if (irReturnError) {
2451
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2452
+ return callback(null, irReturnError);
2453
+ }
2454
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2455
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceExtRefUpdate'], null, null, null);
2456
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2457
+ return callback(null, errorObj);
2458
+ }
2459
+
2460
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2461
+ // return the response
2462
+ return callback(irReturnData, null);
2463
+ });
2464
+ } catch (ex) {
2465
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2466
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2467
+ return callback(null, errorObj);
2468
+ }
2469
+ }
2470
+
2471
+ /**
2472
+ * @function jobstoreServiceCreateJob
2473
+ * @pronghornType method
2474
+ * @name jobstoreServiceCreateJob
2475
+ * @summary Create job
2476
+ *
2477
+ * @param {object} body - body param
2478
+ * @param {getCallback} callback - a callback function to return the result
2479
+ * @return {object} results - An object containing the response of the action
2480
+ *
2481
+ * @route {POST} /jobstoreServiceCreateJob
2482
+ * @roles admin
2483
+ * @task true
2484
+ */
2485
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2486
+ jobstoreServiceCreateJob(body, callback) {
2487
+ const meth = 'adapter-jobstoreServiceCreateJob';
2488
+ const origin = `${this.id}-${meth}`;
2489
+ log.trace(origin);
2490
+
2491
+ if (this.suspended && this.suspendMode === 'error') {
2492
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2493
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2494
+ return callback(null, errorObj);
2495
+ }
2496
+
2497
+ /* HERE IS WHERE YOU VALIDATE DATA */
2498
+ if (body === undefined || body === null || body === '') {
2499
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
2500
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2501
+ return callback(null, errorObj);
2502
+ }
2503
+
2504
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2505
+ const queryParamsAvailable = {};
2506
+ const queryParams = {};
2507
+ const pathVars = [];
2508
+ const bodyVars = body;
2509
+
2510
+ // loop in template. long callback arg name to avoid identifier conflicts
2511
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2512
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2513
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2514
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2515
+ }
2516
+ });
2517
+
2518
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2519
+ // see adapter code documentation for more information on the request object's fields
2520
+ const reqObj = {
2521
+ payload: bodyVars,
2522
+ uriPathVars: pathVars,
2523
+ uriQuery: queryParams
2524
+ };
2525
+
2526
+ try {
2527
+ // Make the call -
2528
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2529
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceCreateJob', reqObj, true, (irReturnData, irReturnError) => {
2530
+ // if we received an error or their is no response on the results
2531
+ // return an error
2532
+ if (irReturnError) {
2533
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2534
+ return callback(null, irReturnError);
2535
+ }
2536
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2537
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceCreateJob'], null, null, null);
2538
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2539
+ return callback(null, errorObj);
2540
+ }
2541
+
2542
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2543
+ // return the response
2544
+ return callback(irReturnData, null);
2545
+ });
2546
+ } catch (ex) {
2547
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2548
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2549
+ return callback(null, errorObj);
2550
+ }
2551
+ }
2552
+
2553
+ /**
2554
+ * @function jobstoreServiceListJob
2555
+ * @pronghornType method
2556
+ * @name jobstoreServiceListJob
2557
+ * @summary List jobs
2558
+ *
2559
+ * @param {string} [specSize] - Number of items expected to be returned.
2560
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
2561
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
2562
+ * @param {boolean} [specCount] - specCount param
2563
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
2564
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
2565
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
2566
+ * @param {string} [specParentType] - Filter by parent type.
2567
+ * @param {array} [specParentId] - Filter by parent UUIDs.
2568
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
2569
+ * @param {array} [specObjUuids] - Filter by UUIDs.
2570
+ * @param {array} [specFields] - limit displayed fields.
2571
+ * @param {array} [specFilters] - QueryFilter in string format.
2572
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
2573
+ introducing new fields which will take string as input.
2574
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
2575
+ * @param {string} [specFrom] - Start from items expected to be returned.
2576
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
2577
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
2578
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
2579
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
2580
+ * @param {array} [specRefFields] - limit displayed reference fields.
2581
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
2582
+ * @param {getCallback} callback - a callback function to return the result
2583
+ * @return {object} results - An object containing the response of the action
2584
+ *
2585
+ * @route {POST} /jobstoreServiceListJob
2586
+ * @roles admin
2587
+ * @task true
2588
+ */
2589
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2590
+ jobstoreServiceListJob(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
2591
+ const meth = 'adapter-jobstoreServiceListJob';
2592
+ const origin = `${this.id}-${meth}`;
2593
+ log.trace(origin);
2594
+
2595
+ if (this.suspended && this.suspendMode === 'error') {
2596
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2597
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2598
+ return callback(null, errorObj);
2599
+ }
2600
+
2601
+ /* HERE IS WHERE YOU VALIDATE DATA */
2602
+
2603
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
2604
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
2605
+ const queryParams = {};
2606
+ const pathVars = [];
2607
+ const bodyVars = {};
2608
+
2609
+ // loop in template. long callback arg name to avoid identifier conflicts
2610
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
2611
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
2612
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
2613
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
2614
+ }
2615
+ });
2616
+
2617
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
2618
+ // see adapter code documentation for more information on the request object's fields
2619
+ const reqObj = {
2620
+ payload: bodyVars,
2621
+ uriPathVars: pathVars,
2622
+ uriQuery: queryParams
2623
+ };
2624
+
2625
+ try {
2626
+ // Make the call -
2627
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
2628
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceListJob', reqObj, true, (irReturnData, irReturnError) => {
2629
+ // if we received an error or their is no response on the results
2630
+ // return an error
2631
+ if (irReturnError) {
2632
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
2633
+ return callback(null, irReturnError);
2634
+ }
2635
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
2636
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceListJob'], null, null, null);
2637
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2638
+ return callback(null, errorObj);
2639
+ }
2640
+
2641
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
2642
+ // return the response
2643
+ return callback(irReturnData, null);
2644
+ });
2645
+ } catch (ex) {
2646
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
2647
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2648
+ return callback(null, errorObj);
2649
+ }
2650
+ }
2651
+
2652
+ /**
2653
+ * @function jobstoreServiceUpdateJobPurgePolicy
2654
+ * @pronghornType method
2655
+ * @name jobstoreServiceUpdateJobPurgePolicy
2656
+ * @summary Update job-purge-policy by ID
2657
+ *
2658
+ * @param {string} iD - iD param
2659
+ * @param {object} body - body param
2660
+ * @param {getCallback} callback - a callback function to return the result
2661
+ * @return {object} results - An object containing the response of the action
2662
+ *
2663
+ * @route {POST} /jobstoreServiceUpdateJobPurgePolicy
2664
+ * @roles admin
2665
+ * @task true
2666
+ */
2667
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2668
+ jobstoreServiceUpdateJobPurgePolicy(iD, body, callback) {
2669
+ const meth = 'adapter-jobstoreServiceUpdateJobPurgePolicy';
2670
+ const origin = `${this.id}-${meth}`;
2671
+ log.trace(origin);
2672
+
2673
+ if (this.suspended && this.suspendMode === 'error') {
2674
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
2675
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2676
+ return callback(null, errorObj);
2677
+ }
2678
+
2679
+ /* HERE IS WHERE YOU VALIDATE DATA */
2680
+ if (iD === undefined || iD === null || iD === '') {
2681
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
2682
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
2683
+ return callback(null, errorObj);
2684
+ }
2685
+ if (body === undefined || body === null || body === '') {
2686
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], 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 = body;
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('JobstoreService', 'jobstoreServiceUpdateJobPurgePolicy', 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', ['jobstoreServiceUpdateJobPurgePolicy'], 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 jobstoreServiceGetJobPurgePolicy
2742
+ * @pronghornType method
2743
+ * @name jobstoreServiceGetJobPurgePolicy
2744
+ * @summary Get job-purge-policy 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} /jobstoreServiceGetJobPurgePolicy
2754
+ * @roles admin
2755
+ * @task true
2756
+ */
2757
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2758
+ jobstoreServiceGetJobPurgePolicy(iD, detail, fields, refFields, callback) {
2759
+ const meth = 'adapter-jobstoreServiceGetJobPurgePolicy';
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('JobstoreService', 'jobstoreServiceGetJobPurgePolicy', 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', ['jobstoreServiceGetJobPurgePolicy'], 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 jobstoreServiceDeleteJobPurgePolicy
2827
+ * @pronghornType method
2828
+ * @name jobstoreServiceDeleteJobPurgePolicy
2829
+ * @summary Delete job-purge-policy by ID
2830
+ *
2831
+ * @param {string} iD - iD 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} /jobstoreServiceDeleteJobPurgePolicy
2836
+ * @roles admin
2837
+ * @task true
2838
+ */
2839
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2840
+ jobstoreServiceDeleteJobPurgePolicy(iD, callback) {
2841
+ const meth = 'adapter-jobstoreServiceDeleteJobPurgePolicy';
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 (iD === undefined || iD === null || iD === '') {
2853
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], 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 = [iD];
2862
+ const bodyVars = {};
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('JobstoreService', 'jobstoreServiceDeleteJobPurgePolicy', reqObj, false, (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', ['jobstoreServiceDeleteJobPurgePolicy'], 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 jobstoreServiceCreateDeletedResource
2909
+ * @pronghornType method
2910
+ * @name jobstoreServiceCreateDeletedResource
2911
+ * @summary Create deleted-resource
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} /jobstoreServiceCreateDeletedResource
2918
+ * @roles admin
2919
+ * @task true
2920
+ */
2921
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
2922
+ jobstoreServiceCreateDeletedResource(body, callback) {
2923
+ const meth = 'adapter-jobstoreServiceCreateDeletedResource';
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('JobstoreService', 'jobstoreServiceCreateDeletedResource', 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', ['jobstoreServiceCreateDeletedResource'], 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 jobstoreServiceListDeletedResource
2991
+ * @pronghornType method
2992
+ * @name jobstoreServiceListDeletedResource
2993
+ * @summary List deleted-resources
2994
+ *
2995
+ * @param {string} [specSize] - Number of items expected to be returned.
2996
+ * @param {string} [specPageMarker] - Include only objects with UUID lexically greater than this.
2997
+ * @param {boolean} [specDetail] - Include detail informatoin or not.
2998
+ * @param {boolean} [specCount] - specCount param
2999
+ * @param {boolean} [specExcludeShared] - Include shared resources or not.
3000
+ * @param {boolean} [specExcludeHrefs] - Exclude href parameters.
3001
+ * @param {array} [specParentFqNameStr] - Filter by parent FQ Name.
3002
+ * @param {string} [specParentType] - Filter by parent type.
3003
+ * @param {array} [specParentId] - Filter by parent UUIDs.
3004
+ * @param {array} [specBackRefId] - Filter by backref UUIDss.
3005
+ * @param {array} [specObjUuids] - Filter by UUIDs.
3006
+ * @param {array} [specFields] - limit displayed fields.
3007
+ * @param {array} [specFilters] - QueryFilter in string format.
3008
+ Grpc-gateway doesn&#39;t have support for nested structs and maps so
3009
+ introducing new fields which will take string as input.
3010
+ * @param {array} [specRefUuids] - Filter by ref UUIDss.
3011
+ * @param {string} [specFrom] - Start from items expected to be returned.
3012
+ * @param {string} [specSortby] - Sort by column with ascending or descending by default ascending.
3013
+ * @param {string} [specOperation] - Operation determines whether union or interjection.
3014
+ * @param {array} [specTagFilters] - Filter by Tag Fields.
3015
+ * @param {boolean} [specTagDetail] - Include Tag Details or not.
3016
+ * @param {array} [specRefFields] - limit displayed reference fields.
3017
+ * @param {array} [specExtRefUuids] - Filter by External Ref UUIDss.
3018
+ * @param {getCallback} callback - a callback function to return the result
3019
+ * @return {object} results - An object containing the response of the action
3020
+ *
3021
+ * @route {POST} /jobstoreServiceListDeletedResource
3022
+ * @roles admin
3023
+ * @task true
3024
+ */
3025
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3026
+ jobstoreServiceListDeletedResource(specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation = 'AND', specTagFilters, specTagDetail, specRefFields, specExtRefUuids, callback) {
3027
+ const meth = 'adapter-jobstoreServiceListDeletedResource';
3028
+ const origin = `${this.id}-${meth}`;
3029
+ log.trace(origin);
3030
+
3031
+ if (this.suspended && this.suspendMode === 'error') {
3032
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3033
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3034
+ return callback(null, errorObj);
3035
+ }
3036
+
3037
+ /* HERE IS WHERE YOU VALIDATE DATA */
3038
+
3039
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3040
+ const queryParamsAvailable = { specSize, specPageMarker, specDetail, specCount, specExcludeShared, specExcludeHrefs, specParentFqNameStr, specParentType, specParentId, specBackRefId, specObjUuids, specFields, specFilters, specRefUuids, specFrom, specSortby, specOperation, specTagFilters, specTagDetail, specRefFields, specExtRefUuids };
3041
+ const queryParams = {};
3042
+ const pathVars = [];
3043
+ const bodyVars = {};
3044
+
3045
+ // loop in template. long callback arg name to avoid identifier conflicts
3046
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3047
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3048
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3049
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3050
+ }
3051
+ });
3052
+
3053
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3054
+ // see adapter code documentation for more information on the request object's fields
3055
+ const reqObj = {
3056
+ payload: bodyVars,
3057
+ uriPathVars: pathVars,
3058
+ uriQuery: queryParams
3059
+ };
3060
+
3061
+ try {
3062
+ // Make the call -
3063
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3064
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceListDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
3065
+ // if we received an error or their is no response on the results
3066
+ // return an error
3067
+ if (irReturnError) {
3068
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3069
+ return callback(null, irReturnError);
3070
+ }
3071
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3072
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceListDeletedResource'], null, null, null);
3073
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3074
+ return callback(null, errorObj);
3075
+ }
3076
+
3077
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3078
+ // return the response
3079
+ return callback(irReturnData, null);
3080
+ });
3081
+ } catch (ex) {
3082
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3083
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3084
+ return callback(null, errorObj);
3085
+ }
3086
+ }
3087
+
3088
+ /**
3089
+ * @function jobstoreServiceBulkListDeletedResource
3090
+ * @pronghornType method
3091
+ * @name jobstoreServiceBulkListDeletedResource
3092
+ * @summary Bulk list deleted-resources
3093
+ *
3094
+ * @param {object} body - body param
3095
+ * @param {getCallback} callback - a callback function to return the result
3096
+ * @return {object} results - An object containing the response of the action
3097
+ *
3098
+ * @route {POST} /jobstoreServiceBulkListDeletedResource
3099
+ * @roles admin
3100
+ * @task true
3101
+ */
3102
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3103
+ jobstoreServiceBulkListDeletedResource(body, callback) {
3104
+ const meth = 'adapter-jobstoreServiceBulkListDeletedResource';
3105
+ const origin = `${this.id}-${meth}`;
3106
+ log.trace(origin);
3107
+
3108
+ if (this.suspended && this.suspendMode === 'error') {
3109
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3110
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3111
+ return callback(null, errorObj);
3112
+ }
3113
+
3114
+ /* HERE IS WHERE YOU VALIDATE DATA */
3115
+ if (body === undefined || body === null || body === '') {
3116
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3117
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3118
+ return callback(null, errorObj);
3119
+ }
3120
+
3121
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3122
+ const queryParamsAvailable = {};
3123
+ const queryParams = {};
3124
+ const pathVars = [];
3125
+ const bodyVars = body;
3126
+
3127
+ // loop in template. long callback arg name to avoid identifier conflicts
3128
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3129
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3130
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3131
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3132
+ }
3133
+ });
3134
+
3135
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3136
+ // see adapter code documentation for more information on the request object's fields
3137
+ const reqObj = {
3138
+ payload: bodyVars,
3139
+ uriPathVars: pathVars,
3140
+ uriQuery: queryParams
3141
+ };
3142
+
3143
+ try {
3144
+ // Make the call -
3145
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3146
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceBulkListDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
3147
+ // if we received an error or their is no response on the results
3148
+ // return an error
3149
+ if (irReturnError) {
3150
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3151
+ return callback(null, irReturnError);
3152
+ }
3153
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3154
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceBulkListDeletedResource'], null, null, null);
3155
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3156
+ return callback(null, errorObj);
3157
+ }
3158
+
3159
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3160
+ // return the response
3161
+ return callback(irReturnData, null);
3162
+ });
3163
+ } catch (ex) {
3164
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3165
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3166
+ return callback(null, errorObj);
3167
+ }
3168
+ }
3169
+
3170
+ /**
3171
+ * @function jobstoreServiceUpdateDeletedResource
3172
+ * @pronghornType method
3173
+ * @name jobstoreServiceUpdateDeletedResource
3174
+ * @summary Update deleted-resource by ID
3175
+ *
3176
+ * @param {string} iD - iD param
3177
+ * @param {object} body - body param
3178
+ * @param {getCallback} callback - a callback function to return the result
3179
+ * @return {object} results - An object containing the response of the action
3180
+ *
3181
+ * @route {POST} /jobstoreServiceUpdateDeletedResource
3182
+ * @roles admin
3183
+ * @task true
3184
+ */
3185
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3186
+ jobstoreServiceUpdateDeletedResource(iD, body, callback) {
3187
+ const meth = 'adapter-jobstoreServiceUpdateDeletedResource';
3188
+ const origin = `${this.id}-${meth}`;
3189
+ log.trace(origin);
3190
+
3191
+ if (this.suspended && this.suspendMode === 'error') {
3192
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3193
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3194
+ return callback(null, errorObj);
3195
+ }
3196
+
3197
+ /* HERE IS WHERE YOU VALIDATE DATA */
3198
+ if (iD === undefined || iD === null || iD === '') {
3199
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3200
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3201
+ return callback(null, errorObj);
3202
+ }
3203
+ if (body === undefined || body === null || body === '') {
3204
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
3205
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3206
+ return callback(null, errorObj);
3207
+ }
3208
+
3209
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3210
+ const queryParamsAvailable = {};
3211
+ const queryParams = {};
3212
+ const pathVars = [iD];
3213
+ const bodyVars = body;
3214
+
3215
+ // loop in template. long callback arg name to avoid identifier conflicts
3216
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3217
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3218
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3219
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3220
+ }
3221
+ });
3222
+
3223
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3224
+ // see adapter code documentation for more information on the request object's fields
3225
+ const reqObj = {
3226
+ payload: bodyVars,
3227
+ uriPathVars: pathVars,
3228
+ uriQuery: queryParams
3229
+ };
3230
+
3231
+ try {
3232
+ // Make the call -
3233
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3234
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceUpdateDeletedResource', reqObj, false, (irReturnData, irReturnError) => {
3235
+ // if we received an error or their is no response on the results
3236
+ // return an error
3237
+ if (irReturnError) {
3238
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3239
+ return callback(null, irReturnError);
3240
+ }
3241
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3242
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceUpdateDeletedResource'], null, null, null);
3243
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3244
+ return callback(null, errorObj);
3245
+ }
3246
+
3247
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3248
+ // return the response
3249
+ return callback(irReturnData, null);
3250
+ });
3251
+ } catch (ex) {
3252
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3253
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3254
+ return callback(null, errorObj);
3255
+ }
3256
+ }
3257
+
3258
+ /**
3259
+ * @function jobstoreServiceGetDeletedResource
3260
+ * @pronghornType method
3261
+ * @name jobstoreServiceGetDeletedResource
3262
+ * @summary Get deleted-resource by ID
3263
+ *
3264
+ * @param {string} iD - iD param
3265
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
3266
+ * @param {array} [fields] - limit displayed fields.
3267
+ * @param {array} [refFields] - limit displayed reference fields.
3268
+ * @param {getCallback} callback - a callback function to return the result
3269
+ * @return {object} results - An object containing the response of the action
3270
+ *
3271
+ * @route {POST} /jobstoreServiceGetDeletedResource
3272
+ * @roles admin
3273
+ * @task true
3274
+ */
3275
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3276
+ jobstoreServiceGetDeletedResource(iD, detail, fields, refFields, callback) {
3277
+ const meth = 'adapter-jobstoreServiceGetDeletedResource';
3278
+ const origin = `${this.id}-${meth}`;
3279
+ log.trace(origin);
3280
+
3281
+ if (this.suspended && this.suspendMode === 'error') {
3282
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3283
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3284
+ return callback(null, errorObj);
3285
+ }
3286
+
3287
+ /* HERE IS WHERE YOU VALIDATE DATA */
3288
+ if (iD === undefined || iD === null || iD === '') {
3289
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3290
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3291
+ return callback(null, errorObj);
3292
+ }
3293
+
3294
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3295
+ const queryParamsAvailable = { detail, fields, refFields };
3296
+ const queryParams = {};
3297
+ const pathVars = [iD];
3298
+ const bodyVars = {};
3299
+
3300
+ // loop in template. long callback arg name to avoid identifier conflicts
3301
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3302
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3303
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3304
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3305
+ }
3306
+ });
3307
+
3308
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3309
+ // see adapter code documentation for more information on the request object's fields
3310
+ const reqObj = {
3311
+ payload: bodyVars,
3312
+ uriPathVars: pathVars,
3313
+ uriQuery: queryParams
3314
+ };
3315
+
3316
+ try {
3317
+ // Make the call -
3318
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3319
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceGetDeletedResource', reqObj, true, (irReturnData, irReturnError) => {
3320
+ // if we received an error or their is no response on the results
3321
+ // return an error
3322
+ if (irReturnError) {
3323
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3324
+ return callback(null, irReturnError);
3325
+ }
3326
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3327
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceGetDeletedResource'], null, null, null);
3328
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3329
+ return callback(null, errorObj);
3330
+ }
3331
+
3332
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3333
+ // return the response
3334
+ return callback(irReturnData, null);
3335
+ });
3336
+ } catch (ex) {
3337
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3338
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3339
+ return callback(null, errorObj);
3340
+ }
3341
+ }
3342
+
3343
+ /**
3344
+ * @function jobstoreServiceDeleteDeletedResource
3345
+ * @pronghornType method
3346
+ * @name jobstoreServiceDeleteDeletedResource
3347
+ * @summary Delete deleted-resource by ID
3348
+ *
3349
+ * @param {string} iD - iD param
3350
+ * @param {getCallback} callback - a callback function to return the result
3351
+ * @return {object} results - An object containing the response of the action
3352
+ *
3353
+ * @route {POST} /jobstoreServiceDeleteDeletedResource
3354
+ * @roles admin
3355
+ * @task true
3356
+ */
3357
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3358
+ jobstoreServiceDeleteDeletedResource(iD, callback) {
3359
+ const meth = 'adapter-jobstoreServiceDeleteDeletedResource';
3360
+ const origin = `${this.id}-${meth}`;
3361
+ log.trace(origin);
3362
+
3363
+ if (this.suspended && this.suspendMode === 'error') {
3364
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3365
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3366
+ return callback(null, errorObj);
3367
+ }
3368
+
3369
+ /* HERE IS WHERE YOU VALIDATE DATA */
3370
+ if (iD === undefined || iD === null || iD === '') {
3371
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3372
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3373
+ return callback(null, errorObj);
3374
+ }
3375
+
3376
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3377
+ const queryParamsAvailable = {};
3378
+ const queryParams = {};
3379
+ const pathVars = [iD];
3380
+ const bodyVars = {};
3381
+
3382
+ // loop in template. long callback arg name to avoid identifier conflicts
3383
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3384
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3385
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3386
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3387
+ }
3388
+ });
3389
+
3390
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3391
+ // see adapter code documentation for more information on the request object's fields
3392
+ const reqObj = {
3393
+ payload: bodyVars,
3394
+ uriPathVars: pathVars,
3395
+ uriQuery: queryParams
3396
+ };
3397
+
3398
+ try {
3399
+ // Make the call -
3400
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3401
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceDeleteDeletedResource', reqObj, false, (irReturnData, irReturnError) => {
3402
+ // if we received an error or their is no response on the results
3403
+ // return an error
3404
+ if (irReturnError) {
3405
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3406
+ return callback(null, irReturnError);
3407
+ }
3408
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3409
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceDeleteDeletedResource'], null, null, null);
3410
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3411
+ return callback(null, errorObj);
3412
+ }
3413
+
3414
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3415
+ // return the response
3416
+ return callback(irReturnData, null);
3417
+ });
3418
+ } catch (ex) {
3419
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3420
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3421
+ return callback(null, errorObj);
3422
+ }
3423
+ }
3424
+
3425
+ /**
3426
+ * @function jobstoreServiceBulkListLastPublishedNotification
3427
+ * @pronghornType method
3428
+ * @name jobstoreServiceBulkListLastPublishedNotification
3429
+ * @summary Bulk list last-published-notifications
3430
+ *
3431
+ * @param {object} body - body param
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} /jobstoreServiceBulkListLastPublishedNotification
3436
+ * @roles admin
3437
+ * @task true
3438
+ */
3439
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3440
+ jobstoreServiceBulkListLastPublishedNotification(body, callback) {
3441
+ const meth = 'adapter-jobstoreServiceBulkListLastPublishedNotification';
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 (body === undefined || body === null || body === '') {
3453
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], 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 = {};
3460
+ const queryParams = {};
3461
+ const pathVars = [];
3462
+ const bodyVars = body;
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('JobstoreService', 'jobstoreServiceBulkListLastPublishedNotification', 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', ['jobstoreServiceBulkListLastPublishedNotification'], 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 jobstoreServiceUpdateTask
3509
+ * @pronghornType method
3510
+ * @name jobstoreServiceUpdateTask
3511
+ * @summary Update task 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} /jobstoreServiceUpdateTask
3519
+ * @roles admin
3520
+ * @task true
3521
+ */
3522
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3523
+ jobstoreServiceUpdateTask(iD, body, callback) {
3524
+ const meth = 'adapter-jobstoreServiceUpdateTask';
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('JobstoreService', 'jobstoreServiceUpdateTask', 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', ['jobstoreServiceUpdateTask'], 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 jobstoreServiceGetTask
3597
+ * @pronghornType method
3598
+ * @name jobstoreServiceGetTask
3599
+ * @summary Get task by ID
3600
+ *
3601
+ * @param {string} iD - iD param
3602
+ * @param {boolean} [detail] - if detail is set then reference uuids &amp; child uuids will be returned in the response.
3603
+ * @param {array} [fields] - limit displayed fields.
3604
+ * @param {array} [refFields] - limit displayed reference fields.
3605
+ * @param {getCallback} callback - a callback function to return the result
3606
+ * @return {object} results - An object containing the response of the action
3607
+ *
3608
+ * @route {POST} /jobstoreServiceGetTask
3609
+ * @roles admin
3610
+ * @task true
3611
+ */
3612
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3613
+ jobstoreServiceGetTask(iD, detail, fields, refFields, callback) {
3614
+ const meth = 'adapter-jobstoreServiceGetTask';
3615
+ const origin = `${this.id}-${meth}`;
3616
+ log.trace(origin);
3617
+
3618
+ if (this.suspended && this.suspendMode === 'error') {
3619
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
3620
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3621
+ return callback(null, errorObj);
3622
+ }
3623
+
3624
+ /* HERE IS WHERE YOU VALIDATE DATA */
3625
+ if (iD === undefined || iD === null || iD === '') {
3626
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iD'], null, null, null);
3627
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3628
+ return callback(null, errorObj);
3629
+ }
3630
+
3631
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
3632
+ const queryParamsAvailable = { detail, fields, refFields };
3633
+ const queryParams = {};
3634
+ const pathVars = [iD];
3635
+ const bodyVars = {};
3636
+
3637
+ // loop in template. long callback arg name to avoid identifier conflicts
3638
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
3639
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
3640
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
3641
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
3642
+ }
3643
+ });
3644
+
3645
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
3646
+ // see adapter code documentation for more information on the request object's fields
3647
+ const reqObj = {
3648
+ payload: bodyVars,
3649
+ uriPathVars: pathVars,
3650
+ uriQuery: queryParams
3651
+ };
3652
+
3653
+ try {
3654
+ // Make the call -
3655
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
3656
+ return this.requestHandlerInst.identifyRequest('JobstoreService', 'jobstoreServiceGetTask', reqObj, true, (irReturnData, irReturnError) => {
3657
+ // if we received an error or their is no response on the results
3658
+ // return an error
3659
+ if (irReturnError) {
3660
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
3661
+ return callback(null, irReturnError);
3662
+ }
3663
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
3664
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['jobstoreServiceGetTask'], null, null, null);
3665
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3666
+ return callback(null, errorObj);
3667
+ }
3668
+
3669
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
3670
+ // return the response
3671
+ return callback(irReturnData, null);
3672
+ });
3673
+ } catch (ex) {
3674
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
3675
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
3676
+ return callback(null, errorObj);
3677
+ }
3678
+ }
3679
+
3680
+ /**
3681
+ * @function jobstoreServiceDeleteTask
3682
+ * @pronghornType method
3683
+ * @name jobstoreServiceDeleteTask
3684
+ * @summary Delete task by ID
3685
+ *
3686
+ * @param {string} iD - iD param
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} /jobstoreServiceDeleteTask
3691
+ * @roles admin
3692
+ * @task true
3693
+ */
3694
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3695
+ jobstoreServiceDeleteTask(iD, callback) {
3696
+ const meth = 'adapter-jobstoreServiceDeleteTask';
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 = {};
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('JobstoreService', 'jobstoreServiceDeleteTask', reqObj, false, (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', ['jobstoreServiceDeleteTask'], 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 jobstoreServiceSync
3764
+ * @pronghornType method
3765
+ * @name jobstoreServiceSync
3766
+ * @summary Sync
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} /jobstoreServiceSync
3773
+ * @roles admin
3774
+ * @task true
3775
+ */
3776
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3777
+ jobstoreServiceSync(body, callback) {
3778
+ const meth = 'adapter-jobstoreServiceSync';
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('JobstoreService', 'jobstoreServiceSync', 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', ['jobstoreServiceSync'], 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 jobstoreManagerPurge
3846
+ * @pronghornType method
3847
+ * @name jobstoreManagerPurge
3848
+ * @summary Purge
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} /jobstoreManagerPurge
3855
+ * @roles admin
3856
+ * @task true
3857
+ */
3858
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
3859
+ jobstoreManagerPurge(body, callback) {
3860
+ const meth = 'adapter-jobstoreManagerPurge';
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('JobstoreManager', 'jobstoreManagerPurge', 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', ['jobstoreManagerPurge'], 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
+ module.exports = ParagonJobStore;