You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The README documentation shows how to create a Tag and use it to tag users. However, the vast majority of time, an existing tag will be used. It's not obvious from the documentation how we're supposed to use a tag without creating one.
We can obtain a Tag object by iterating all of the tags. This seems slow and expensive.
There's new Tag().setName() but there's no way to set the id. Is the id necessary for tagging users and companies? It doesn't seem to be in the underlying rest api, but the Java code seems to use it.
Would love some clarification. Thanks.
The text was updated successfully, but these errors were encountered:
It appears that new Tag().setName() is enough to create a tag for tagging, though there's a really weird problem. If you want to untag, you set untag() on the company/user that you pass into the Tag.tag(tag, company). But this creates a one-way mutation of the Company/User. If I want to perform a series of tags/untags, I have to construct a new Company for each one.
To illustrate, this appears to be the code necessary:
public static void tag(final String companyId, final String tagName, final boolean present) {
final Company company = new Company().setCompanyID(companyId);
if (!present) {
company.untag();
}
final Tag tag = new Tag().setName(tagName);
Tag.tag(tag, company);
}
The README documentation shows how to create a
Tag
and use it to tag users. However, the vast majority of time, an existing tag will be used. It's not obvious from the documentation how we're supposed to use a tag without creating one.We can obtain a Tag object by iterating all of the tags. This seems slow and expensive.
There's
new Tag().setName()
but there's no way to set the id. Is the id necessary for tagging users and companies? It doesn't seem to be in the underlying rest api, but the Java code seems to use it.Would love some clarification. Thanks.
The text was updated successfully, but these errors were encountered: