- item.get returns all - 0, 1, 2, 4 (normal item, discovery rule, prototype, auto-created item)
- trigger.get returns only "flags" in 0, 4 (normal trigger, auto-created trigger)
- graph.get returns only "flags" in 0, 4 (normal graph, auto-created graph)
We have also DiscoveryRule, ItemPrototype, TriggerPrototype and GraphPrototype API classes, they all work correctly and return only appropriate types (I've just tested).
So to be consistent we have to limit the "item.get" method to return only "real" items, i.e. 0 and 4 types only.
Then in documentation:
need to leave description only for available types.
Maybe we also need to check how other methods (update ... delete) from Item, Trigger and Graph classes work with rules and prototypes, maybe we have also to limit there the types ?
Yes, we must - I found a bug there (at least one), nasty bug:
try to update "status":0 using "item.update" method for a discovery rule or a prototype or a auto-created item - its "flags" will be silently changed to "0" - i.e. to normal item
"trigger.update" and "graph.update" are ok in this regard and don't allow such incorrect action - "No permissions to referred object or it does not exist!"
Please consider which particular tests I could forget and skip.