Class LbPlaylistsApi

java.lang.Object
org.hihn.listenbrainz.LbPlaylistsApi

public class LbPlaylistsApi extends Object
  • Constructor Details

    • LbPlaylistsApi

      public LbPlaylistsApi()
    • LbPlaylistsApi

      public LbPlaylistsApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • getHostIndex

      public int getHostIndex()
    • setHostIndex

      public void setHostIndex(int hostIndex)
    • getCustomBaseUrl

      public String getCustomBaseUrl()
    • setCustomBaseUrl

      public void setCustomBaseUrl(String customBaseUrl)
    • appendRecordings

      public LbPlaylistsApi.APIappendRecordingsRequest appendRecordings(UUID playlistMbid, Integer offset, Playlist playlist)
      Append recordings to an existing playlist by posting a playlist with one of more recordings in it. The playlist must be in JSPF format with MusicBrainz extensions, which is defined here: https://musicbrainz.org/doc/jspf . If the offset is provided in the URL, then the recordings will be added at that offset, otherwise they will be added at the end of the playlist.
      Parameters:
      playlistMbid - The playlist mbid to append to. (required)
      offset - Offset. (required)
      playlist - (required)
      Returns:
      APIappendRecordingsRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Playlist accepted. -
      400 Invalid JSON sent, see error message for details. -
      401 Invalid authorization. See error message for details. -
      403 Forbidden. The requesting user was not allowed to carry out this operation. -
    • copyPlaylist

      public LbPlaylistsApi.APIcopyPlaylistRequest copyPlaylist(UUID playlistMbid)
      Copy a playlist - the new playlist will be given the name “Copy of <playlist_name>”. POST body data does not need to contain anything.
      Parameters:
      playlistMbid - The playlist mbid to append to. (required)
      Returns:
      APIcopyPlaylistRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Playlist copied. -
      401 Invalid authorization. See error message for details. -
      403 Forbidden. The requesting user was not allowed to carry out this operation. -
      404 Playlist not found. -
    • createPlaylist

      public LbPlaylistsApi.APIcreatePlaylistRequest createPlaylist(CreatePlaylistRequest createPlaylistRequest)
      Create a playlist Create a playlist. The playlist must be in JSPF format with MusicBrainz extensions, which is defined here: https://musicbrainz.org/doc/jspf . To create an empty playlist, you can send an empty playlist with only the title field filled out. If you would like to create a playlist populated with recordings, each of the track items in the playlist must have an identifier element that contains the MusicBrainz recording that includes the recording MBID. When creating a playlist, only the playlist title and the track identifier elements will be used - all other elements in the posted JSPF wil be ignored. If a created_for field is found and the user is not an approved playlist bot, then a 403 forbidden will be raised.
      Parameters:
      createPlaylistRequest - (required)
      Returns:
      APIcreatePlaylistRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Playlist accepted. -
      400 Invalid JSON sent. -
      401 Invalid authorization. -
      403 The submitting user is not allowed to create playlists for other users. -
    • deletePlaylist

      public LbPlaylistsApi.APIdeletePlaylistRequest deletePlaylist(UUID playlistMbid)
      Delete a playlist. POST body data does not need to contain anything.
      Parameters:
      playlistMbid - The playlist mbid to fetch. (required)
      Returns:
      APIdeletePlaylistRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Playlist deleted. -
      401 Invalid authorization. -
      403 The requesting user was not allowed to carry out this operation. -
      404 Playlist not found. -
    • editPlaylist

      public LbPlaylistsApi.APIeditPlaylistRequest editPlaylist(UUID playlistMbid, CreatePlaylistRequest createPlaylistRequest)
      Create a playlist. The playlist must be in JSPF format with MusicBrainz extensions, which is defined here: https://musicbrainz.org/doc/jspf . To create an empty playlist, you can send an empty playlist with only the title field filled out. If you would like to create a playlist populated with recordings, each of the track items in the playlist must have an identifier element that contains the MusicBrainz recording that includes the recording MBID. When creating a playlist, only the playlist title and the track identifier elements will be used - all other elements in the posted JSPF wil be ignored. If a created_for field is found and the user is not an approved playlist bot, then a 403 forbidden will be raised.
      Parameters:
      playlistMbid - The playlist mbid to edit. (required)
      createPlaylistRequest - (required)
      Returns:
      APIeditPlaylistRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Playlist accepted. -
      400 Invalid JSON sent. -
      401 Invalid authorization. -
      403 The submitting user is not allowed to create playlists for other users. -
    • fetchPlaylist

      public LbPlaylistsApi.APIfetchPlaylistRequest fetchPlaylist(UUID playlistMbid)
      Fetch the given playlist.
      Parameters:
      playlistMbid - The playlist mbid to fetch. (required)
      Returns:
      APIfetchPlaylistRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Yay, you have data! -
      401 Invalid authorization. See error message for details. -
      404 Playlist not found. -
    • itemDelete

      public LbPlaylistsApi.APIitemDeleteRequest itemDelete(UUID playlistMbid, ItemDeleteRequest itemDeleteRequest)
      Delete an item in a playlist. To delete an item in a playlist, the POST data needs to specify the recording MBID and current index of the track to delete, and how many tracks from that position should be moved deleted.
      Parameters:
      playlistMbid - The playlist mbid to fetch. (required)
      itemDeleteRequest - (required)
      Returns:
      APIitemDeleteRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Playlist accepted. -
      400 Invalid JSON sent. -
      401 Invalid authorization. -
      403 The requesting user was not allowed to carry out this operation. -
    • moveItem

      public LbPlaylistsApi.APImoveItemRequest moveItem(UUID playlistMbid, MoveItemRequest moveItemRequest)
      To move an item in a playlist, the POST data needs to specify the recording MBID and current index of the track to move (from), where to move it to (to) and how many tracks from that position should be moved (count).
      Parameters:
      playlistMbid - The playlist mbid to append to. (required)
      moveItemRequest - (required)
      Returns:
      APImoveItemRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Move operation succeeded. -
      400 Invalid JSON sent, see error message for details. -
      401 Invalid authorization. See error message for details. -
      403 Forbidden. The requesting user was not allowed to carry out this operation. -
    • playlistsCreatedForUser

      public LbPlaylistsApi.APIplaylistsCreatedForUserRequest playlistsCreatedForUser(String playlistUserName)
      Fetch playlist metadata in JSPF format without recordings that have been created for the user.
      Parameters:
      playlistUserName - (required)
      Returns:
      APIplaylistsCreatedForUserRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Yay, you have data! -
      404 The requested user was not found. -
    • playlistsForUser

      public LbPlaylistsApi.APIplaylistsForUserRequest playlistsForUser(String playlistUserName)
      Fetch playlist metadata in JSPF format without recordings for the given user.
      Parameters:
      playlistUserName - (required)
      Returns:
      APIplaylistsForUserRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Yay, you have data! -
      404 The requested user was not found. -
    • playlistsForUserCollaborator

      public LbPlaylistsApi.APIplaylistsForUserCollaboratorRequest playlistsForUserCollaborator(String playlistUserName)
      Fetch playlist metadata in JSPF format without recordings for which a user is a collaborator. If a playlist is private, it will only be returned if the caller is authorized to edit that playlist.
      Parameters:
      playlistUserName - (required)
      Returns:
      APIplaylistsForUserCollaboratorRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Yay, you have data! -
      404 User not found. -
    • searchPlaylists

      public LbPlaylistsApi.APIsearchPlaylistsRequest searchPlaylists(String query)
      Search for playlists by name or description. The search query must be at least 3 characters long.
      Parameters:
      query - (required)
      Returns:
      APIsearchPlaylistsRequest
      Http Response Details:
      Status Code Description Response Headers
      200 Yay, you have data! -
      400 Invalid query string, see error message for details. -
      401 Invalid authorization. See error message for details. -