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_device(member_key, options = {}) ⇒ Object
- #find_filter(application_key, options = {}) ⇒ Object
- #find_hotel(hotel_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_program_provisioning_method(pcid) ⇒ Object
Program.
- #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.
- #get_shopping_cart_count(options = {}) ⇒ Object
-
#import_members(members, options = {}) ⇒ Object
AMT.
- #list_imports(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_show(member_key, options = {}) ⇒ Object
Member.
- #member_update(member_key, options = {}) ⇒ Object
- #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_devices(member_key, options = {}) ⇒ Object
Device.
-
#search_filters(options = {}) ⇒ Object
Filters.
-
#search_hotels(options = {}) ⇒ Object
Hotels.
-
#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_product_groups(options = {}) ⇒ Object
Product Groups.
- #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.
- #show_import(import_key, options = {}) ⇒ Object
- #update_oauth_application(application_key, batch = {}) ⇒ Object
- #usage(options = {}) ⇒ Object
- #usage_other(token, options = {}) ⇒ Object
- #user_authentication(options = {}) ⇒ Object
- #user_authentication_by_cvt(options = {}) ⇒ Object
- #user_authentication_by_member_key(options = {}) ⇒ Object
- #user_external_authentication(options = {}) ⇒ Object
- #user_external_authentication_by_token(options = {}) ⇒ Object
-
#user_registration(options = {}) ⇒ Object
User.
- #user_update(options = {}) ⇒ Object
- #verify_filter(filter, options = {}) ⇒ Object
-
#verify_token(options = {}) ⇒ Object
Verify.
Instance Method Details
#all_usage(options = {}) ⇒ Object
Report
355 356 357 358 359 360 |
# File 'lib/access/api.rb', line 355 def all_usage( = {}) # Internal Admin only Call request.get("/all_usage", "report", ) do |response| ReportResponse.new(response) end end |
#autocomplete(options = {}) ⇒ Object
Autocomplete
89 90 91 92 93 |
# File 'lib/access/api.rb', line 89 def autocomplete( = {}) request.get("/autocomplete", "offer", ) do |response| AutocompleteResponse.new(response) end end |
#create_oauth_application(options = {}) ⇒ Object
299 300 301 302 303 304 305 |
# File 'lib/access/api.rb', line 299 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
290 291 292 293 294 295 296 297 |
# File 'lib/access/api.rb', line 290 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
315 316 317 318 319 320 321 |
# File 'lib/access/api.rb', line 315 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
414 415 416 417 418 |
# File 'lib/access/api.rb', line 414 def favorites_create(resource_id, = {}) request.post("/members/#{.delete(:member_key)}/favorites/#{.delete(:favorite_type)}/#{resource_id}", "mms", ) do |response| FavoriteResponse.new(response) end end |
#favorites_delete(resource_id, options = {}) ⇒ Object
420 421 422 423 424 |
# File 'lib/access/api.rb', line 420 def favorites_delete(resource_id, = {}) request.delete("/members/#{.delete(:member_key)}/favorites/#{.delete(:favorite_type)}/#{resource_id}", "mms", ) do |response| FavoriteResponse.new(response) end end |
#favorites_find(resource_id, options = {}) ⇒ Object
408 409 410 411 412 |
# File 'lib/access/api.rb', line 408 def favorites_find(resource_id, = {}) request.get("/members/#{.delete(:member_key)}/favorites/#{.delete(:favorite_type)}/#{resource_id}", "report", ) do |response| FavoriteResponse.new(response) end end |
#favorites_search(options = {}) ⇒ Object
Favorites
402 403 404 405 406 |
# File 'lib/access/api.rb', line 402 def favorites_search( = {}) request.get("/members/#{.delete(:member_key)}/favorites/#{.delete(:favorite_type)}", "report", ) do |response| FavoriteResponse.new(response) end end |
#find_campaign(campaign_key, options = {}) ⇒ Object
130 131 132 133 134 |
# File 'lib/access/api.rb', line 130 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
117 118 119 120 121 |
# File 'lib/access/api.rb', line 117 def find_channel(channel_key, = {}) request.get("/channels/#{channel_key}", "campaign", ) do |response| ChannelResponse.new(response) end end |
#find_device(member_key, options = {}) ⇒ Object
218 219 220 221 222 |
# File 'lib/access/api.rb', line 218 def find_device(member_key, = {}) request.get("/members/#{member_key}/devices/#{.delete(:udid)}", 'mms', ) do |response| DeviceResponse.new(response) end end |
#find_filter(application_key, options = {}) ⇒ Object
254 255 256 257 258 259 |
# File 'lib/access/api.rb', line 254 def find_filter(application_key, = {}) # Internal Admin only Call request.get("/filters/#{application_key}", "token", ) do |response| FilterResponse.new(response) end end |
#find_hotel(hotel_key, options = {}) ⇒ Object
50 51 52 53 54 |
# File 'lib/access/api.rb', line 50 def find_hotel(hotel_key, = {}) request.get("/hotels/#{hotel_key}", "hotel", ) do |response| HotelResponse.new(response) end end |
#find_location(location_key, options = {}) ⇒ Object
63 64 65 66 67 |
# File 'lib/access/api.rb', line 63 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
269 270 271 272 273 274 |
# File 'lib/access/api.rb', line 269 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
283 284 285 286 287 288 |
# File 'lib/access/api.rb', line 283 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
238 239 240 241 242 |
# File 'lib/access/api.rb', line 238 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_program_provisioning_method(pcid) ⇒ Object
Program
225 226 227 228 229 |
# File 'lib/access/api.rb', line 225 def find_program_provisioning_method(pcid) request.get("/programs/#{pcid}", "mms") do |response| ProgramResponse.new(response) end end |
#find_spot(spot_key, options = {}) ⇒ Object
149 150 151 152 153 |
# File 'lib/access/api.rb', line 149 def find_spot(spot_key, = {}) request.get("/spots/#{spot_key}", "campaign", ) do |response| SpotResponse.new(response) end end |
#find_store(store_key, options = {}) ⇒ Object
76 77 78 79 80 |
# File 'lib/access/api.rb', line 76 def find_store(store_key, = {}) request.get("/stores/#{store_key}", "offer", ) do |response| StoreResponse.new(response) end end |
#find_token(token, options = {}) ⇒ Object
331 332 333 334 335 336 337 |
# File 'lib/access/api.rb', line 331 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
434 435 436 437 438 |
# File 'lib/access/api.rb', line 434 def geolocation_find( = {}) request.get('/geolocation/find_location', 'offer', ) do |response| GeolocationResponse.new(response) end end |
#geolocation_search(options = {}) ⇒ Object
Geolocation
428 429 430 431 432 |
# File 'lib/access/api.rb', line 428 def geolocation_search( = {}) request.get('/geolocation', 'offer', ) do |response| GeolocationResponse.new(response) end end |
#get_shopping_cart_count(options = {}) ⇒ Object
440 441 442 443 444 |
# File 'lib/access/api.rb', line 440 def get_shopping_cart_count(= {}) request.get('/cart/count', 'shoppingcart', ) do |response| ShoppingCartResponse.new(response) end end |
#import_members(members, options = {}) ⇒ Object
AMT
448 449 450 451 452 |
# File 'lib/access/api.rb', line 448 def import_members(members, = {}) request.post('/imports', 'amt', .merge({import: {members: members}})) do |response| AmtResponse.new(response) end end |
#list_imports(options = {}) ⇒ Object
454 455 456 457 458 |
# File 'lib/access/api.rb', line 454 def list_imports( = {}) request.get('/imports', 'amt', ) do |response| AmtResponse.new(response) end end |
#member_location_frequent(member, options = {}) ⇒ Object
388 389 390 391 392 |
# File 'lib/access/api.rb', line 388 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
394 395 396 397 398 |
# File 'lib/access/api.rb', line 394 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
376 377 378 379 380 |
# File 'lib/access/api.rb', line 376 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
382 383 384 385 386 |
# File 'lib/access/api.rb', line 382 def member_query_recent(member, = {}) request.get("/members/#{member}/queries/recent", "report", ) do |response| ReportResponse.new(response) end end |
#member_show(member_key, options = {}) ⇒ Object
Member
199 200 201 202 203 |
# File 'lib/access/api.rb', line 199 def member_show(member_key, = {}) request.get("/members/#{member_key}", 'mms', ) do |response| MemberResponse.new(response) end end |
#member_update(member_key, options = {}) ⇒ Object
205 206 207 208 209 |
# File 'lib/access/api.rb', line 205 def member_update(member_key, = {}) request.put("/members/#{member_key}?program_id=#{.delete(:program_id)}", 'mms', ) do |response| MemberResponse.new(response) end end |
#national_stores(options = {}) ⇒ Object
82 83 84 85 86 |
# File 'lib/access/api.rb', line 82 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
96 97 98 99 100 |
# File 'lib/access/api.rb', line 96 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
124 125 126 127 128 |
# File 'lib/access/api.rb', line 124 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
111 112 113 114 115 |
# File 'lib/access/api.rb', line 111 def search_channels( = {}) request.get("/channels", "campaign", ) do |response| ChannelResponse.new(response) end end |
#search_city_savings(options = {}) ⇒ Object
CitySavings
103 104 105 106 107 108 |
# File 'lib/access/api.rb', line 103 def search_city_savings( = {}) # this is broken request.get("/citysavings", "allcitysavings", ) do |response| CitySavingsResponse.new(response) end end |
#search_devices(member_key, options = {}) ⇒ Object
Device
212 213 214 215 216 |
# File 'lib/access/api.rb', line 212 def search_devices(member_key, = {}) request.get("/members/#{member_key}/devices", 'mms', ) do |response| DeviceResponse.new(response) end end |
#search_filters(options = {}) ⇒ Object
Filters
247 248 249 250 251 252 |
# File 'lib/access/api.rb', line 247 def search_filters( = {}) # Internal Admin only Call request.get("/filters", "token", ) do |response| FilterResponse.new(response) end end |
#search_hotels(options = {}) ⇒ Object
Hotels
44 45 46 47 48 |
# File 'lib/access/api.rb', line 44 def search_hotels( = {}) request.get("/hotels", "hotel", ) do |response| HotelResponse.new(response) end end |
#search_locations(options = {}) ⇒ Object
Locations
57 58 59 60 61 |
# File 'lib/access/api.rb', line 57 def search_locations( = {}) request.get("/locations", "offer", ) do |response| LocationResponse.new(response) end end |
#search_oauth_application_tokens(application_key, options = {}) ⇒ Object
276 277 278 279 280 281 |
# File 'lib/access/api.rb', line 276 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
262 263 264 265 266 267 |
# File 'lib/access/api.rb', line 262 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
232 233 234 235 236 |
# File 'lib/access/api.rb', line 232 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_product_groups(options = {}) ⇒ Object
Product Groups
37 38 39 40 41 |
# File 'lib/access/api.rb', line 37 def search_product_groups( = {}) request.get("/product_groups", "offer", ) do |response| ProductGroupResponse.new(response) end end |
#search_spots_by_campaign(campaign_key, options = {}) ⇒ Object
143 144 145 146 147 |
# File 'lib/access/api.rb', line 143 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
137 138 139 140 141 |
# File 'lib/access/api.rb', line 137 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
70 71 72 73 74 |
# File 'lib/access/api.rb', line 70 def search_stores( = {}) request.get("/stores", "offer", ) do |response| StoreResponse.new(response) end end |
#search_tokens(options = {}) ⇒ Object
Access Tokens
324 325 326 327 328 329 |
# File 'lib/access/api.rb', line 324 def search_tokens( = {}) # Internal Admin only Call request.get("/tokens", 'token', ) do |response| TokenResponse.new(response) end end |
#show_import(import_key, options = {}) ⇒ Object
460 461 462 463 464 |
# File 'lib/access/api.rb', line 460 def show_import(import_key, = {}) request.get("/imports/#{import_key}", 'amt', ) do |response| AmtResponse.new(response) end end |
#update_oauth_application(application_key, batch = {}) ⇒ Object
307 308 309 310 311 312 313 |
# File 'lib/access/api.rb', line 307 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
362 363 364 365 366 367 |
# File 'lib/access/api.rb', line 362 def usage( = {}) # Internal Admin only Call request.get("/usage", "report", ) do |response| ReportResponse.new(response) end end |
#usage_other(token, options = {}) ⇒ Object
369 370 371 372 373 374 |
# File 'lib/access/api.rb', line 369 def usage_other(token, = {}) # Internal Admin only Call request.get("/usage/#{token}", "report", ) do |response| ReportResponse.new(response) end end |
#user_authentication(options = {}) ⇒ Object
168 169 170 171 172 |
# File 'lib/access/api.rb', line 168 def user_authentication( = {}) request.post("/auth", "mms", ) do |response| UserResponse.new(response) end end |
#user_authentication_by_cvt(options = {}) ⇒ Object
174 175 176 177 178 |
# File 'lib/access/api.rb', line 174 def user_authentication_by_cvt( = {}) request.get("/auth", "mms", ) do |response| UserResponse.new(response) end end |
#user_authentication_by_member_key(options = {}) ⇒ Object
180 181 182 183 184 |
# File 'lib/access/api.rb', line 180 def user_authentication_by_member_key( = {}) request.get("/auth", "mms", ) do |response| UserResponse.new(response) end end |
#user_external_authentication(options = {}) ⇒ Object
186 187 188 189 190 |
# File 'lib/access/api.rb', line 186 def user_external_authentication( = {}) request.post("/external-auth", "mms", ) do |response| UserResponse.new(response) end end |
#user_external_authentication_by_token(options = {}) ⇒ Object
192 193 194 195 196 |
# File 'lib/access/api.rb', line 192 def user_external_authentication_by_token( = {}) request.get("/external-auth", "mms", ) do |response| UserResponse.new(response) end end |
#user_registration(options = {}) ⇒ Object
User
156 157 158 159 160 |
# File 'lib/access/api.rb', line 156 def user_registration( = {}) request.post("/register", "mms", ) do |response| UserResponse.new(response) end end |
#user_update(options = {}) ⇒ Object
162 163 164 165 166 |
# File 'lib/access/api.rb', line 162 def user_update( = {}) request.put("/users", "mms", ) do |response| UserResponse.new(response) end end |
#verify_filter(filter, options = {}) ⇒ Object
347 348 349 350 351 352 |
# File 'lib/access/api.rb', line 347 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
340 341 342 343 344 345 |
# File 'lib/access/api.rb', line 340 def verify_token( = {}) # Internal Admin only Call request.get("/verify", 'token', ) do |response| VerifyResponse.new(response) end end |