Class: Access::Api
- Inherits:
-
Object
- Object
- Access::Api
- Defined in:
- lib/access/api.rb
Instance Method Summary collapse
-
#all_usage(options = {}) ⇒ Object
Report.
-
#autocomplete(options = {}) ⇒ Object
Autocomplete.
- #create_oauth_application(options = {}) ⇒ Object
- #create_oauth_application_token(application_key, options = {}) ⇒ Object
- #delete_oauth_application(application_key, options = {}) ⇒ Object
- #favorites_create(resource_id, options = {}) ⇒ Object
- #favorites_delete(resource_id, options = {}) ⇒ Object
- #favorites_find(resource_id, options = {}) ⇒ Object
-
#favorites_search(options = {}) ⇒ Object
Favorites.
- #find_campaign(campaign_key, options = {}) ⇒ Object
- #find_category(category_key, options = {}) ⇒ Object
- #find_channel(channel_key, options = {}) ⇒ Object
- #find_filter(application_key, options = {}) ⇒ Object
- #find_location(location_key, options = {}) ⇒ Object
- #find_oauth_application(application_key, options = {}) ⇒ Object
- #find_oauth_application_token(application_key, token_key, options = {}) ⇒ Object
- #find_offer(offer_key, options = {}) ⇒ Object
- #find_offer_redemptions_by_member(member_key, usage_redeem_key, options = {}) ⇒ Object
- #find_offer_uses_remaining(offer_key, options = {}) ⇒ Object
- #find_spot(spot_key, options = {}) ⇒ Object
- #find_store(store_key, options = {}) ⇒ Object
- #find_token(token, options = {}) ⇒ Object
- #geolocation_find(options = {}) ⇒ Object
-
#geolocation_search(options = {}) ⇒ Object
Geolocation.
- #member_authentication(options = {}) ⇒ Object
- #member_location_frequent(member, options = {}) ⇒ Object
- #member_location_recent(member, options = {}) ⇒ Object
- #member_query_frequent(member, options = {}) ⇒ Object
- #member_query_recent(member, options = {}) ⇒ Object
-
#member_registration(options = {}) ⇒ Object
Member.
- #national_stores(options = {}) ⇒ Object
-
#redeem_offer(offer_key, redeem_type = nil, options = {}) ⇒ Object
Redeem.
-
#search_campaigns(options = {}) ⇒ Object
Campaign.
-
#search_categories(options = {}) ⇒ Object
Categories.
-
#search_channels(options = {}) ⇒ Object
Channel.
-
#search_city_savings(options = {}) ⇒ Object
CitySavings.
-
#search_filters(options = {}) ⇒ Object
Filters.
-
#search_locations(options = {}) ⇒ Object
Locations.
- #search_oauth_application_tokens(application_key, options = {}) ⇒ Object
-
#search_oauth_applications(options = {}) ⇒ Object
Oauth Applications.
-
#search_offer_redemptions_by_member(member_key, options = {}) ⇒ Object
Offer Redemptions.
-
#search_offers(options = {}) ⇒ Object
Offers.
- #search_spots_by_campaign(campaign_key, options = {}) ⇒ Object
-
#search_spots_by_channel(channel_key, options = {}) ⇒ Object
Spot.
-
#search_stores(options = {}) ⇒ Object
Stores.
-
#search_tokens(options = {}) ⇒ Object
Access Tokens.
- #update_oauth_application(application_key, batch = {}) ⇒ Object
- #usage(options = {}) ⇒ Object
- #usage_other(token, options = {}) ⇒ Object
- #verify_filter(filter, options = {}) ⇒ Object
-
#verify_token(options = {}) ⇒ Object
Verify.
Instance Method Details
#all_usage(options = {}) ⇒ Object
Report
273 274 275 276 277 278 |
# File 'lib/access/api.rb', line 273 def all_usage( = {}) # Internal Admin only Call request.get("/all_usage", "report", ) do |response| ReportResponse.new(response) end end |
#autocomplete(options = {}) ⇒ Object
Autocomplete
69 70 71 72 73 |
# File 'lib/access/api.rb', line 69 def autocomplete( = {}) request.get("/autocomplete", "offer", ) do |response| AutocompleteResponse.new(response) end end |
#create_oauth_application(options = {}) ⇒ Object
217 218 219 220 221 222 223 |
# File 'lib/access/api.rb', line 217 def create_oauth_application( = {}) # Internal Admin only Call request.create("/oauth_applications", 'token', ) do |response| OauthApplicationResponse.new(response) end # create("/oauth_applications", 'token', options) end |
#create_oauth_application_token(application_key, options = {}) ⇒ Object
208 209 210 211 212 213 214 215 |
# File 'lib/access/api.rb', line 208 def create_oauth_application_token(application_key, = {}) # Internal Admin only Call request.create("/oauth_applications/#{application_key}/access_tokens", 'token', ) do |response| # TokenResponse.new(response) # OauthApplicationResponse.new(response) end # create("/oauth_applications/#{application_key}/access_tokens", 'token', options) end |
#delete_oauth_application(application_key, options = {}) ⇒ Object
233 234 235 236 237 238 239 |
# File 'lib/access/api.rb', line 233 def delete_oauth_application(application_key, = {}) # Internal Admin only Call request.delete("/oauth_applications/#{application_key}", 'token', ) do |response| OauthApplication.new(response) end # delete("/oauth_applications/#{application_key}", 'token', options) end |
#favorites_create(resource_id, options = {}) ⇒ Object
332 333 334 335 336 |
# File 'lib/access/api.rb', line 332 def favorites_create(resource_id, = {}) request.post("/members/#{[:member_key]}/favorites/#{[:favorite_type]}/#{resource_id}", "mms", ) do |response| FavoriteResponse.new(response) end end |
#favorites_delete(resource_id, options = {}) ⇒ Object
338 339 340 341 342 |
# File 'lib/access/api.rb', line 338 def favorites_delete(resource_id, = {}) request.delete("/members/#{[:member_key]}/favorites/#{[:favorite_type]}/#{resource_id}", "mms", ) do |response| FavoriteResponse.new(response) end end |
#favorites_find(resource_id, options = {}) ⇒ Object
326 327 328 329 330 |
# File 'lib/access/api.rb', line 326 def favorites_find(resource_id, = {}) request.get("/members/#{[:member_key]}/favorites/#{[:favorite_type]}/#{resource_id}", "mms", ) do |response| FavoriteResponse.new(response) end end |
#favorites_search(options = {}) ⇒ Object
Favorites
320 321 322 323 324 |
# File 'lib/access/api.rb', line 320 def favorites_search( = {}) request.get("/members/#{[:member_key]}/favorites/#{[:favorite_type]}", "mms", ) do |response| FavoriteResponse.new(response) end end |
#find_campaign(campaign_key, options = {}) ⇒ Object
110 111 112 113 114 |
# File 'lib/access/api.rb', line 110 def find_campaign(campaign_key, = {}) request.get("/campaigns/#{campaign_key}", "campaign", ) do |response| CampaignResponse.new(response) end end |
#find_category(category_key, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/access/api.rb', line 11 def find_category(category_key, = {}) request.get("/categories/#{category_key}", "offer", ) do |response| CategoryResponse.new(response) end end |
#find_channel(channel_key, options = {}) ⇒ Object
97 98 99 100 101 |
# File 'lib/access/api.rb', line 97 def find_channel(channel_key, = {}) request.get("/channels/#{channel_key}", "campaign", ) do |response| ChannelResponse.new(response) end end |
#find_filter(application_key, options = {}) ⇒ Object
172 173 174 175 176 177 |
# File 'lib/access/api.rb', line 172 def find_filter(application_key, = {}) # Internal Admin only Call request.get("/filters/#{application_key}", "token", ) do |response| FilterResponse.new(response) end end |
#find_location(location_key, options = {}) ⇒ Object
43 44 45 46 47 |
# File 'lib/access/api.rb', line 43 def find_location(location_key, = {}) request.get("/locations/#{location_key}", "offer", ) do |response| LocationResponse.new(response) end end |
#find_oauth_application(application_key, options = {}) ⇒ Object
187 188 189 190 191 192 |
# File 'lib/access/api.rb', line 187 def find_oauth_application(application_key, = {}) # Internal Admin only Call request.get("/oauth_applications/#{application_key}", 'token', ) do |response| OauthApplicationResponse.new(response) end end |
#find_oauth_application_token(application_key, token_key, options = {}) ⇒ Object
201 202 203 204 205 206 |
# File 'lib/access/api.rb', line 201 def find_oauth_application_token(application_key, token_key, = {}) # Internal Admin only Call request.get("/oauth_applications/#{application_key}/access_tokens/#{token_key}", 'token', ) do |response| TokenResponse.new(response) end end |
#find_offer(offer_key, options = {}) ⇒ Object
24 25 26 27 28 |
# File 'lib/access/api.rb', line 24 def find_offer(offer_key, = {}) request.get("/offers/#{offer_key}", "offer", ) do |response| OfferResponse.new(response) end end |
#find_offer_redemptions_by_member(member_key, usage_redeem_key, options = {}) ⇒ Object
156 157 158 159 160 |
# File 'lib/access/api.rb', line 156 def find_offer_redemptions_by_member(member_key, usage_redeem_key, = {}) request.get("/members/#{member_key}/offer_redemptions/#{usage_redeem_key}", "report", ) do |response| RedemptionResponse.new(response) end end |
#find_offer_uses_remaining(offer_key, options = {}) ⇒ Object
30 31 32 33 34 |
# File 'lib/access/api.rb', line 30 def find_offer_uses_remaining(offer_key, = {}) request.get("/offers/#{offer_key}/uses_remaining", "offer", ) do |response| OfferResponse.new(response) end end |
#find_spot(spot_key, options = {}) ⇒ Object
129 130 131 132 133 |
# File 'lib/access/api.rb', line 129 def find_spot(spot_key, = {}) request.get("/spots/#{spot_key}", "campaign", ) do |response| SpotResponse.new(response) end end |
#find_store(store_key, options = {}) ⇒ Object
56 57 58 59 60 |
# File 'lib/access/api.rb', line 56 def find_store(store_key, = {}) request.get("/stores/#{store_key}", "offer", ) do |response| StoreResponse.new(response) end end |
#find_token(token, options = {}) ⇒ Object
249 250 251 252 253 254 255 |
# File 'lib/access/api.rb', line 249 def find_token(token, = {}) # Internal Admin only Call # new verify_other request.get("/tokens/#{token}", "token", ) do |response| TokenResponse.new(response) end end |
#geolocation_find(options = {}) ⇒ Object
352 353 354 355 356 |
# File 'lib/access/api.rb', line 352 def geolocation_find( = {}) request.get('/geolocation/find_location', 'offer', ) do |response| GeolocationResponse.new(response) end end |
#geolocation_search(options = {}) ⇒ Object
Geolocation
346 347 348 349 350 |
# File 'lib/access/api.rb', line 346 def geolocation_search( = {}) request.get('/geolocation', 'offer', ) do |response| GeolocationResponse.new(response) end end |
#member_authentication(options = {}) ⇒ Object
142 143 144 145 146 |
# File 'lib/access/api.rb', line 142 def member_authentication( = {}) request.post("/auth", "mms", ) do |response| MemberResponse.new(response) end end |
#member_location_frequent(member, options = {}) ⇒ Object
306 307 308 309 310 |
# File 'lib/access/api.rb', line 306 def member_location_frequent(member, = {}) request.get("/members/#{member}/locations/frequent", "report", ) do |response| ReportResponse.new(response) end end |
#member_location_recent(member, options = {}) ⇒ Object
312 313 314 315 316 |
# File 'lib/access/api.rb', line 312 def member_location_recent(member, = {}) request.get("/members/#{member}/locations/recent", "report", ) do |response| ReportResponse.new(response) end end |
#member_query_frequent(member, options = {}) ⇒ Object
294 295 296 297 298 |
# File 'lib/access/api.rb', line 294 def member_query_frequent(member, = {}) request.get("/members/#{member}/queries/frequent", "report", ) do |response| ReportResponse.new(response) end end |
#member_query_recent(member, options = {}) ⇒ Object
300 301 302 303 304 |
# File 'lib/access/api.rb', line 300 def member_query_recent(member, = {}) request.get("/members/#{member}/queries/recent", "report", ) do |response| ReportResponse.new(response) end end |
#member_registration(options = {}) ⇒ Object
Member
136 137 138 139 140 |
# File 'lib/access/api.rb', line 136 def member_registration( = {}) request.post("/register", "mms", ) do |response| MemberResponse.new(response) end end |
#national_stores(options = {}) ⇒ Object
62 63 64 65 66 |
# File 'lib/access/api.rb', line 62 def national_stores(={}) request.get("/stores/national", "offer", ) do |response| StoreResponse.new(response) end end |
#redeem_offer(offer_key, redeem_type = nil, options = {}) ⇒ Object
Redeem
76 77 78 79 80 |
# File 'lib/access/api.rb', line 76 def redeem_offer(offer_key, redeem_type = nil, = {}) request.get("/redeem/#{offer_key}/#{redeem_type}", "redeem", ) do |response| RedeemResponse.new(response) end end |
#search_campaigns(options = {}) ⇒ Object
Campaign
104 105 106 107 108 |
# File 'lib/access/api.rb', line 104 def search_campaigns( = {}) request.get("/campaigns", "campaign", ) do |response| CampaignResponse.new(response) end end |
#search_categories(options = {}) ⇒ Object
Categories
5 6 7 8 9 |
# File 'lib/access/api.rb', line 5 def search_categories( = {}) request.get("/categories", "offer", ) do |response| CategoryResponse.new(response) end end |
#search_channels(options = {}) ⇒ Object
Channel
91 92 93 94 95 |
# File 'lib/access/api.rb', line 91 def search_channels( = {}) request.get("/channels", "campaign", ) do |response| ChannelResponse.new(response) end end |
#search_city_savings(options = {}) ⇒ Object
CitySavings
83 84 85 86 87 88 |
# File 'lib/access/api.rb', line 83 def search_city_savings( = {}) # this is broken request.get("/citysavings", "allcitysavings", ) do |response| CitySavingsResponse.new(response) end end |
#search_filters(options = {}) ⇒ Object
Filters
165 166 167 168 169 170 |
# File 'lib/access/api.rb', line 165 def search_filters( = {}) # Internal Admin only Call request.get("/filters", "token", ) do |response| FilterResponse.new(response) end end |
#search_locations(options = {}) ⇒ Object
Locations
37 38 39 40 41 |
# File 'lib/access/api.rb', line 37 def search_locations( = {}) request.get("/locations", "offer", ) do |response| LocationResponse.new(response) end end |
#search_oauth_application_tokens(application_key, options = {}) ⇒ Object
194 195 196 197 198 199 |
# File 'lib/access/api.rb', line 194 def search_oauth_application_tokens(application_key, = {}) # Internal Admin only Call request.get("/oauth_applications/#{application_key}/access_tokens", 'token', ) do |response| TokenResponse.new(response) end end |
#search_oauth_applications(options = {}) ⇒ Object
Oauth Applications
180 181 182 183 184 185 |
# File 'lib/access/api.rb', line 180 def search_oauth_applications( = {}) # Internal Admin only Call request.get("/oauth_applications", 'token', ) do |response| OauthApplicationResponse.new(response) end end |
#search_offer_redemptions_by_member(member_key, options = {}) ⇒ Object
Offer Redemptions
150 151 152 153 154 |
# File 'lib/access/api.rb', line 150 def search_offer_redemptions_by_member(member_key, = {}) request.get("/members/#{member_key}/offer_redemptions", "report", ) do |response| RedemptionResponse.new(response) end end |
#search_offers(options = {}) ⇒ Object
Offers
18 19 20 21 22 |
# File 'lib/access/api.rb', line 18 def search_offers( = {}) request.get("/offers", "offer", ) do |response| OfferResponse.new(response) end end |
#search_spots_by_campaign(campaign_key, options = {}) ⇒ Object
123 124 125 126 127 |
# File 'lib/access/api.rb', line 123 def search_spots_by_campaign(campaign_key, = {}) request.get("/spots/campaign/#{campaign_key}", "campaign", ) do |response| SpotResponse.new(response) end end |
#search_spots_by_channel(channel_key, options = {}) ⇒ Object
Spot
117 118 119 120 121 |
# File 'lib/access/api.rb', line 117 def search_spots_by_channel(channel_key, = {}) request.get("/spots/channel/#{channel_key}", "campaign", ) do |response| SpotResponse.new(response) end end |
#search_stores(options = {}) ⇒ Object
Stores
50 51 52 53 54 |
# File 'lib/access/api.rb', line 50 def search_stores( = {}) request.get("/stores", "offer", ) do |response| StoreResponse.new(response) end end |
#search_tokens(options = {}) ⇒ Object
Access Tokens
242 243 244 245 246 247 |
# File 'lib/access/api.rb', line 242 def search_tokens( = {}) # Internal Admin only Call request.get("/tokens", 'token', ) do |response| TokenResponse.new(response) end end |
#update_oauth_application(application_key, batch = {}) ⇒ Object
225 226 227 228 229 230 231 |
# File 'lib/access/api.rb', line 225 def update_oauth_application(application_key, batch= {}) # Internal Admin only Call request.put("/oauth_applications/#{application_key}", 'token', ) do |response| OauthApplicationResponse.new(response) end # put("/oauth_applications/#{application_key}", 'token', options) end |
#usage(options = {}) ⇒ Object
280 281 282 283 284 285 |
# File 'lib/access/api.rb', line 280 def usage( = {}) # Internal Admin only Call request.get("/usage", "report", ) do |response| ReportResponse.new(response) end end |
#usage_other(token, options = {}) ⇒ Object
287 288 289 290 291 292 |
# File 'lib/access/api.rb', line 287 def usage_other(token, = {}) # Internal Admin only Call request.get("/usage/#{token}", "report", ) do |response| ReportResponse.new(response) end end |
#verify_filter(filter, options = {}) ⇒ Object
265 266 267 268 269 270 |
# File 'lib/access/api.rb', line 265 def verify_filter(filter, = {}) # Internal Admin only Call request.post_for_filter("/filter", 'token', filter, ) do |response| VerifyResponse.new(response) end end |
#verify_token(options = {}) ⇒ Object
Verify
258 259 260 261 262 263 |
# File 'lib/access/api.rb', line 258 def verify_token( = {}) # Internal Admin only Call request.get("/verify", 'token', ) do |response| VerifyResponse.new(response) end end |