public class UserResource extends BaseResource
apiClient, baseUrl, MAX_RESULTS, OM| Constructor and Description |
|---|
UserResource(GroupsIOApiClient apiClient,
String baseUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteSubscription(Subscription subscription) |
Subscription |
getSubscription(Integer groupId)
Gets a user's
Subscription for the specified group ID |
List<Subscription> |
getSubscriptions()
Gets a list of
Subscriptions that the current user is subscribed
to. |
User |
getUser()
Get the user information associated with the currently-logged in user.
|
void |
joinGroup(Integer groupId) |
Subscription |
updateSubscription(Subscription subscription) |
User |
updateUser(User user)
Update a user given a blank
User object with only the updated
fields set. |
callApi, callApi, loginpublic UserResource(GroupsIOApiClient apiClient, String baseUrl)
public User getUser() throws URISyntaxException, IOException, GroupsIOApiException
User representing the current userURISyntaxExceptionIOExceptionGroupsIOApiExceptionpublic Subscription getSubscription(Integer groupId) throws URISyntaxException, IOException, GroupsIOApiException
Subscription for the specified group IDSubscription for the specified group IDURISyntaxExceptionIOExceptionGroupsIOApiExceptionpublic List<Subscription> getSubscriptions() throws URISyntaxException, IOException, GroupsIOApiException
Subscriptions that the current user is subscribed
to.List<Subscription> representing the subscriptionsURISyntaxExceptionIOExceptionGroupsIOApiExceptionpublic User updateUser(User user) throws URISyntaxException, IOException, GroupsIOApiException
User object with only the updated
fields set.
Example:
final User userToUpdate = new User();
userToUpdate.setPerPagePref("user_per_page_pref50");
final User updatedUser = client.user().updateUser(userToUpdate);
user - - with only the updated fields setUser after a successful updateURISyntaxExceptionIOExceptionGroupsIOApiExceptionpublic Subscription updateSubscription(Subscription subscription)
public void deleteSubscription(Subscription subscription)
public void joinGroup(Integer groupId)
Copyright © 2017–2018. All rights reserved.