Package com.podio.user
Class UserAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.user.UserAPI
-
public class UserAPI extends BaseAPI
This area holds all the users which just includes basic operations.
-
-
Constructor Summary
Constructors Constructor Description UserAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteProperty(String key)Deletes the property for the active user with the given name.ProfilegetProfile()Returns the profile of the active user<T,R>
List<T>getProfileField(ProfileField<T,R> field)Returns the field of the profile for the given key from the active user.booleangetProperty(String key)Returns the value of the property for the active user with the given name.UserStatusgetStatus()Returns the current status for the user.UsergetUser()Gets the active uservoidsetProperty(String key, boolean value)Sets the value of the property for the active user with the given name.voidupdateProfile(ProfileFieldValues values)Updates the fields of an existing profile.voidupdateProfile(ProfileUpdate profile)Updates the fields of an existing profile.<F> voidupdateProfileField(ProfileField<F,?> field, F value)Updates a single field on the profile of the user<F> voidupdateProfileField(ProfileField<F,?> field, F... values)Updates a single field on the profile of the user<F> voidupdateProfileField(ProfileField<F,?> field, List<F> values)Updates a single field on the profile of the uservoidupdateUser(UserUpdate update)Updates the active user.-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
UserAPI
public UserAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
updateUser
public void updateUser(UserUpdate update)
Updates the active user. The old and new password can be left out, in which case the password will not be changed. If the mail is changed, the old password has to be supplied as well.
-
getStatus
public UserStatus getStatus()
Returns the current status for the user. This includes the user data, profile data and notification data.- Returns:
- The status of the user
-
getProfile
public Profile getProfile()
Returns the profile of the active user- Returns:
- The profile for the user
-
getProfileField
public <T,R> List<T> getProfileField(ProfileField<T,R> field)
Returns the field of the profile for the given key from the active user.- Parameters:
field- The field to return the values for- Returns:
- The values for the given field
-
updateProfile
public void updateProfile(ProfileUpdate profile)
Updates the fields of an existing profile. All fields must be filled out, as any fields not included will not be part of the new revision.- Parameters:
profile- The updated profile
-
updateProfileField
public <F> void updateProfileField(ProfileField<F,?> field, F value)
Updates a single field on the profile of the user- Parameters:
field- The field that should be updatedvalue- The new value of the field
-
updateProfileField
public <F> void updateProfileField(ProfileField<F,?> field, F... values)
Updates a single field on the profile of the user- Parameters:
field- The field that should be updatedvalues- The new values of the field
-
updateProfileField
public <F> void updateProfileField(ProfileField<F,?> field, List<F> values)
Updates a single field on the profile of the user- Parameters:
field- The field that should be updatedvalues- The new values of the field
-
updateProfile
public void updateProfile(ProfileFieldValues values)
Updates the fields of an existing profile. Will only update the fields in the values.- Parameters:
values- The updated values for the profile
-
getUser
public User getUser()
Gets the active user- Returns:
- The active user
-
getProperty
public boolean getProperty(String key)
Returns the value of the property for the active user with the given name. The property is specific to the auth client used.- Parameters:
key- The key of the property
-
setProperty
public void setProperty(String key, boolean value)
Sets the value of the property for the active user with the given name. The property is specific to the auth client used.- Parameters:
key- The key of the propertyvalue- The value of the property
-
deleteProperty
public void deleteProperty(String key)
Deletes the property for the active user with the given name. The property is specific to the auth client used.- Parameters:
key- The key of the property that should be deleted
-
-