lib/access/api.rb in access-1.0.8 vs lib/access/api.rb in access-1.1.0

- old
+ new

@@ -1,66 +1,123 @@ module Access class Api < Request - ###offer + # Categories def search_categories(options = {}) get("/categories", "offer", options) end def find_category(category_id, options = {}) get("/categories/#{category_id}", "offer", options) end + + # Offers def search_offers(options={}) get("/offers", "offer", options) end def find_offer(offer_id, options = {}) get("/offers/#{offer_id}", "offer", options) end + + # Locations def search_locations(options={}) get("/locations", "offer", options) end def find_location(location_id, options = {}) get("/locations/#{location_id}", "offer", options) end + + # Stores def search_stores(options={}) get("/stores", "offer", options) end def find_store(store_id, options = {}) get("/stores/#{store_id}", "offer", options) end - ### auto complete + + # Autocomplete def autocomplete(options = {}) get("/autocomplete", "offer", options) end - ###token - def verify(options = {}) - get("/verify", "token", options) + + # Oauth Applications + def search_oauth_applications(options = {}) + get('/oauth_applications', 'token', options) end - def verify_other(token, options = {}) - get("/verify/#{token}", "token", options) + def find_oauth_application(application_id, options = {}) + get("/oauth_applications/#{application_id}", 'token', options) end + def search_oauth_application_tokens(application_id, options = {}) + get("/oauth_applications/#{application_id}/access_tokens", 'token', options) + end + + def find_oauth_application_token(application_id, token_id, options = {}) + get("/oauth_applications/#{application_id}/access_tokens/#{token_id}", 'token', options) + end + + def create_oauth_application_token(application_id, options = {}) + create("/oauth_applications/#{application_id}/access_tokens", 'token', options) + end + + def create_oauth_application(options = {}) + create("/oauth_applications", 'token', options) + end + + def update_oauth_application(application_id, options = {}) + put("/oauth_applications/#{application_id}", 'token', options) + end + + def delete_oauth_application(application_id, options = {}) + delete("/oauth_applications/#{application_id}", 'token', options) + end + + + # Access Tokens + def search_tokens(options = {}) + get('/tokens', 'token', options) + end + + def find_token(token, options = {}) # new verify_other + get("/tokens/#{token}", "token", options) + end + + + # Verify + def verify_token(options = {}) + get('/token', 'verify', options) + end + def verify_filter(options = {}) - get("/filter", "token", options) + get('/filter', 'verify', options) end - ###redeem + # def verify(options = {}) + # get("/verify", "token", options) + # end + + # def verify_filter(options = {}) + # get("/filter", "token", options) + # end + + + # Redeem def redeem_offer(offer_key, redeem_type = nil, options = {}) get("/redeem/#{offer_key}/#{redeem_type}", "redeem", options) end - ###report + # Report def all_usage(options = {}) get("/all_usage", "report", options) end def usage(options = {}) @@ -69,9 +126,10 @@ def usage_other(token, options = {}) get("/usage/#{token}", "report", options) end - ###member + + # Member end end