From 8bcb22bb121b8e89301629ec785bfc76c7b72714 Mon Sep 17 00:00:00 2001 From: PetrFOX Date: Fri, 26 Jun 2015 22:41:56 +0200 Subject: [PATCH 1/4] Added ApplicationViewType.STREAM --- src/main/java/com/podio/app/ApplicationViewType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/podio/app/ApplicationViewType.java b/src/main/java/com/podio/app/ApplicationViewType.java index 30da783..ee75c76 100644 --- a/src/main/java/com/podio/app/ApplicationViewType.java +++ b/src/main/java/com/podio/app/ApplicationViewType.java @@ -11,7 +11,8 @@ public enum ApplicationViewType { NODE, CALENDAR, GALLERY, - CARD; + CARD, + STREAM; @Override @JsonValue From 48f244883158ac8b9f4d34055eb4fe1105446349 Mon Sep 17 00:00:00 2001 From: PetrFOX Date: Fri, 26 Jun 2015 22:48:18 +0200 Subject: [PATCH 2/4] space at the start of one line changed --- src/main/java/com/podio/app/ApplicationViewType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/podio/app/ApplicationViewType.java b/src/main/java/com/podio/app/ApplicationViewType.java index ee75c76..262f220 100644 --- a/src/main/java/com/podio/app/ApplicationViewType.java +++ b/src/main/java/com/podio/app/ApplicationViewType.java @@ -12,7 +12,7 @@ public enum ApplicationViewType { CALENDAR, GALLERY, CARD, - STREAM; + STREAM; @Override @JsonValue From cd6d69e08d5e21c9ab9b695a569397bd39e0b815 Mon Sep 17 00:00:00 2001 From: PetrFOX Date: Mon, 6 Jul 2015 23:45:56 +0200 Subject: [PATCH 3/4] Added possibility to get space contacts by get methods in ContactAPI --- .../java/com/podio/contact/ContactAPI.java | 33 ++++++++++++------- .../java/com/podio/contact/ContactType.java | 14 ++++++++ 2 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 src/main/java/com/podio/contact/ContactType.java diff --git a/src/main/java/com/podio/contact/ContactAPI.java b/src/main/java/com/podio/contact/ContactAPI.java index edf95a0..5fbad51 100644 --- a/src/main/java/com/podio/contact/ContactAPI.java +++ b/src/main/java/com/podio/contact/ContactAPI.java @@ -82,12 +82,12 @@ public void deleteSpaceContact(int profileId, boolean silent) { /** * Returns all the contact details about the user with the given id. * - * @param userId - * The id of the user + * @param profileId + * The profile id of the user * @return The contact profile */ - public Profile getContact(int userId) { - return getResourceFactory().getApiResource("/contact/" + userId).get( + public Profile getContact(int profileId) { + return getResourceFactory().getApiResource("/contact/" + profileId + "/v2").get( Profile.class); } @@ -140,15 +140,17 @@ public ContactTotal getContactTotal() { * The format in which the contacts should be returned * @param order * How the contacts should be ordered + * @param contactType + * The type of contacts to be returned * @return The list of contacts */ public List getContacts(ProfileField key, F value, Integer limit, Integer offset, ProfileType type, - ContactOrder order) { + ContactOrder order, ContactType contactType) { WebResource resource = getResourceFactory().getApiResource("/contact/"); return getContactsCommon(resource, key, value, limit, offset, type, - order); + order, contactType); } /** @@ -169,16 +171,18 @@ public List getContacts(ProfileField key, F value, * The format in which the contacts should be returned * @param order * How the contacts should be ordered + * @param contactType + * The type of contacts to be returned * @return The list of contacts */ public List getOrganizationContacts(int organizationId, ProfileField key, F value, Integer limit, Integer offset, - ProfileType type, ContactOrder order) { + ProfileType type, ContactOrder order, ContactType contactType) { WebResource resource = getResourceFactory().getApiResource( "/contact/org/" + organizationId); return getContactsCommon(resource, key, value, limit, offset, type, - order); + order, contactType); } /** @@ -198,21 +202,23 @@ public List getOrganizationContacts(int organizationId, * The format in which the contacts should be returned * @param order * How the contacts should be ordered + * @param contactType + * The type of contacts to be returned * @return The list of contacts */ public List getSpaceContacts(int spaceId, ProfileField key, F value, Integer limit, Integer offset, - ProfileType type, ContactOrder order) { + ProfileType type, ContactOrder order, ContactType contactType) { WebResource resource = getResourceFactory().getApiResource( "/contact/space/" + spaceId); return getContactsCommon(resource, key, value, limit, offset, type, - order); + order, contactType); } private List getContactsCommon(WebResource resource, ProfileField key, F value, Integer limit, Integer offset, - final ProfileType type, ContactOrder order) { + final ProfileType type, ContactOrder order, ContactType contactType) { if (key != null && value != null) { resource = resource.queryParam("key", key.getName().toLowerCase()) .queryParam("value", key.format(value).toString()); @@ -227,7 +233,10 @@ private List getContactsCommon(WebResource resource, if (order != null) { resource = resource.queryParam("order", order.name().toLowerCase()); } - + if (contactType != null) { + resource = resource.queryParam("contact_type", contactType.name().toLowerCase()); + } + return resource.get(getGenericType(type)); } diff --git a/src/main/java/com/podio/contact/ContactType.java b/src/main/java/com/podio/contact/ContactType.java new file mode 100644 index 0000000..5e7a1e5 --- /dev/null +++ b/src/main/java/com/podio/contact/ContactType.java @@ -0,0 +1,14 @@ +package com.podio.contact; + +public enum ContactType { + + /** + * Contact of type user + */ + USER, + + /** + * A space contact + */ + SPACE; +} From 11c166597f56ace40eb979cb6dcce7268e8382e1 Mon Sep 17 00:00:00 2001 From: PetrFOX Date: Mon, 6 Jul 2015 23:48:40 +0200 Subject: [PATCH 4/4] The profile object updated with some missing address fields --- .../java/com/podio/contact/ProfileUpdate.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/main/java/com/podio/contact/ProfileUpdate.java b/src/main/java/com/podio/contact/ProfileUpdate.java index 25d265c..c66b4bc 100644 --- a/src/main/java/com/podio/contact/ProfileUpdate.java +++ b/src/main/java/com/podio/contact/ProfileUpdate.java @@ -44,6 +44,26 @@ public class ProfileUpdate { */ private String about; + /** + * The zip code of the address + */ + private String zip; + + /** + * The name of the city + */ + private String city; + + /** + * The name of the state, only applicable in some countries + */ + private String state; + + /** + * The name of the country + */ + private String country; + /** * The addresses where the person lives or work */ @@ -135,6 +155,38 @@ public void setAbout(String about) { this.about = about; } + public String getZip() { + return zip; + } + + public void setZip(String zip) { + this.zip = zip; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + @JsonProperty("address") public List getAddresses() { return addresses;