Class: Spotted::Resources::Playlists::Images
- Inherits:
-
Object
- Object
- Spotted::Resources::Playlists::Images
- Defined in:
- lib/spotted/resources/playlists/images.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Images
constructor
private
A new instance of Images.
-
#list(playlist_id, request_options: {}) ⇒ Array<Spotted::Models::ImageObject>
Some parameter documentations has been truncated, see Models::Playlists::ImageListParams for more details.
-
#update(playlist_id, body: , request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Playlists::ImageUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Images
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 Images.
61 62 63 |
# File 'lib/spotted/resources/playlists/images.rb', line 61 def initialize(client:) @client = client end |
Instance Method Details
#list(playlist_id, request_options: {}) ⇒ Array<Spotted::Models::ImageObject>
Some parameter documentations has been truncated, see Models::Playlists::ImageListParams for more details.
Get the current image associated with a specific playlist.
49 50 51 52 53 54 55 56 |
# File 'lib/spotted/resources/playlists/images.rb', line 49 def list(playlist_id, params = {}) @client.request( method: :get, path: ["playlists/%1$s/images", playlist_id], model: Spotted::Internal::Type::ArrayOf[Spotted::ImageObject], options: params[:request_options] ) end |
#update(playlist_id, body: , request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Playlists::ImageUpdateParams for more details.
Replace the image used to represent a specific playlist.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/spotted/resources/playlists/images.rb', line 23 def update(playlist_id, params) parsed, = Spotted::Playlists::ImageUpdateParams.dump_request(params) @client.request( method: :put, path: ["playlists/%1$s/images", playlist_id], headers: {"content-type" => "image/jpeg", "accept" => "application/binary"}, body: parsed[:body], model: StringIO, options: ) end |