Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/com/podio/comment/CommentAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/com/podio/item/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -50,6 +52,11 @@ public class Item implements Serializable {
*/
private String title;

/**
* The direct link to the item
*/
private String link;

/**
* The values for each field
*/
Expand Down Expand Up @@ -91,6 +98,17 @@ public class Item implements Serializable {
*/
private Map<RatingType, Integer> 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;
Expand Down Expand Up @@ -149,6 +167,14 @@ public void setTitle(String title) {
this.title = title;
}

public String getLink() {
return link;
}

public void setLink(String link) {
this.link = link;
}

public List<FieldValuesView> getFields() {
return fields;
}
Expand Down Expand Up @@ -218,4 +244,24 @@ public Map<RatingType, Integer> getUserRatings() {
public void setUserRatings(Map<RatingType, Integer> 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;
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/podio/item/ItemUpdate.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.podio.item;

import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonProperty;
Expand Down Expand Up @@ -59,4 +60,11 @@ public List<FieldValuesUpdate> getFields() {
public void setFields(List<FieldValuesUpdate> fields) {
this.fields = fields;
}

public void addField(FieldValuesUpdate field) {
if (this.fields == null) {
this.fields = new ArrayList<FieldValuesUpdate>();
}
this.fields.add(field);
}
}
2 changes: 1 addition & 1 deletion src/test/java/com/podio/comment/CommentAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down