Module: Echowrap::API::TasteProfile
Constant Summary
Constants included from Utils
Utils::API_KEY_CANNOT_CALL_THIS_METHOD, Utils::INVALID_PARAMETER, Utils::MISSING_OR_INVALID_KEY, Utils::MISSING_PARAMETER, Utils::RATE_LIMIT_EXCEEDED, Utils::SUCCESS
Instance Method Summary collapse
-
#taste_profile_ban(options = {}) ⇒ Boolean
Indicates that the given items have been banned or unbanned.
-
#taste_profile_create(options = {}) ⇒ Echowrap::TasteProfile
Creates a taste profile.
-
#taste_profile_delete(options = {}) ⇒ Echowrap::TasteProfile
Deletes the entire taste profile.
-
#taste_profile_favorite(options = {}) ⇒ Boolean
Indicates that the given items have been favorited or unfavorited.
-
#taste_profile_feed(options = {}) ⇒ Array
Returns feeds based on the artists in a taste profile.
-
#taste_profile_keyvalues(options = {}) ⇒ Echowrap::TasteProfile
Retrieve the catalog-level key/values that are stored in the Taste Profile.
-
#taste_profile_list(options = {}) ⇒ Array
Returns a list of all taste profiles created on this key.
-
#taste_profile_play(options = {}) ⇒ Boolean
Increment the playcount for the given items by the given count.
-
#taste_profile_predict(options = {}) ⇒ Echowrap::TasteProfile
Access the taste profile attributes.
-
#taste_profile_profile(options = {}) ⇒ Echowrap::TasteProfile
Get basic information on a taste profile.
-
#taste_profile_rate(options = {}) ⇒ Boolean
Apply the given rating to the given items.
-
#taste_profile_read(options = {}) ⇒ Echowrap::TasteProfile
Returns data stored in the taste profile.
-
#taste_profile_similar(options = {}) ⇒ Array
Returns a list of all taste profiles that are similar to the given set of taste profiles.
-
#taste_profile_skip(options = {}) ⇒ Boolean
Increment the skip count for the given items by the given count.
-
#taste_profile_status(options = {}) ⇒ Echowrap::Status
Checks the status of a taste profile update.
-
#taste_profile_update(options = {}) ⇒ Echowrap::TasteProfile
Updates (adds or deletes) items from a taste profile.
Instance Method Details
#taste_profile_ban(options = {}) ⇒ Boolean
Indicates that the given items have been banned or unbanned.
112 113 114 |
# File 'lib/echowrap/api/taste_profile.rb', line 112 def taste_profile_ban(={}) boolean_from_response(:get, '/api/v4/catalog/ban', ) end |
#taste_profile_create(options = {}) ⇒ Echowrap::TasteProfile
Creates a taste profile.
21 22 23 |
# File 'lib/echowrap/api/taste_profile.rb', line 21 def taste_profile_create(={}) object_from_response(Echowrap::TasteProfile, :post, '/api/v4/catalog/create', nil, ) end |
#taste_profile_delete(options = {}) ⇒ Echowrap::TasteProfile
Deletes the entire taste profile. Only the API key used to create a taste profile can be used to delete that taste profile.
181 182 183 |
# File 'lib/echowrap/api/taste_profile.rb', line 181 def taste_profile_delete(={}) object_from_response(Echowrap::TasteProfile, :post, '/api/v4/catalog/delete', nil, ) end |
#taste_profile_favorite(options = {}) ⇒ Boolean
Indicates that the given items have been favorited or unfavorited.
130 131 132 |
# File 'lib/echowrap/api/taste_profile.rb', line 130 def taste_profile_favorite(={}) boolean_from_response(:get, '/api/v4/catalog/favorite', ) end |
#taste_profile_feed(options = {}) ⇒ Array
Returns feeds based on the artists in a taste profile. Unlike catalog/read method, the catalog/feed method interleaves items and sorts them by date.
255 256 257 |
# File 'lib/echowrap/api/taste_profile.rb', line 255 def taste_profile_feed(={}) objects_from_response(Echowrap::Feed, :get, '/api/v4/catalog/feed', :feed, ) end |
#taste_profile_keyvalues(options = {}) ⇒ Echowrap::TasteProfile
Retrieve the catalog-level key/values that are stored in the Taste Profile
58 59 60 |
# File 'lib/echowrap/api/taste_profile.rb', line 58 def taste_profile_keyvalues(={}) object_from_response(Echowrap::TasteProfile, :get, '/api/v4/catalog/keyvalues', nil, ) end |
#taste_profile_list(options = {}) ⇒ Array
Returns a list of all taste profiles created on this key
165 166 167 |
# File 'lib/echowrap/api/taste_profile.rb', line 165 def taste_profile_list(={}) objects_from_response(Echowrap::TasteProfile, :get, '/api/v4/catalog/list', :catalogs, ) end |
#taste_profile_play(options = {}) ⇒ Boolean
Increment the playcount for the given items by the given count.
76 77 78 |
# File 'lib/echowrap/api/taste_profile.rb', line 76 def taste_profile_play(={}) boolean_from_response(:get, '/api/v4/catalog/play', ) end |
#taste_profile_predict(options = {}) ⇒ Echowrap::TasteProfile
Access the taste profile attributes.
291 292 293 |
# File 'lib/echowrap/api/taste_profile.rb', line 291 def taste_profile_predict(={}) object_from_response(Echowrap::TasteProfile, :get, '/api/v4/catalog/predict', :catalog, ) end |
#taste_profile_profile(options = {}) ⇒ Echowrap::TasteProfile
Get basic information on a taste profile
198 199 200 |
# File 'lib/echowrap/api/taste_profile.rb', line 198 def taste_profile_profile(={}) object_from_response(Echowrap::TasteProfile, :get, '/api/v4/catalog/profile', :catalog, ) end |
#taste_profile_rate(options = {}) ⇒ Boolean
Apply the given rating to the given items
148 149 150 |
# File 'lib/echowrap/api/taste_profile.rb', line 148 def taste_profile_rate(={}) boolean_from_response(:get, '/api/v4/catalog/rate', ) end |
#taste_profile_read(options = {}) ⇒ Echowrap::TasteProfile
Returns data stored in the taste profile. Also returns Echo Nest IDs for items that have been resolved to Echo Nest IDs along with information requested via bucket. If item_id is not set, all items (subject to the limits of the start and results parameters) are returned, otherwise, only the items explicitly specified by item_id are returned.
218 219 220 |
# File 'lib/echowrap/api/taste_profile.rb', line 218 def taste_profile_read(={}) object_from_response(Echowrap::TasteProfile, :get, '/api/v4/catalog/read', :catalog, ) end |
#taste_profile_similar(options = {}) ⇒ Array
Returns a list of all taste profiles that are similar to the given set of taste profiles. This method returns similar taste profiles of the given use type. Similarity search is restricted to taste profiles that were created with the caller’s API key.
274 275 276 |
# File 'lib/echowrap/api/taste_profile.rb', line 274 def taste_profile_similar(={}) objects_from_response(Echowrap::TasteProfile, :get, '/api/v4/catalog/similar', :catalogs, ) end |
#taste_profile_skip(options = {}) ⇒ Boolean
Increment the skip count for the given items by the given count
94 95 96 |
# File 'lib/echowrap/api/taste_profile.rb', line 94 def taste_profile_skip(={}) boolean_from_response(:get, '/api/v4/catalog/skip', ) end |
#taste_profile_status(options = {}) ⇒ Echowrap::Status
Checks the status of a taste profile update.
234 235 236 |
# File 'lib/echowrap/api/taste_profile.rb', line 234 def taste_profile_status(={}) object_from_response(Echowrap::Status, :get, '/api/v4/catalog/status', nil, ) end |
#taste_profile_update(options = {}) ⇒ Echowrap::TasteProfile
Updates (adds or deletes) items from a taste profile. The body of the post should include an item block that describes modifications to the taste profile.
38 39 40 41 42 43 44 |
# File 'lib/echowrap/api/taste_profile.rb', line 38 def taste_profile_update(={}) object_from_response(Echowrap::TasteProfile, :post, '/api/v4/catalog/update', nil, .merge({:data_type => 'json'})) end |