Package com.podio.contact
Class ContactAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.contact.ContactAPI
-
public class ContactAPI extends BaseAPI
Each user have a profile attached, that holds all the personal details of the user. This includes very basic information like the name and mail addresses, but can also include more advanced fields like billing address and IM addresses. Fields can have either one or multiple values. There can f.ex. only be one name, but multiple mail addresses. The value of a field can either be a string, a number or a date.
-
-
Constructor Summary
Constructors Constructor Description ContactAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddSpaceContact(int spaceId, ContactCreate create, boolean silent)Adds a new contact to the given space.voiddeleteSpaceContact(int profileId, boolean silent)Deletes a space contact.ProfilegetContact(int profileId)Returns all the contact details about the user with the given id.<T,R>
List<T>getContactField(int userId, ProfileField<T,R> field)Returns the value of a contact with the specific field<T,F,R>
List<T>getContacts(ProfileField<F,R> key, F value, Integer limit, Integer offset, ProfileType<T> type, ContactOrder order, ContactType contactType)Used to get a list of contacts for the user.ContactTotalgetContactTotal()Returns the total number of contacts by organization.<T,F,R>
List<T>getOrganizationContacts(int organizationId, ProfileField<F,R> key, F value, Integer limit, Integer offset, ProfileType<T> type, ContactOrder order, ContactType contactType)Returns all the profiles of the users contacts on the given organization<T,F,R>
List<T>getSpaceContacts(int spaceId, ProfileField<F,R> key, F value, Integer limit, Integer offset, ProfileType<T> type, ContactOrder order, ContactType contactType)Returns all the profiles of the users contacts on the given spaceSpaceContactTotalsgetSpaceContactTotals(int spaceId)Returns the total number of contacts on the spacevoidupdateSpaceContact(int profileId, ContactUpdate update, boolean silent, boolean hook)Updates the entire space contact.-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
ContactAPI
public ContactAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
addSpaceContact
public int addSpaceContact(int spaceId, ContactCreate create, boolean silent)Adds a new contact to the given space.- Parameters:
spaceId- The id of the space the contact should be added tocreate- The data for the new contactsilent- True if the create should be silent, false otherwise- Returns:
- The id of the newly created contact
-
updateSpaceContact
public void updateSpaceContact(int profileId, ContactUpdate update, boolean silent, boolean hook)Updates the entire space contact. Only fields which have values specified will be updated. To delete the contents of a field, pass an empty array for the value.- Parameters:
profileId- The id of the space contact to be updatedupdate- The data for the updatesilent- True if the update should be silent, false otherwisehook- True if hooks should be executed for the change, false otherwise
-
deleteSpaceContact
public void deleteSpaceContact(int profileId, boolean silent)Deletes a space contact.- Parameters:
profileId- The id of the space contact to be deletedsilent- True if the deletion should be silent, false otherwise
-
getContact
public Profile getContact(int profileId)
Returns all the contact details about the user with the given id.- Parameters:
profileId- The profile id of the user- Returns:
- The contact profile
-
getContactField
public <T,R> List<T> getContactField(int userId, ProfileField<T,R> field)
Returns the value of a contact with the specific field- Parameters:
userId- The id of the userfield- The field for which data should be returned- Returns:
- The list of values for the given field
-
getContactTotal
public ContactTotal getContactTotal()
Returns the total number of contacts by organization.- Returns:
- The list of contact totals by organization
-
getContacts
public <T,F,R> List<T> getContacts(ProfileField<F,R> key, F value, Integer limit, Integer offset, ProfileType<T> type, ContactOrder order, ContactType contactType)
Used to get a list of contacts for the user.- Parameters:
key- The profile field if the contacts should be filteredvalue- The value for the field if the contacts should be filteredlimit- The maximum number of contacts to returnoffset- The offset into the list of contactstype- The format in which the contacts should be returnedorder- How the contacts should be orderedcontactType- The type of contacts to be returned- Returns:
- The list of contacts
-
getOrganizationContacts
public <T,F,R> List<T> getOrganizationContacts(int organizationId, ProfileField<F,R> key, F value, Integer limit, Integer offset, ProfileType<T> type, ContactOrder order, ContactType contactType)
Returns all the profiles of the users contacts on the given organization- Parameters:
organizationId- The id of the organization the contacts should be returned fromkey- The profile field if the contacts should be filteredvalue- The value for the field if the contacts should be filteredlimit- The maximum number of contacts to returnoffset- The offset into the list of contactstype- The format in which the contacts should be returnedorder- How the contacts should be orderedcontactType- The type of contacts to be returned- Returns:
- The list of contacts
-
getSpaceContacts
public <T,F,R> List<T> getSpaceContacts(int spaceId, ProfileField<F,R> key, F value, Integer limit, Integer offset, ProfileType<T> type, ContactOrder order, ContactType contactType)
Returns all the profiles of the users contacts on the given space- Parameters:
spaceId- The id of the space the contacts should be returned fromkey- The profile field if the contacts should be filteredvalue- The value for the field if the contacts should be filteredlimit- The maximum number of contacts to returnoffset- The offset into the list of contactstype- The format in which the contacts should be returnedorder- How the contacts should be orderedcontactType- The type of contacts to be returned- Returns:
- The list of contacts
-
getSpaceContactTotals
public SpaceContactTotals getSpaceContactTotals(int spaceId)
Returns the total number of contacts on the space- Parameters:
spaceId- The id of the space the number of contacts should be returned from- Returns:
- The total number of space contacts
-
-