/** * Update details of a particular user * * @param userId The user's ID * @param name User fields; */ public Users updateUser( long userId, String name, String bio, String baseLayer, boolean isTwitterAutoPost, boolean isInstagramAutoPost, boolean isTwitterAutoPostRetweets, @SessionToken String sessionToken) { checkId(userId); // Not sure how to send boolean value to the server. So turn true to 1 and false to 0 final int twitterAutoPost = isTwitterAutoPost ? 1 : 0; final int instagramAutoPost = isInstagramAutoPost ? 1 : 0; final int twitterAutoPostRetweet = isTwitterAutoPostRetweets ? 1 : 0; return mUserInterface.updateUser( userId, name, bio, baseLayer, twitterAutoPost, instagramAutoPost, twitterAutoPostRetweet, sessionToken); }
/** * Get a user by the ID * * @return The User */ public Users getUser(long userId) { checkId(userId); return mUserInterface.getUser(userId); }
/** * Get Posts a particular user has created * * @param userId The user's ID * @return Posts the user has created */ public Posts getUsersPosts(long userId) { checkId(userId); return mUserInterface.getUsersPosts(userId); }
/** * Mark a notification as read * * @param userId The user's ID * @return The user's notifications */ public Response markNotificationAsRead(long userId, @SessionToken String sessionToken) { checkId(userId); return mUserInterface.markNotificationAsRead(userId, sessionToken); }
/** * Get users registered on Crowdmap * * @return Users detail */ public Users getUsers() { return mUserInterface.getUsers(); }
/** * The map a user is associated with. * * @param userId The user's ID * @return The maps by the user. */ public Maps getUsersAssociatedMaps(long userId) { checkId(userId); return mUserInterface.getUsersAssociatedMaps(userId); }
/** * Get users notifications * * @param userId The user's ID to be used for fetching the notification details * @return The list of notifications */ public Notifications getNotifications(long userId) { checkId(userId); return mUserInterface.getNotifications(userId); }
/** * Get the map the user follows * * @param userId The user's ID * @return The map the user follows */ public Maps getUserFollowedMap(long userId) { checkId(userId); return mUserInterface.getUserFollowedMap(userId); }
/** * Get the map a user collaborates on. * * @param userId The user's ID * @return The maps the user collaborates on. */ public Maps getMapsUserCollaboratesOn(long userId) { checkId(userId); return mUserInterface.getMapsUserCollaboratesOn(userId); }
/** * Stop following a user * * @param userId The user's ID * @return The users the user follows without including the user the user stopped following. */ public Users stopFollowingUser(long userId, @SessionToken String sessionToken) { checkId(userId); return mUserInterface.stopFollowingUser(userId, sessionToken); }
/** * Verify that a user follows the provided user ID * * @return The Users */ public Users verifyUsersFollowing(long userId, long followerId) { checkId(userId); return mUserInterface.verifyUsersFollowing(userId, followerId); }
/** * Get Users followed by a particular users * * @param userId The user ID of the user to get his/her followers. * @return The users */ public Users getUsersFollowedBy(long userId) { return mUserInterface.getUsersFollowedBy(userId); }
/** * Delete a user's avatar * * @param userId The user's ID * @return The user. */ public Users deleteUserAvatar(long userId, @SessionToken String sessionToken) { checkId(userId); return mUserInterface.deleteUserAvatar(userId, sessionToken); }
/** * Update user avatar * * @param userId The user's ID * @return The updated user */ public Users updateUserAvatar(long userId, String avatar, @SessionToken String sessionToken) { checkId(userId); return mUserInterface.updateAvatar(userId, avatar, sessionToken); }