Package org.hihn.listenbrainz
Class LbSocialApi
java.lang.Object
org.hihn.listenbrainz.LbSocialApi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
class
class
class
class
class
class
class
class
class
class
class
class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNotification
(String userName, CreateNotificationRequest createNotificationRequest) Post a message with a link on a user's timeline.createReview
(String userName, CreateReviewRequest createReviewRequest) Creates a CritiqueBrainz review event for the user.feedEvents
(String userName) CreatGet feed events for a user's timeline.feedEventsDelete
(String userName, FeedEventsDeleteRequest feedEventsDeleteRequest) Delete those events from user's feed that belong to them.feedEventsHide
(String userName, FeedEventsDeleteRequest feedEventsDeleteRequest) Hide events from the user feed, only recording_recommendation and recording_pin events that have been generated by the people one is following can be deleted via this endpoint.feedEventsListensFollowing
(String userName) Get feed's listen events for followed users.feedEventsListensSimilar
(String userName) Get feed's listen events for similar users.feedEventsUnhide
(String userName, FeedEventsDeleteRequest feedEventsDeleteRequest) Delete hidden events from the user feed, aka unhide events.Follow the user 'user_name'.Fetch the list of followers of the user 'user_name'.Fetch the list of users followed by the user 'user_name'.int
recommendPersonalRecording
(String userName, RecommendPersonalRecordingRequest recommendPersonalRecordingRequest) Make the user recommend a recording to their followers.recommendRecording
(String userName, RecommendRecordingRequest recommendRecordingRequest) Make the user recommend a recording to their followers.void
setApiClient
(ApiClient apiClient) void
setCustomBaseUrl
(String customBaseUrl) void
setHostIndex
(int hostIndex) Unfollow the user 'user_name'.
-
Constructor Details
-
LbSocialApi
public LbSocialApi() -
LbSocialApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
createNotification
public LbSocialApi.APIcreateNotificationRequest createNotification(String userName, CreateNotificationRequest createNotificationRequest) Post a message with a link on a user's timeline. Only approved users are allowed to perform this action.- Parameters:
userName
- (required)createNotificationRequest
- (required)- Returns:
- APIcreateNotificationRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, message has been posted! - 400 Bad request. - 401 Unauthorized, you do not have permissions to recommend recordings on the behalf of this user. - 403 Forbidden, you are not an approved user. - 404 User not found. -
-
createReview
public LbSocialApi.APIcreateReviewRequest createReview(String userName, CreateReviewRequest createReviewRequest) Creates a CritiqueBrainz review event for the user. This also creates a corresponding review in CritiqueBrainz. Users need to have linked their ListenBrainz account with CritiqueBrainz first to use this endpoint successfully.- Parameters:
userName
- (required)createReviewRequest
- (required)- Returns:
- APIcreateReviewRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, message has been posted! - 400 Bad request. - 403 Forbidden, you have not linked with a CritiqueBrainz account. - 404 User not found. -
-
feedEvents
CreatGet feed events for a user's timeline.- Parameters:
userName
- (required)- Returns:
- APIfeedEventsRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, you have feed events! - 400 Bad request. - 401 Unauthorized, you do not have permission to view this user's feed. - 403 Forbidden, you do not have permission to view this user's feed. - 404 User not found. -
-
feedEventsDelete
public LbSocialApi.APIfeedEventsDeleteRequest feedEventsDelete(String userName, FeedEventsDeleteRequest feedEventsDeleteRequest) Delete those events from user's feed that belong to them. Supports deletion of recommendation and notification. Along with the authorization token, post the event type and event id.- Parameters:
userName
- (required)feedEventsDeleteRequest
- (required)- Returns:
- APIfeedEventsDeleteRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful deletion. - 400 Bad request. - 401 Unauthorized. - 403 Forbidden, you do not have permission to delete from this user's feed. - 404 User not found. - 500 API Internal Server Error. -
-
feedEventsHide
public LbSocialApi.APIfeedEventsHideRequest feedEventsHide(String userName, FeedEventsDeleteRequest feedEventsDeleteRequest) Hide events from the user feed, only recording_recommendation and recording_pin events that have been generated by the people one is following can be deleted via this endpoint.- Parameters:
userName
- (required)feedEventsDeleteRequest
- (required)- Returns:
- APIfeedEventsHideRequest
- Http Response Details:
Status Code Description Response Headers 200 Event hidden successfully. - 400 Bad request. - 401 Unauthorized. - 403 Forbidden, you don't have permissions to hide events from this user's timeline. - 404 User not found. - 500 API Internal Server Error. -
-
feedEventsListensFollowing
Get feed's listen events for followed users.- Parameters:
userName
- (required)- Returns:
- APIfeedEventsListensFollowingRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, you have feed listen-events! - 400 Bad request. - 401 Invalid authorization. See error message for details. - 403 Forbidden, you do not have permission to view this user's feed. - 404 User not found. -
-
feedEventsListensSimilar
Get feed's listen events for similar users.- Parameters:
userName
- (required)- Returns:
- APIfeedEventsListensSimilarRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, you have feed listen-events! - 400 Bad request. - 401 Invalid authorization. See error message for details. - 403 Forbidden, you do not have permission to view this user's feed. - 404 User not found. -
-
feedEventsUnhide
public LbSocialApi.APIfeedEventsUnhideRequest feedEventsUnhide(String userName, FeedEventsDeleteRequest feedEventsDeleteRequest) Delete hidden events from the user feed, aka unhide events.- Parameters:
userName
- (required)feedEventsDeleteRequest
- (required)- Returns:
- APIfeedEventsUnhideRequest
- Http Response Details:
Status Code Description Response Headers 200 Event unhidden successfully. - 400 Bad request. - 401 Unauthorized. - 403 Forbidden. - 404 User not found. - 500 API Internal Server Error. -
-
follow
Follow the user 'user_name'. A user token (found on https://listenbrainz.org/settings/ ) must be provided in the Authorization header!- Parameters:
userName
- (required)- Returns:
- APIfollowRequest
- Http Response Details:
Status Code Description Response Headers 200 Successfully followed the user 'user_name'. - 400 Already following the user user_name, or trying to follow yourself. - 401 Invalid authorization. See error message for details. -
-
followers
Fetch the list of followers of the user 'user_name'.- Parameters:
userName
- (required)- Returns:
- APIfollowersRequest
- Http Response Details:
Status Code Description Response Headers 200 Yay, you have data! - 400 Bad request. - 404 User not found. -
-
following
Fetch the list of users followed by the user 'user_name'.- Parameters:
userName
- (required)- Returns:
- APIfollowingRequest
- Http Response Details:
Status Code Description Response Headers 200 Yay, you have data! - 400 Bad request. - 404 User not found. -
-
recommendPersonalRecording
public LbSocialApi.APIrecommendPersonalRecordingRequest recommendPersonalRecording(String userName, RecommendPersonalRecordingRequest recommendPersonalRecordingRequest) Make the user recommend a recording to their followers. The request should post the following data about the recording being recommended (either one of recording_msid or recording_mbid is sufficient), and also the list of followers getting recommended.- Parameters:
userName
- (required)recommendPersonalRecordingRequest
- (required)- Returns:
- APIrecommendPersonalRecordingRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, recording has been recommended! - 400 Bad request. - 401 Unauthorized, you do not have permissions to recommend. -
-
recommendRecording
public LbSocialApi.APIrecommendRecordingRequest recommendRecording(String userName, RecommendRecordingRequest recommendRecordingRequest) Make the user recommend a recording to their followers.- Parameters:
userName
- (required)recommendRecordingRequest
- (required)- Returns:
- APIrecommendRecordingRequest
- Http Response Details:
Status Code Description Response Headers 200 Successful query, recording has been recommended! - 400 Bad request. - 401 Unauthorized, you do not have permissions to recommend recordings on the behalf of this user. - 403 Forbidden, you are not an approved user. - 404 User not found. -
-
unfollow
Unfollow the user 'user_name'. A user token (found on https://listenbrainz.org/settings/ ) must be provided in the Authorization header!- Parameters:
userName
- (required)- Returns:
- APIunfollowRequest
- Http Response Details:
Status Code Description Response Headers 200 Successfully unfollowed the user 'user_name'. - 401 Invalid authorization. See error message for details. -
-