Class CreatePlaylistRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<Playlist,CreatePlaylistRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<Playlist,CreatePlaylistRequest.Builder>
se.michaelthelin.spotify.requests.data.playlists.CreatePlaylistRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<Playlist,
CreatePlaylistRequest.Builder>
- Enclosing class:
CreatePlaylistRequest
public static final class CreatePlaylistRequest.Builder
extends AbstractDataRequest.Builder<Playlist,CreatePlaylistRequest.Builder>
Builder class for building a
CreatePlaylistRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
the request build method.collaborative
(Boolean collaborative) The collaborative state setter.description
(String description) The playlist description setter.The playlist name setter.The public status setter.protected CreatePlaylistRequest.Builder
self()
Return this instance to simulate a self-type.The user ID setter.Methods inherited from class se.michaelthelin.spotify.requests.AbstractRequest.Builder
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setScheme
-
Constructor Details
-
Builder
Create a newCreatePlaylistRequest.Builder
.Creating a public playlists requires authorization of the
playlist-modify-public
scope; Creating a private playlist requires theplaylist-modify-private
scope.- Parameters:
accessToken
- Required. A valid access token from the Spotify Accounts service.- See Also:
-
-
Method Details
-
user_id
The user ID setter.- Parameters:
user_id
- The user's Spotify user ID.- Returns:
- A
CreatePlaylistRequest.Builder
. - See Also:
-
name
The playlist name setter.- Parameters:
name
- Optional. The name for the playlist. This name does not need to be unique; a user may have several playlists with the same name.- Returns:
- A
CreatePlaylistRequest.Builder
.
-
public_
The public status setter.Note: To be able to create private playlists, the user must have granted the
playlist-modify-private
scope.- Parameters:
public_
- Optional. Iftrue
the playlist will be public, iffalse
it will be private.- Returns:
- A
CreatePlaylistRequest.Builder
.
-
collaborative
The collaborative state setter.- Parameters:
collaborative
- Optional, defaultfalse
. Iftrue
the playlist will be collaborative. Note: To create a collaborative playlist you must also setpublic_(Boolean)
tofalse
. To create collaborative playlists you must have grantedplaylist-modify-private
andplaylist-modify-public
scopes.- Returns:
- A
CreatePlaylistRequest.Builder
.
-
description
The playlist description setter.- Parameters:
description
- Optional, value for playlist description as displayed in Spotify Clients and in the Web API.- Returns:
- A
CreatePlaylistRequest.Builder
.
-
build
the request build method.- Returns:
- A custom
CreatePlaylistRequest
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<Playlist,
CreatePlaylistRequest.Builder> - Returns:
- This instance.
-