Class: Spotted::Resources::Me::Episodes
- Inherits:
-
Object
- Object
- Spotted::Resources::Me::Episodes
- Defined in:
- lib/spotted/resources/me/episodes.rb
Instance Method Summary collapse
-
#check(ids: , request_options: {}) ⇒ Array<Boolean>
Some parameter documentations has been truncated, see Models::Me::EpisodeCheckParams for more details.
-
#initialize(client:) ⇒ Episodes
constructor
private
A new instance of Episodes.
-
#list(limit: nil, market: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::Me::EpisodeListResponse>
Some parameter documentations has been truncated, see Models::Me::EpisodeListParams for more details.
-
#remove(body_ids: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Me::EpisodeRemoveParams for more details.
-
#save(body_ids: , request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Me::EpisodeSaveParams for more details.
Constructor Details
#initialize(client:) ⇒ Episodes
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 Episodes.
132 133 134 |
# File 'lib/spotted/resources/me/episodes.rb', line 132 def initialize(client:) @client = client end |
Instance Method Details
#check(ids: , request_options: {}) ⇒ Array<Boolean>
Some parameter documentations has been truncated, see Models::Me::EpisodeCheckParams for more details.
Check if one or more episodes is already saved in the current Spotify user’s ‘Your Episodes’ library.<br/> This API endpoint is in beta and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer)..
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/spotted/resources/me/episodes.rb', line 58 def check(params) parsed, = Spotted::Me::EpisodeCheckParams.dump_request(params) @client.request( method: :get, path: "me/episodes/contains", query: parsed, model: Spotted::Internal::Type::ArrayOf[Spotted::Internal::Type::Boolean], options: ) end |
#list(limit: nil, market: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::Me::EpisodeListResponse>
Some parameter documentations has been truncated, see Models::Me::EpisodeListParams for more details.
Get a list of the episodes saved in the current Spotify user’s library.<br/> This API endpoint is in beta and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer).
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/spotted/resources/me/episodes.rb', line 28 def list(params = {}) parsed, = Spotted::Me::EpisodeListParams.dump_request(params) @client.request( method: :get, path: "me/episodes", query: parsed, page: Spotted::Internal::CursorURLPage, model: Spotted::Models::Me::EpisodeListResponse, options: ) end |
#remove(body_ids: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Me::EpisodeRemoveParams for more details.
Remove one or more episodes from the current user’s library.<br/> This API endpoint is in beta and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer).
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/spotted/resources/me/episodes.rb', line 86 def remove(params = {}) parsed, = Spotted::Me::EpisodeRemoveParams.dump_request(params) query_params = [:query_ids] @client.request( method: :delete, path: "me/episodes", query: parsed.slice(*query_params).transform_keys(query_ids: "ids"), body: parsed.except(*query_params), model: NilClass, options: ) end |
#save(body_ids: , request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::Me::EpisodeSaveParams for more details.
Save one or more episodes to the current user’s library.<br/> This API endpoint is in beta and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer).
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/spotted/resources/me/episodes.rb', line 116 def save(params) parsed, = Spotted::Me::EpisodeSaveParams.dump_request(params) query_params = [:query_ids] @client.request( method: :put, path: "me/episodes", query: parsed.slice(*query_params).transform_keys(query_ids: "ids"), body: parsed.except(*query_params), model: NilClass, options: ) end |