Class: Spotted::Resources::Users::Playlists
- Inherits:
-
Object
- Object
- Spotted::Resources::Users::Playlists
- Defined in:
- lib/spotted/resources/users/playlists.rb
Instance Method Summary collapse
-
#create(user_id, name: , collaborative: nil, description: nil, public: nil, request_options: {}) ⇒ Spotted::Models::Users::PlaylistCreateResponse
Some parameter documentations has been truncated, see Models::Users::PlaylistCreateParams for more details.
-
#initialize(client:) ⇒ Playlists
constructor
private
A new instance of Playlists.
-
#list(user_id, limit: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::SimplifiedPlaylistObject>
Some parameter documentations has been truncated, see Models::Users::PlaylistListParams for more details.
Constructor Details
#initialize(client:) ⇒ Playlists
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Playlists.
76 77 78 |
# File 'lib/spotted/resources/users/playlists.rb', line 76 def initialize(client:) @client = client end |
Instance Method Details
#create(user_id, name: , collaborative: nil, description: nil, public: nil, request_options: {}) ⇒ Spotted::Models::Users::PlaylistCreateResponse
Some parameter documentations has been truncated, see Models::Users::PlaylistCreateParams for more details.
Create a playlist for a Spotify user. (The playlist will be empty until you [add tracks](/documentation/web-api/reference/add-tracks-to-playlist).) Each user is generally limited to a maximum of 11000 playlists.
to
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/spotted/resources/users/playlists.rb', line 32 def create(user_id, params) parsed, = Spotted::Users::PlaylistCreateParams.dump_request(params) @client.request( method: :post, path: ["users/%1$s/playlists", user_id], body: parsed, model: Spotted::Models::Users::PlaylistCreateResponse, options: ) end |
#list(user_id, limit: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::SimplifiedPlaylistObject>
Some parameter documentations has been truncated, see Models::Users::PlaylistListParams for more details.
Get a list of the playlists owned or followed by a Spotify user.
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/spotted/resources/users/playlists.rb', line 61 def list(user_id, params = {}) parsed, = Spotted::Users::PlaylistListParams.dump_request(params) @client.request( method: :get, path: ["users/%1$s/playlists", user_id], query: parsed, page: Spotted::Internal::CursorURLPage, model: Spotted::SimplifiedPlaylistObject, options: ) end |