Aller au contenu

Tags

Méthodes

Tags.AddTag

CONTROL

Add a Tag. A Tag must have a thingId OR a ruleId (call this method twice if you want to attach the same tag to a thing and a rule), an appId (Use the appId of your app), a tagId (e.g. "favorites") and a value. Upon success, a TagAdded notification will be emitted. Calling this method twice for the same ids (thing/rule, appId and tagId) but with a different value will update the tag's value and the TagValueChanged notification will be emitted.

Paramètres :

Champ Type Notes
tag Tag

Retour :

Champ Type Notes
tagError TagError

Tags.GetTags

CONTROL

Get the Tags matching the given filter. Tags can be filtered by a thingID, a ruleId, an appId, a tagId or a combination of any (however, combining thingId and ruleId will return an empty result set).

Paramètres :

Champ Type Notes
appId String optionnel
ruleId Uuid optionnel
tagId String optionnel
thingId Uuid optionnel

Retour :

Champ Type Notes
tags Tags optionnel
tagError TagError

Tags.RemoveTag

CONTROL

Remove a Tag. Tag value is optional and will be disregarded. If the ids match, the tag will be deleted and a TagRemoved notification will be emitted.

Paramètres :

Champ Type Notes
tag Tag

Retour :

Champ Type Notes
tagError TagError

Notifications

Tags.TagAdded

Emitted whenever a tag is added to the system.

Paramètres :

Champ Type Notes
tag Tag

Tags.TagRemoved

Emitted whenever a tag is removed from the system.

Paramètres :

Champ Type Notes
tag Tag

Tags.TagValueChanged

Emitted whenever a tag's value is changed in the system.

Paramètres :

Champ Type Notes
tag Tag