Няма описание

WBHttpRequest+WeiboUser.h 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. //
  2. // WBHttpRequest+WeiboUser.h
  3. // WeiboSDK
  4. //
  5. // Created by DannionQiu on 14-9-23.
  6. // Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7. //
  8. #import "WBHttpRequest.h"
  9. @interface WBHttpRequest (WeiboUser)
  10. /*!
  11. @method
  12. @abstract
  13. Creates a request representing a Open API call to the "friendships/friends".
  14. @discussion
  15. Simplifies preparing a request and sending request to retrieve the user's friends.
  16. A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  17. user's friends.
  18. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/en
  19. @param currentUserID should be the current User's UserID which has been authorized.
  20. @param accessToken The token string.
  21. @param otherProperties Any additional properties for the Open API Request.
  22. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  23. @param handler the comletion block which will be executed after received response from Open API server.
  24. */
  25. + (WBHttpRequest *)requestForFriendsListOfUser:(NSString*)currentUserID
  26. withAccessToken:(NSString*)accessToken
  27. andOtherProperties:(NSDictionary*)otherProperties
  28. queue:(NSOperationQueue*)queue
  29. withCompletionHandler:(WBRequestHandler)handler;
  30. /*!
  31. @method
  32. @abstract
  33. Creates a request representing a Open API call to the "friendships/friends/ids".
  34. @discussion
  35. Simplifies preparing a request and sending request to retrieve the user's friends' UserID.
  36. A successful Open API call will return an NSDictionary of objects which contanis an array of NSString representing the
  37. user's friends' UserID.
  38. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/ids/en
  39. @param currentUserID should be the current User's UserID which has been authorized.
  40. @param accessToken The token string.
  41. @param otherProperties Any additional properties for the Open API Request.
  42. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  43. @param handler the comletion block which will be executed after received response from Open API server.
  44. */
  45. + (WBHttpRequest *)requestForFriendsUserIDListOfUser:(NSString*)currentUserID
  46. withAccessToken:(NSString*)accessToken
  47. andOtherProperties:(NSDictionary*)otherProperties
  48. queue:(NSOperationQueue*)queue
  49. withCompletionHandler:(WBRequestHandler)handler;
  50. /*!
  51. @method
  52. @abstract
  53. Creates a request representing a Open API call to the "friendships/friends/in_common".
  54. @discussion
  55. Simplifies preparing a request and sending request to retrieve the common friends list between two users..
  56. A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  57. user's friends.
  58. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/in_common/en
  59. @param currentUserID should be the current User's UserID which has been authorized.
  60. @param accessToken The token string.
  61. @param otherProperties Any additional properties for the Open API Request.
  62. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  63. @param handler the comletion block which will be executed after received response from Open API server.
  64. */
  65. + (WBHttpRequest *)requestForCommonFriendsListBetweenUser:(NSString*)currentUserID
  66. andUser:(NSString*)anotherUserID
  67. withAccessToken:(NSString*)accessToken
  68. andOtherProperties:(NSDictionary*)otherProperties
  69. queue:(NSOperationQueue*)queue
  70. withCompletionHandler:(WBRequestHandler)handler;
  71. /*!
  72. @method
  73. @abstract
  74. Creates a request representing a Open API call to the "friendships/friends/bilateral".
  75. @discussion
  76. Simplifies preparing a request and sending request to retrieve the list of the users that are following the specified user and are being followed by the specified user.
  77. A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  78. users that are following the specified user and are being followed by the specified user.
  79. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/bilateral/en
  80. @param currentUserID should be the current User's UserID which has been authorized.
  81. @param accessToken The token string.
  82. @param otherProperties Any additional properties for the Open API Request.
  83. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  84. @param handler the comletion block which will be executed after received response from Open API server.
  85. */
  86. + (WBHttpRequest *)requestForBilateralFriendsListOfUser:(NSString*)currentUserID
  87. withAccessToken:(NSString*)accessToken
  88. andOtherProperties:(NSDictionary*)otherProperties
  89. queue:(NSOperationQueue*)queue
  90. withCompletionHandler:(WBRequestHandler)handler;
  91. /*!
  92. @method
  93. @abstract
  94. Creates a request representing a Open API call to the "friendships/followers".
  95. @discussion
  96. Simplifies preparing a request and sending request to retrieve the user's followers.
  97. A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  98. user's followers.
  99. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/en
  100. @param currentUserID should be the current User's UserID which has been authorized.
  101. @param accessToken The token string.
  102. @param otherProperties Any additional properties for the Open API Request.
  103. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  104. @param handler the comletion block which will be executed after received response from Open API server.
  105. */
  106. + (WBHttpRequest *)requestForFollowersListOfUser:(NSString*)currentUserID
  107. withAccessToken:(NSString*)accessToken
  108. andOtherProperties:(NSDictionary*)otherProperties
  109. queue:(NSOperationQueue*)queue
  110. withCompletionHandler:(WBRequestHandler)handler;
  111. /*!
  112. @method
  113. @abstract
  114. Creates a request representing a Open API call to the "friendships/followers/ids".
  115. @discussion
  116. Simplifies preparing a request and sending request to retrieve the user's followers' UserID.
  117. A successful Open API call will return an NSDictionary of objects which contanis an array of NSString representing the
  118. user's followers' UserID.
  119. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/ids/en
  120. @param currentUserID should be the current User's UserID which has been authorized.
  121. @param accessToken The token string.
  122. @param otherProperties Any additional properties for the Open API Request.
  123. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  124. @param handler the comletion block which will be executed after received response from Open API server.
  125. */
  126. + (WBHttpRequest *)requestForFollowersUserIDListOfUser:(NSString*)currentUserID
  127. withAccessToken:(NSString*)accessToken
  128. andOtherProperties:(NSDictionary*)otherProperties
  129. queue:(NSOperationQueue*)queue
  130. withCompletionHandler:(WBRequestHandler)handler;
  131. /*!
  132. @method
  133. @abstract
  134. Creates a request representing a Open API call to the "friendships/followers/active".
  135. @discussion
  136. Simplifies preparing a request and sending request to retrieve the active(high quality) followers list of a user.
  137. A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the active(high quality) followers list of a user.
  138. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/active/en
  139. @param currentUserID should be the current User's UserID which has been authorized.
  140. @param accessToken The token string.
  141. @param otherProperties Any additional properties for the Open API Request.
  142. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  143. @param handler the comletion block which will be executed after received response from Open API server.
  144. */
  145. + (WBHttpRequest *)requestForActiveFollowersListOfUser:(NSString*)currentUserID
  146. withAccessToken:(NSString*)accessToken
  147. andOtherProperties:(NSDictionary*)otherProperties
  148. queue:(NSOperationQueue*)queue
  149. withCompletionHandler:(WBRequestHandler)handler;
  150. /*!
  151. @method
  152. @abstract
  153. Creates a request representing a Open API call to the "friendships/friends_chain/followers".
  154. @discussion
  155. Simplifies preparing a request and sending request to retrieve the users that are being followed by the authenticating user and are following the specified user.
  156. A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the users that are being followed by the authenticating user and are following the specified user.
  157. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends_chain/followers/en
  158. @param currentUserID should be the current User's UserID which has been authorized.
  159. @param accessToken The token string.
  160. @param otherProperties Any additional properties for the Open API Request.
  161. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  162. @param handler the comletion block which will be executed after received response from Open API server.
  163. */
  164. + (WBHttpRequest *)requestForBilateralFollowersListOfUser:(NSString*)currentUserID
  165. withAccessToken:(NSString*)accessToken
  166. andOtherProperties:(NSDictionary*)otherProperties
  167. queue:(NSOperationQueue*)queue
  168. withCompletionHandler:(WBRequestHandler)handler;
  169. /*!
  170. @method
  171. @abstract
  172. Creates a request representing a Open API call to the "friendships/show".
  173. @discussion
  174. Simplifies preparing a request and sending request to retrieve the relationship of two users.
  175. A successful Open API call will return an NSDictionary of objects which contanis the relationship of two users.
  176. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/show
  177. @param targetUserID a User ID
  178. @param sourceUserID a User ID
  179. @param accessToken The token string.
  180. @param otherProperties Any additional properties for the Open API Request.
  181. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  182. @param handler the comletion block which will be executed after received response from Open API server.
  183. */
  184. + (WBHttpRequest *)requestForFriendshipDetailBetweenTargetUser:(NSString*)targetUserID
  185. andSourceUser:(NSString*)sourceUserID
  186. withAccessToken:(NSString*)accessToken
  187. andOtherProperties:(NSDictionary*)otherProperties
  188. queue:(NSOperationQueue*)queue
  189. withCompletionHandler:(WBRequestHandler)handler;
  190. /*!
  191. @method
  192. @abstract
  193. Creates a request representing a Open API call to the "friendships/create".
  194. @discussion
  195. Simplifies preparing a request and sending request to Follow a user.
  196. A successful Open API call will return an <WeiboUser> object representing the user to be followed.
  197. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/create/en
  198. @param theUserToBeFollowed the userID of the user which you want to follow.
  199. @param accessToken The token string.
  200. @param otherProperties Any additional properties for the Open API Request.
  201. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  202. @param handler the comletion block which will be executed after received response from Open API server.
  203. */
  204. + (WBHttpRequest *)requestForFollowAUser:(NSString*)theUserToBeFollowed
  205. withAccessToken:(NSString*)accessToken
  206. andOtherProperties:(NSDictionary*)otherProperties
  207. queue:(NSOperationQueue*)queue
  208. withCompletionHandler:(WBRequestHandler)handler;
  209. /*!
  210. @method
  211. @abstract
  212. Creates a request representing a Open API call to the "friendships/destroy".
  213. @discussion
  214. Simplifies preparing a request and sending request to cancel following a user.
  215. A successful Open API call will return an <WeiboUser> object representing the user to be followed.
  216. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/destroy/en
  217. @param theUserThatYouDontLike the userID of the user which you want to cancel following.
  218. @param accessToken The token string.
  219. @param otherProperties Any additional properties for the Open API Request.
  220. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  221. @param handler the comletion block which will be executed after received response from Open API server.
  222. */
  223. + (WBHttpRequest *)requestForCancelFollowAUser:(NSString*)theUserThatYouDontLike
  224. withAccessToken:(NSString*)accessToken
  225. andOtherProperties:(NSDictionary*)otherProperties
  226. queue:(NSOperationQueue*)queue
  227. withCompletionHandler:(WBRequestHandler)handler;
  228. /*!
  229. @method
  230. @abstract
  231. Creates a request representing a Open API call to the "friendships/followers/destroy".
  232. @discussion
  233. Simplifies preparing a request and sending request to remove a follower of the authenticating user.
  234. A successful Open API call will return an <WeiboUser> object representing the user to be followed.
  235. this API requires advanced level authorization. You can see more details about advanced level authorization in http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#scope
  236. You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/destroy/en
  237. @param theUserThatYouDontLike the userID of the follower which you want to remove.
  238. @param accessToken The token string.
  239. @param otherProperties Any additional properties for the Open API Request.
  240. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  241. @param handler the comletion block which will be executed after received response from Open API server.
  242. */
  243. + (WBHttpRequest *)requestForRemoveFollowerUser:(NSString*)theUserThatYouDontLike
  244. withAccessToken:(NSString*)accessToken
  245. andOtherProperties:(NSDictionary*)otherProperties
  246. queue:(NSOperationQueue*)queue
  247. withCompletionHandler:(WBRequestHandler)handler;
  248. /*!
  249. @method
  250. @abstract
  251. Creates a request representing a Open API call to the "messages/invite".
  252. @discussion
  253. Simplifies preparing a request and sending request to send invitation to a bilateral friend of the authenticating user.
  254. A successful Open API call will return an NSDictionary of objects which contanis <WeiboUser> objects representing sender and receiver and other invitation details.
  255. You can see more details about this API in http://open.weibo.com/wiki/2/messages/invite
  256. @param theUserThatShouldBeYourBilateralFriend the userID of the follower which you want to remove.
  257. @param accessToken The token string.
  258. @param text The text content in your invitation message. should not be nil.
  259. @param url The url in your invitation message. can be nil.
  260. @param logoUrl The logoUrl in your invitation message. can be nil.
  261. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  262. @param handler the comletion block which will be executed after received response from Open API server.
  263. */
  264. + (WBHttpRequest *)requestForInviteBilateralFriend:(NSString*)theUserThatShouldBeYourBilateralFriend
  265. withAccessToken:(NSString*)accessToken
  266. inviteText:(NSString*)text
  267. inviteUrl:(NSString*)url
  268. inviteLogoUrl:(NSString*)logoUrl
  269. queue:(NSOperationQueue*)queue
  270. withCompletionHandler:(WBRequestHandler)handler;
  271. /*!
  272. @method
  273. @abstract
  274. Creates a request representing a Open API call to the "users/show".
  275. @discussion
  276. Simplifies preparing a request and sending request to retrieve user profile by user ID..
  277. A successful Open API call will return a <WeiboUser> object representing the user profile by user ID.
  278. You can see more details about this API in http://open.weibo.com/wiki/2/users/show/en
  279. @param aUserID a User ID.
  280. @param accessToken The token string.
  281. @param otherProperties Any additional properties for the Open API Request.
  282. @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  283. @param handler the comletion block which will be executed after received response from Open API server.
  284. */
  285. + (WBHttpRequest *)requestForUserProfile:(NSString*)aUserID
  286. withAccessToken:(NSString*)accessToken
  287. andOtherProperties:(NSDictionary*)otherProperties
  288. queue:(NSOperationQueue*)queue
  289. withCompletionHandler:(WBRequestHandler)handler;
  290. @end