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