From b5f7e1eb4d7773ee2aeecde34f8cc3db9ce15562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20H=C3=BCbner?= Date: Wed, 18 Mar 2015 12:53:14 +0100 Subject: [PATCH 1/4] Added link property to Item --- src/main/java/com/podio/item/Item.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/podio/item/Item.java b/src/main/java/com/podio/item/Item.java index 70d8a86..247be9c 100644 --- a/src/main/java/com/podio/item/Item.java +++ b/src/main/java/com/podio/item/Item.java @@ -50,6 +50,11 @@ public class Item implements Serializable { */ private String title; + /** + * The direct link to the item + */ + private String link; + /** * The values for each field */ @@ -149,6 +154,14 @@ public void setTitle(String title) { this.title = title; } + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + public List getFields() { return fields; } From bbe6781d6217e973ec1cb18fcc69042c53b76a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20H=C3=BCbner?= Date: Thu, 19 Mar 2015 13:04:14 +0100 Subject: [PATCH 2/4] add single field method for ItemUpdate --- src/main/java/com/podio/item/ItemUpdate.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/podio/item/ItemUpdate.java b/src/main/java/com/podio/item/ItemUpdate.java index 5221a5b..4f60c17 100644 --- a/src/main/java/com/podio/item/ItemUpdate.java +++ b/src/main/java/com/podio/item/ItemUpdate.java @@ -1,5 +1,6 @@ package com.podio.item; +import java.util.ArrayList; import java.util.List; import org.codehaus.jackson.annotate.JsonProperty; @@ -59,4 +60,11 @@ public List getFields() { public void setFields(List fields) { this.fields = fields; } + + public void addField(FieldValuesUpdate field) { + if (this.fields == null) { + this.fields = new ArrayList(); + } + this.fields.add(field); + } } From 7274bcc840a28828b378baae975e5bd429be8ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20H=C3=BCbner?= Date: Fri, 20 Mar 2015 13:44:58 +0100 Subject: [PATCH 3/4] Add created_on and created_by for Item --- src/main/java/com/podio/item/Item.java | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/java/com/podio/item/Item.java b/src/main/java/com/podio/item/Item.java index 247be9c..248e518 100644 --- a/src/main/java/com/podio/item/Item.java +++ b/src/main/java/com/podio/item/Item.java @@ -6,9 +6,11 @@ import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; +import org.joda.time.DateTime; import com.podio.app.Application; import com.podio.comment.Comment; +import com.podio.common.AuthorizationEntity; import com.podio.file.File; import com.podio.rating.RatingType; import com.podio.rating.RatingTypeKeyDeserializer; @@ -96,6 +98,17 @@ public class Item implements Serializable { */ private Map userRatings; + /** + * The entity who created the item + */ + private AuthorizationEntity createdBy; + + /** + * The date and time the comment was created + */ + private DateTime createdOn; + + @JsonProperty("item_id") public int getId() { return id; @@ -231,4 +244,24 @@ public Map getUserRatings() { public void setUserRatings(Map userRatings) { this.userRatings = userRatings; } + + @JsonProperty("created_by") + public AuthorizationEntity getCreatedBy() { + return createdBy; + } + + @JsonProperty("created_by") + public void setCreatedBy(AuthorizationEntity createdBy) { + this.createdBy = createdBy; + } + + @JsonProperty("created_on") + public DateTime getCreatedOn() { + return createdOn; + } + + @JsonProperty("created_on") + public void setCreatedOn(DateTime createdOn) { + this.createdOn = createdOn; + } } From 14c7716c9e8c380c217ba39bb4632c772071cc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20H=C3=BCbner?= Date: Mon, 23 Mar 2015 13:17:17 +0100 Subject: [PATCH 4/4] addComment() is now accepting 'hook' param --- src/main/java/com/podio/comment/CommentAPI.java | 3 ++- src/test/java/com/podio/comment/CommentAPITest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/podio/comment/CommentAPI.java b/src/main/java/com/podio/comment/CommentAPI.java index 98caac5..4a03125 100644 --- a/src/main/java/com/podio/comment/CommentAPI.java +++ b/src/main/java/com/podio/comment/CommentAPI.java @@ -63,12 +63,13 @@ public Comment getComment(int commentId) { * True if the update should be silent, false otherwise */ public int addComment(Reference reference, CommentCreate comment, - boolean silent) { + boolean silent, boolean hook) { return getResourceFactory() .getApiResource( "/comment/" + reference.getType() + "/" + reference.getId()) .queryParam("silent", silent ? "1" : "0") + .queryParam("hook", hook ? "1" : "0") .entity(comment, MediaType.APPLICATION_JSON_TYPE) .post(CommentCreateResponse.class).getId(); } diff --git a/src/test/java/com/podio/comment/CommentAPITest.java b/src/test/java/com/podio/comment/CommentAPITest.java index bb70080..8ebd69c 100644 --- a/src/test/java/com/podio/comment/CommentAPITest.java +++ b/src/test/java/com/podio/comment/CommentAPITest.java @@ -60,7 +60,7 @@ public void getComments() { public void addComment() { int commentId = getAPI().addComment( new Reference(ReferenceType.ITEM, 1), - new CommentCreate("Testing"), false); + new CommentCreate("Testing"), false, false); Assert.assertTrue(commentId > 5); }