Class: Spotted::Resources::Artists
- Inherits:
-
Object
- Object
- Spotted::Resources::Artists
- Defined in:
- lib/spotted/resources/artists.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Artists
constructor
private
A new instance of Artists.
-
#list(ids: , request_options: {}) ⇒ Spotted::Models::ArtistListResponse
Some parameter documentations has been truncated, see Models::ArtistListParams for more details.
-
#list_albums(id, include_groups: nil, limit: nil, market: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::ArtistListAlbumsResponse>
Some parameter documentations has been truncated, see Models::ArtistListAlbumsParams for more details.
- #list_related_artists(id, request_options: {}) ⇒ Spotted::Models::ArtistListRelatedArtistsResponse deprecated Deprecated.
-
#list_top_tracks(id, market: nil, request_options: {}) ⇒ Spotted::Models::ArtistListTopTracksResponse
Some parameter documentations has been truncated, see Models::ArtistListTopTracksParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Spotted::Models::ArtistObject
Some parameter documentations has been truncated, see Models::ArtistRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Artists
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 Artists.
145 146 147 |
# File 'lib/spotted/resources/artists.rb', line 145 def initialize(client:) @client = client end |
Instance Method Details
#list(ids: , request_options: {}) ⇒ Spotted::Models::ArtistListResponse
Some parameter documentations has been truncated, see Models::ArtistListParams for more details.
Get Spotify catalog information for several artists based on their Spotify IDs.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/spotted/resources/artists.rb', line 44 def list(params) parsed, = Spotted::ArtistListParams.dump_request(params) @client.request( method: :get, path: "artists", query: parsed, model: Spotted::Models::ArtistListResponse, options: ) end |
#list_albums(id, include_groups: nil, limit: nil, market: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::ArtistListAlbumsResponse>
Some parameter documentations has been truncated, see Models::ArtistListAlbumsParams for more details.
Get Spotify catalog information about an artist’s albums.
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/spotted/resources/artists.rb', line 77 def list_albums(id, params = {}) parsed, = Spotted::ArtistListAlbumsParams.dump_request(params) @client.request( method: :get, path: ["artists/%1$s/albums", id], query: parsed, page: Spotted::Internal::CursorURLPage, model: Spotted::Models::ArtistListAlbumsResponse, options: ) end |
#list_related_artists(id, request_options: {}) ⇒ Spotted::Models::ArtistListRelatedArtistsResponse
Some parameter documentations has been truncated, see Models::ArtistListRelatedArtistsParams for more details.
Get Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community’s listening history.
106 107 108 109 110 111 112 113 |
# File 'lib/spotted/resources/artists.rb', line 106 def (id, params = {}) @client.request( method: :get, path: ["artists/%1$s/related-artists", id], model: Spotted::Models::ArtistListRelatedArtistsResponse, options: params[:request_options] ) end |
#list_top_tracks(id, market: nil, request_options: {}) ⇒ Spotted::Models::ArtistListTopTracksResponse
Some parameter documentations has been truncated, see Models::ArtistListTopTracksParams for more details.
Get Spotify catalog information about an artist’s top tracks by country.
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/spotted/resources/artists.rb', line 131 def list_top_tracks(id, params = {}) parsed, = Spotted::ArtistListTopTracksParams.dump_request(params) @client.request( method: :get, path: ["artists/%1$s/top-tracks", id], query: parsed, model: Spotted::Models::ArtistListTopTracksResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Spotted::Models::ArtistObject
Some parameter documentations has been truncated, see Models::ArtistRetrieveParams for more details.
Get Spotify catalog information for a single artist identified by their unique Spotify ID.
21 22 23 24 25 26 27 28 |
# File 'lib/spotted/resources/artists.rb', line 21 def retrieve(id, params = {}) @client.request( method: :get, path: ["artists/%1$s", id], model: Spotted::ArtistObject, options: params[:request_options] ) end |