Skip to content

Commit b836517

Browse files
committed
Merge PR #53
Add includeArchived for Contacts
1 parent 41b5ba8 commit b836517

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/main/java/com/xero/api/XeroClient.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,16 +540,21 @@ public List<Contact> getContacts() throws IOException {
540540
}
541541

542542
public List<Contact> getContacts(Date modifiedAfter, String where, String order) throws IOException {
543-
return getContacts(modifiedAfter, where, order, null);
543+
return getContacts(modifiedAfter, where, order, null, null);
544544
}
545545

546546
public List<Contact> getContacts(Date modifiedAfter, String where, String order, String page) throws IOException {
547-
Map<String, String> params = new HashMap<>();
548-
addToMapIfNotNull(params, "Where", where);
549-
addToMapIfNotNull(params, "order", order);
550-
addToMapIfNotNull(params, "page", page);
547+
return getContacts(modifiedAfter, where, order, page, null);
548+
}
551549

552-
Response responseObj = get("Contacts", modifiedAfter, params);
550+
public List<Contact> getContacts(Date modifiedAfter, String where, String order, String page,
551+
Boolean includeArchived) throws IOException {
552+
Map<String, String> params = new HashMap<>();
553+
this.addToMapIfNotNull(params, "Where", where);
554+
this.addToMapIfNotNull(params, "order", order);
555+
this.addToMapIfNotNull(params, "page", page);
556+
this.addToMapIfNotNull(params, "includeArchived", includeArchived);
557+
Response responseObj = this.get("Contacts", modifiedAfter, params);
553558
if (responseObj.getContacts() == null) {
554559
ArrayOfContact array = new ArrayOfContact();
555560
return array.getContact();

0 commit comments

Comments
 (0)