Skip to content

Commit 7a2cb4e

Browse files
committed
remove tag methods requiring collections
update readme
1 parent f8314f5 commit 7a2cb4e

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ User one = new User().setEmail("river@serenity.io");
211211
User two = new User().setEmail("simon@serenity.io").untag();
212212
User.create(one);
213213
User.create(two);
214-
final ArrayList<User> users = Lists.newArrayList(one, two);
215-
Tag.tag(tag, new UserCollection(users));
214+
Tag.tag(tag, one, two);
216215

217216
// iterate over all tags
218217
final TagCollection tags = Tag.list();
@@ -225,8 +224,7 @@ Company c1 = new Company().setCompanyID("1");
225224
Company c2 = new Company().setCompanyID("2").untag();
226225
Company.create(c1);
227226
Company.create(c2);
228-
final ArrayList<Company> companies = Lists.newArrayList(c1, c2);
229-
Tag.tag(tag, new CompanyCollection(companies));
227+
Tag.tag(tag, c1, c2);
230228

231229
// delete a tag
232230
Tag.delete(tag);

intercom-java/src/main/java/io/intercom/api/Tag.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,12 @@ public static Tag tag(Tag tag, Company... companies) throws InvalidException, Au
3030
return tag(tag, new CompanyCollection(Lists.newArrayList(companies)));
3131
}
3232

33-
@Deprecated
34-
// don't require folks to create a collection object
35-
public static Tag tag(Tag tag, UserCollection users) throws InvalidException, AuthorizationException {
33+
static Tag tag(Tag tag, UserCollection users) throws InvalidException, AuthorizationException {
3634
TaggableCollection taggableCollection = createTagTypedCollection(tag, users);
3735
return DataResource.create(taggableCollection, "tags", Tag.class);
3836
}
3937

40-
@Deprecated
41-
// don't require folks to create a collection object
42-
public static Tag tag(Tag tag, CompanyCollection companies) throws InvalidException, AuthorizationException {
38+
static Tag tag(Tag tag, CompanyCollection companies) throws InvalidException, AuthorizationException {
4339
TaggableCollection taggableCollection = createTagTypedCollection(tag, companies);
4440
return DataResource.create(taggableCollection, "tags", Tag.class);
4541
}

0 commit comments

Comments
 (0)