nx_server_plugin_sdk 1.0 Server Plugin SDK

device_agent_manifest.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <string>
6
7 namespace nx {
8 namespace vms_server_plugins {
9 namespace analytics {
10 namespace stub {
11 namespace taxonomy_features {
12
13 static const std::string kDeviceAgentManifest = /*suppress newline*/ 1 + (const char*) R"json(
14 {
15 "supportedTypes":
16 [
17 {
18 "objectTypeId": "nx.base.Animal",
19 "attributes":
20 [
21 "Color",
22 "Size"
23 ]
24 },
25 {
26 "objectTypeId": "nx.stub.baseObjectType1",
27 "attributes":
28 [
29 "(Base) String attribute",
30 "(Base) Number attribute",
31 "(Base) Boolean attribute",
32 "(Base) Enum attribute",
33 "(Base) Color attribute",
34 "(Base) Object attribute.Nested Field 1",
35 "(Base) Object attribute.Nested Field 2",
36 "(Base) Show Conditional Attribute",
37 "(Base) Conditional Attribute"
38 ],
39 "_comment": "Supported Attributes of a nested Object are declared via `.`."
40 },
41 {
42 "id": "nx.stub.objectTypeEnumAtributesWithInlineItems",
43 "attributes":
44 [
45 "(Base) Enum attribute"
46 ],
47 "_comment": "Object Type containing Enum attributes with inline items."
48 },
49 {
50 "id": "nx.stub.objectTypeWithDependentAttributes",
51 "attributes":
52 [
53 "(Base) Enum attribute 1",
54 "(Base) Enum attribute 2"
55 ],
56 "_comment": "Object Type containing dependent attributes."
57 },
58 {
59 "objectTypeId": "nx.stub.derivedObjectType",
60 "attributes":
61 [
62 "(Base) String attribute",
63 "(Base) Number attribute",
64 "(Base) Boolean attribute",
65 "(Base) Enum attribute",
66 "(Base) Color attribute",
67 "(Base) Object attribute",
68 "(Derived) attribute 1",
69 "(Derived) attribute 2"
70 ]
71 },
72 {
73 "objectTypeId": "nx.stub.derivedObjectTypeWithOmittedAttributes",
74 "attributes":
75 [
76 "(Base) String attribute",
77 "(Derived) own attribute"
78 ]
79 },
80 {
81 "objectTypeId": "nx.stub.hiddenDerivedObjectType",
82 "attributes":
83 [
84 "(Base) String attribute",
85 "(Base) Number attribute"
86 ]
87 },
88 {
89 "objectTypeId": "nx.stub.hiddenDerivedObjectTypeWithOwnAttributes",
90 "attributes":
91 [
92 "Own Attribute of a hidden derived Object Type"
93 ]
94 },
95 {
96 "objectTypeId": "nx.stub.derivedObjectTypeWithUnsupportedBase",
97 "attributes":
98 [
99 "(Base 2) String attribute",
100 "(Base 2) Number attribute",
101 "(Base 2) Boolean attribute",
102 "(Derived) Enum attribute"
103 ]
104 },
105 {
106 "objectTypeId": "nx.stub.objectTypeWithNumberAttributes",
107 "attributes":
108 [
109 "Integer attribute",
110 "Floating point attribute",
111 "Number attribute with min value",
112 "Number attribute with max value",
113 "Number attribute with bounds",
114 "Number Attribute with unit",
115 "Number attribute (full example)"
116 ]
117 },
118 {
119 "objectTypeId": "nx.stub.objectTypeWithBooleanAttributes",
120 "attributes":
121 [
122 "Boolean attribute 1",
123 "Boolean attribute 2",
124 "Boolean attribute 3",
125 "Boolean attribute 4"
126 ]
127 },
128 {
129 "objectTypeId": "nx.stub.objectTypeWithIcon"
130 },
131 {
132 "objectTypeId": "nx.stub.objectTypeInheritedFromBaseTypeLibraryType",
133 "attributes":
134 [
135 "Gender",
136 "Height",
137 "Top Clothing Color",
138 "Name",
139 "Hat",
140 "Custom Type string attribute"
141 ]
142 },
143 {
144 "objectTypeId": "nx.stub.objectTypeUsingBaseTypeLibraryEnumType",
145 "attributes":
146 [
147 "Custom Type Enum attribute"
148 ]
149 },
150 {
151 "objectTypeId": "nx.stub.objectTypeUsingBaseTypeLibraryColorType",
152 "attributes":
153 [
154 "Custom Type Color attribute"
155 ]
156 },
157 {
158 "objectTypeId": "nx.stub.objectTypeUsingBaseTypeLibraryObjectType",
159 "attributes":
160 [
161 "Custom Type Object attribute",
162 "Custom Type Object attribute.Size",
163 "Custom Type Object attribute.Color",
164 "Custom Type Object attribute.Type"
165 ]
166 },
167 {
168 "objectTypeId": "nx.stub.objectTypeFromEngineManifest",
169 "attributes":
170 [
171 "String attribute (Engine)",
172 "Enum attribute (Engine)",
173 "Color attribute (Engine)",
174 "Object attribute using Object Type from Base Type Library (Engine)"
175 ]
176 },
177 {
178 "objectTypeId": "nx.stub.liveOnlyObjectType",
179 "attributes":
180 [
181 "Live-only Object Type attribute"
182 ]
183 },
184 {
185 "objectTypeId": "nx.stub.nonIndexableObjectType",
186 "attributes":
187 [
188 "Non-indexable Object Type attribute"
189 ]
190 },
191 {
192 "objectTypeId": "nx.base.Vehicle",
193 "attributes": [
194 "Extended Vehicle attribute"
195 ]
196 },
197 {
198 "objectTypeId": "nx.stub.objectTypeWithAttributeList",
199 "attributes": [
200 "Attribute List attribute 1",
201 "Attribute List attribute 2",
202 "Regular attribute"
203 ]
204 }
205 ],)json" + /* Workaround for long strings. */ std::string() + R"json(
206 "typeLibrary":
207 {
208 "attributeLists": [
209 {
210 "id": "nx.stub.attributeList",
211 "attributes": [
212 {
213 "type": "String",
214 "name": "Attribute List attribute 1"
215 },
216 {
217 "type": "String",
218 "name": "Attribute List attribute 2"
219 }
220 ]
221 }
222 ],
223 "extendedObjectTypes": [
224 {
225 "id": "nx.base.Vehicle",
226 "attributes": [
227 {
228 "name": "Extended Vehicle attribute",
229 "type": "String"
230 }
231 ]
232 }
233 ],
234 "objectTypes":
235 [
236 {
237 "id": "nx.stub.objectTypeWithAttributeList",
238 "name": "Stub: Object Type with Attribute List",
239 "attributes": [
240 {
241 "attributeList": "nx.stub.attributeList"
242 },
243 {
244 "name": "Regular attribute",
245 "type": "String"
246 }
247 ]
248 },
249 {
250 "_comment": "Base Object Type containing Attributes of all types. All Attributes are declared as supported in the \"supportedTypes\" list.",
251 "id": "nx.stub.baseObjectType1",
252 "name": "Stub: Base Object Type 1",
253 "attributes":
254 [
255 {
256 "type": "String",
257 "name": "(Base) String attribute"
258 },
259 {
260 "type": "Number",
261 "name": "(Base) Number attribute"
262 },
263 {
264 "type": "Boolean",
265 "name": "(Base) Boolean attribute"
266 },
267 {
268 "type": "Enum",
269 "subtype": "nx.stub.baseEnumType",
270 "name": "(Base) Enum attribute"
271 },
272 {
273 "type": "Color",
274 "subtype": "nx.stub.baseColorType",
275 "name": "(Base) Color attribute"
276 },
277 {
278 "type": "Object",
279 "subtype": "nx.stub.attributeObjectType",
280 "name": "(Base) Object attribute"
281 },
282 {
283 "name": "(Base) Show Conditional Attribute",
284 "type": "Boolean"
285 },
286 {
287 "name": "(Base) Conditional Attribute",
288 "type": "String",
289 "condition": "\"(Base) Show Conditional Attribute\" = true"
290 }
291 ]
292 },
293 {
294 "_comment": "Object Type containing Enum attributes with inline items.",
295 "id": "nx.stub.objectTypeEnumAtributesWithInlineItems",
296 "name": "Stub: Object Type Enum attributes with inline items",
297 "attributes":
298 [
299 {
300 "type": "Enum",
301 "name": "(Base) Enum attribute",
302 "items":
303 [
304 "Enum Type item 1",
305 "Enum Type item 2"
306 ]
307 }
308 ]
309 },
310 {
311 "_comment": "Object Type containing dependent attributes.",
312 "id": "nx.stub.objectTypeWithDependentAttributes",
313 "name": "Stub: Object Type with dependent attributes",
314 "attributes":
315 [
316 {
317 "type": "Enum",
318 "name": "(Base) Enum attribute 1",
319 "items":
320 [
321 "Enum Type item 1",
322 {
323 "value": "Enum Type item 2",
324 "dependentAttributes":
325 [
326 {
327 "type": "Enum",
328 "name": "(Base) Enum attribute 2",
329 "items":
330 [
331 "Enum Type item 1",
332 "Enum Type item 2",
333 "Enum Type item 3"
334 ]
335 }
336 ]
337 }
338 ]
339 }
340 ]
341 },
342 {
343 "_comment": "Base Object Type that is not declared as supported in the \"supportedTypes\" list.",
344 "id": "nx.stub.baseObjectType2",
345 "name": "Stub: Base Object Type 2",
346 "attributes":
347 [
348 {
349 "type": "String",
350 "name": "(Base 2) String attribute"
351 },
352 {
353 "type": "Number",
354 "name": "(Base 2) Number attribute"
355 },
356 {
357 "type": "Boolean",
358 "name": "(Base 2) Boolean attribute"
359 }
360 ]
361 },
362 {
363 "_comment": "Simple derived Object Type containing some additional Attributes.",
364 "id": "nx.stub.derivedObjectType",
365 "name": "Stub: Derived Object Type",
366 "base": "nx.stub.baseObjectType1",
367 "attributes":
368 [
369 {
370 "name": "(Derived) attribute 1",
371 "type": "String"
372 },
373 {
374 "name": "(Derived) attribute 2",
375 "type": "String"
376 }
377 ]
378 },
379 {
380 "_comment": "Derived Object Type that blacklists some Attributes of its base Type with \"omittedBaseAttributes\".",
381 "id": "nx.stub.derivedObjectTypeWithOmittedAttributes",
382 "name": "Stub: Derived Object Type with omitted attributes",
383 "base": "nx.stub.baseObjectType1",
384 "omittedBaseAttributes":
385 [
386 "(Base) Number attribute",
387 "(Base) Boolean attribute",
388 "(Base) Enum attribute",
389 "(Base) Color attribute",
390 "(Base) Object attribute"
391 ],
392 "attributes":
393 [
394 {
395 "name": "(Derived) own attribute",
396 "type": "Number"
397 }
398 ]
399 },
400 {
401 "_comment": "Hidden derived Object Type. Such Types are not shown in the Analytics Panel.",
402 "id": "nx.stub.hiddenDerivedObjectType",
403 "name": "Stub: Hidden derived object type",
404 "base": "nx.stub.baseObjectType1",
405 "flags": "hiddenDerivedType"
406 },
407 {
408 "_comment": "Hidden derived Object Types can have their own Attributes. Such Attributes are shown when its base Type is selected in the Analytics Panel.",
409 "id": "nx.stub.hiddenDerivedObjectTypeWithOwnAttributes",
410 "name": "Stub: Hidden derived object type with own attributes",
411 "base": "nx.stub.baseObjectType2",
412 "flags": "hiddenDerivedType",
413 "attributes":
414 [
415 {
416 "type": "String",
417 "name": "Own Attribute of a hidden derived Object Type"
418 }
419 ]
420 },
421 {
422 "_comment": "Declaring a Derived Object Type makes its base supported as well.",
423 "id": "nx.stub.derivedObjectTypeWithUnsupportedBase",
424 "name": "Stub: Derived Object Type with unsupported base",
425 "base": "nx.stub.baseObjectType2",
426 "attributes":
427 [
428 {
429 "type": "Enum",
430 "subtype": "nx.base.derivedEnumType",
431 "name": "Derived Object Type Enum attribute"
432 }
433 ]
434 },
435 {
436 "id": "nx.stub.objectTypeWithNumberAttributes",
437 "name": "Stub: Object Type with Number attributes",
438 "attributes":
439 [
440 {
441 "type": "Number",
442 "subtype": "integer",
443 "name": "Integer attribute"
444 },
445 {
446 "type": "Number",
447 "subtype": "float",
448 "name": "Floating point attribute"
449 },
450 {
451 "type": "Number",
452 "name": "Number attribute with min value",
453 "minValue": 10
454 },
455 {
456 "type": "Number",
457 "name": "Number attribute with max value",
458 "maxValue": 100
459 },
460 {
461 "type": "Number",
462 "name": "Number attribute with bounds",
463 "minValue": -100,
464 "maxValue": 100
465 },
466 {
467 "type": "Number",
468 "name": "Number Attribute with unit",
469 "unit": "unit"
470 },
471 {
472 "type": "Number",
473 "subtype": "integer",
474 "name": "Number attribute (full example)",
475 "minValue": -100,
476 "maxValue": 100,
477 "unit": "other unit"
478 }
479 ]
480 },
481 {
482 "id": "nx.stub.objectTypeWithBooleanAttributes",
483 "name": "Stub: Object Type with Boolean attributes",
484 "attributes":
485 [
486 {
487 "type": "Boolean",
488 "name": "Boolean attribute 1"
489 },
490 {
491 "type": "Boolean",
492 "name": "Boolean attribute 2"
493 },
494 {
495 "type": "Boolean",
496 "name": "Boolean attribute 3"
497 },
498 {
499 "type": "Boolean",
500 "name": "Boolean attribute 4"
501 }
502 ]
503 },
504 {
505 "_comment": "Object Types can be used as Attribute types, yielding a nested Object.",
506 "id": "nx.stub.attributeObjectType",
507 "name": "Stub: Attribute Object Type",
508 "attributes":
509 [
510 {
511 "type": "String",
512 "name": "Nested field 1"
513 },
514 {
515 "type": "Number",
516 "name": "Nested field 2"
517 }
518 ]
519 },
520 {
521 "id": "nx.stub.objectTypeWithIcon",
522 "name": "Stub: Object Type with icon",
523 "icon": "nx.base.car"
524 },
525 {
526 "_comment": "Object Types can inherit from the Types declared in the Base Type Library.",
527 "id": "nx.stub.objectTypeInheritedFromBaseTypeLibraryType",
528 "name": "Stub: Object Type inherited from a Base Type Library Type",
529 "base": "nx.base.Person",
530 "omittedBaseAttributes":
531 [
532 "Complexion",
533 "Age",
534 "Activity",
535 "Scarf",
536 "Body Shape",
537 "Top Clothing Length",
538 "Top Clothing Grain",
539 "Top Clothing Type",
540 "Bottom Clothing Color",
541 "Bottom Clothing Length",
542 "Bottom Clothing Grain",
543 "Bottom Clothing Type",
544 "Things",
545 "Gloves",
546 "Shoes",
547 "Temperature",
548 "Tattoo"
549 ],
550 "attributes":
551 [
552 {
553 "type": "String",
554 "name": "Custom Type string attribute"
555 }
556 ]
557 },
558 {
559 "_comment": "Object Types can use Enum Types declared in the Base Type Library.",
560 "id": "nx.stub.objectTypeUsingBaseTypeLibraryEnumType",
561 "name": "Stub: Custom Type using Base Type Library Enum Type",
562 "attributes":
563 [
564 {
565 "type": "Enum",
566 "subtype": "nx.base.Length",
567 "name": "Custom Type Enum attribute"
568 }
569 ]
570 },
571 {
572 "_comment": "Object Types can use Color Types declared in the Base Type Library.",
573 "id": "nx.stub.objectTypeUsingBaseTypeLibraryColorType",
574 "name": "Stub: Custom Type using Base Type Library Color Type",
575 "attributes":
576 [
577 {
578 "type": "Color",
579 "subtype": "nx.base.Color",
580 "name": "Custom Type Color attribute"
581 }
582 ]
583 },
584 {
585 "_comment": "Base Type Library Object Types can be used to declare Attributes being nested Objects.",
586 "id": "nx.stub.objectTypeUsingBaseTypeLibraryObjectType",
587 "name": "Stub: Custom Type using Base Type Library Object Type",
588 "attributes":
589 [
590 {
591 "type": "Object",
592 "subtype": "nx.base.Bag",
593 "name": "Custom Type Object attribute"
594 }
595 ]
596 },
597 {
598 "_comment": "Objects of live-only types are not recorded to the database and archive and available in the Live mode only.",
599 "id": "nx.stub.liveOnlyObjectType",
600 "name": "Stub: Live-only Object Type",
601 "flags": "liveOnly",
602 "attributes":
603 [
604 {
605 "type": "String",
606 "name": "Live-only Object Type attribute"
607 }
608 ]
609 },
610 {
611 "_comment": "Objects of non-indexable types aren't available for search, but still recorded to the archive.",
612 "id": "nx.stub.nonIndexableObjectType",
613 "name": "Stub: Non-indexable Object Type",
614 "flags": "nonIndexable",
615 "attributes":
616 [
617 {
618 "type": "String",
619 "name": "Non-indexable Object Type attribute"
620 }
621 ]
622 }
623 ],)json" + /* Workaround for long strings. */ std::string() + R"json(
624 "enumTypes":
625 [
626 {
627 "id": "nx.stub.baseEnumType",
628 "name": "Stub: Base Enum Type",
629 "items":
630 [
631 "Base Enum Type item 1",
632 "Base Enum Type item 2",
633 "Base Enum Type item 3"
634 ]
635 },
636 {
637 "id": "nx.stub.derivedEnumType",
638 "name": "Stub: Derived Enum Type",
639 "base": "nx.stub.baseEnumType",
640 "baseItems":
641 [
642 "Base Enum Type item 1",
643 "Base Enum Type item 2"
644 ],
645 "items":
646 [
647 "Derived Enum Type item 1",
648 "Derived Enum Type item 2"
649 ]
650 }
651 ],
652 "colorTypes":
653 [
654 {
655 "id": "nx.stub.baseColorType",
656 "name": "Stub: Base Color Type",
657 "items":
658 [
659 {
660 "name": "black",
661 "rgb": "#000000"
662 },
663 {
664 "name": "grey",
665 "rgb": "#808080"
666 },
667 {
668 "name": "white",
669 "rgb": "#FFFFFF"
670 }
671 ]
672 },
673 {
674 "id": "nx.stub.derivedColorType",
675 "name": "Stub: Derived Color Type",
676 "base": "nx.stub.baseColorType",
677 "baseItems":
678 [
679 "black",
680 "white"
681 ],
682 "items":
683 [
684 {
685 "name": "red",
686 "rgb": "#FF0000"
687 },
688 {
689 "name": "green",
690 "rgb": "#00FF00"
691 },
692 {
693 "name": "blue",
694 "rgb": "#0000FF"
695 }
696 ]
697 }
698 ]
699 }
700 }
701 )json";
702
703 } // namespace taxonomy_features
704 } // namespace stub
705 } // namespace analytics
706 } // namespace vms_server_plugins
707 } // namespace nx
nx
Definition: apple_utils.h:6