Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.
Merged
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
15 changes: 12 additions & 3 deletions src/main/java/com/podio/item/ItemAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ public Item getItem(int itemId) {
* The data for the update
* @param silent
* True if the update should be silent, false otherwise
* @param hook
* True if hooks should be executed for the change, false otherwise
*/
public void updateItem(int itemId, ItemUpdate update, boolean silent) {
public void updateItem(int itemId, ItemUpdate update, boolean silent, boolean hook) {
getResourceFactory().getApiResource("/item/" + itemId)
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(update, MediaType.APPLICATION_JSON_TYPE).put();
}

Expand All @@ -86,11 +89,14 @@ public void updateItem(int itemId, ItemUpdate update, boolean silent) {
* The values for the fields
* @param silent
* True if the update should be silent, false otherwise
* @param hook
* True if hooks should be executed for the change, false otherwise
*/
public void updateItemValues(int itemId, List<FieldValuesUpdate> values,
boolean silent) {
boolean silent, boolean hook) {
getResourceFactory().getApiResource("/item/" + itemId + "/value/")
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(values, MediaType.APPLICATION_JSON_TYPE).put();
}

Expand All @@ -105,12 +111,15 @@ public void updateItemValues(int itemId, List<FieldValuesUpdate> values,
* The new values for the field
* @param silent
* True if the update should be silent, false otherwise
* @param hook
* True if hooks should be executed for the change, false otherwise
*/
public void updateItemFieldValues(int itemId, int fieldId,
List<Map<String, Object>> values, boolean silent) {
List<Map<String, Object>> values, boolean silent, boolean hook) {
getResourceFactory()
.getApiResource("/item/" + itemId + "/value/" + fieldId)
.queryParam("silent", silent ? "1" : "0")
.queryParam("hook", hook ? "1" : "0")
.entity(values, MediaType.APPLICATION_JSON_TYPE).put();
}

Expand Down