public interface FriendshipMethods
Modifier and Type | Method and Description |
---|---|
User |
createFriendship(int userId)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. |
User |
createFriendship(int userId,
boolean follow)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. |
User |
createFriendship(java.lang.String screenName)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. |
User |
createFriendship(java.lang.String screenName,
boolean follow)
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. |
User |
destroyFriendship(int userId)
Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. |
User |
destroyFriendship(java.lang.String screenName)
Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. |
boolean |
existsFriendship(java.lang.String userA,
java.lang.String userB)
Tests for the existence of friendship between two users.
|
IDs |
getIncomingFriendships(long cursor)
Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
|
IDs |
getOutgoingFriendships(long cursor)
Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
|
ResponseList<Friendship> |
lookupFriendships(int[] ids)
Returns the relationship of the authenticating user to the specified users.
|
ResponseList<Friendship> |
lookupFriendships(java.lang.String[] screenNames)
Returns the relationship of the authenticating user to the specified users.
|
Relationship |
showFriendship(int sourceId,
int targetId)
Returns detailed information about the relationship between two users.
|
Relationship |
showFriendship(java.lang.String sourceScreenName,
java.lang.String targetScreenName)
Returns detailed information about the relationship between two users.
|
Relationship |
updateFriendship(int userId,
boolean enableDeviceNotification,
boolean retweets)
Allows you to enable or disable retweets and device notifications from the specified user.
|
Relationship |
updateFriendship(java.lang.String screenName,
boolean enableDeviceNotification,
boolean retweets)
Allows you to enable or disable retweets and device notifications from the specified user.
|
User createFriendship(java.lang.String screenName) throws TwitterException
screenName
- the screen name of the user to be befriendedTwitterException
- when Twitter service or network is unavailableUser createFriendship(int userId) throws TwitterException
userId
- the ID of the user to be befriendedTwitterException
- when Twitter service or network is unavailableUser createFriendship(java.lang.String screenName, boolean follow) throws TwitterException
screenName
- the screen name of the user to be befriendedfollow
- Enable notifications for the target user in addition to becoming friends.TwitterException
- when Twitter service or network is unavailableUser createFriendship(int userId, boolean follow) throws TwitterException
userId
- the ID of the user to be befriendedfollow
- Enable notifications for the target user in addition to becoming friends.TwitterException
- when Twitter service or network is unavailableUser destroyFriendship(java.lang.String screenName) throws TwitterException
screenName
- the screen name of the user for whom to request a list of friendsTwitterException
- when Twitter service or network is unavailableUser destroyFriendship(int userId) throws TwitterException
userId
- the ID of the user for whom to request a list of friendsTwitterException
- when Twitter service or network is unavailableboolean existsFriendship(java.lang.String userA, java.lang.String userB) throws TwitterException
userA
- The ID or screen_name of the first user to test friendship for.userB
- The ID or screen_name of the second user to test friendship for.TwitterException
- when Twitter service or network is unavailableRelationship showFriendship(java.lang.String sourceScreenName, java.lang.String targetScreenName) throws TwitterException
sourceScreenName
- the screen name of the source usertargetScreenName
- the screen name of the target userTwitterException
- when Twitter service or network is unavailableRelationship showFriendship(int sourceId, int targetId) throws TwitterException
sourceId
- the screen ID of the source usertargetId
- the screen ID of the target userTwitterException
- when Twitter service or network is unavailableIDs getIncomingFriendships(long cursor) throws TwitterException
cursor
- Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.TwitterException
- when Twitter service or network is unavailableIDs getOutgoingFriendships(long cursor) throws TwitterException
cursor
- Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.TwitterException
- when Twitter service or network is unavailableResponseList<Friendship> lookupFriendships(java.lang.String[] screenNames) throws TwitterException
screenNames
- array of the screen names to lookupTwitterException
- when Twitter service or network is unavailableResponseList<Friendship> lookupFriendships(int[] ids) throws TwitterException
ids
- array of the ids to lookupTwitterException
- when Twitter service or network is unavailableRelationship updateFriendship(java.lang.String screenName, boolean enableDeviceNotification, boolean retweets) throws TwitterException
screenName
- screen name to updateenableDeviceNotification
- set true to enable device notificationretweets
- set true to enable retweetsTwitterException
- when Twitter service or network is unavailableRelationship updateFriendship(int userId, boolean enableDeviceNotification, boolean retweets) throws TwitterException
userId
- user id to updateenableDeviceNotification
- set true to enable device notificationretweets
- set true to enable retweetsTwitterException
- when Twitter service or network is unavailable