citygrid_api 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/.sass-cache/c6f2c767b164f077e5b9fb1f18a7886d7c755211/test.scssc +0 -0
  2. data/README.rdoc +42 -13
  3. data/Rakefile +2 -2
  4. data/VERSION +1 -1
  5. data/citygrid_api.gemspec +23 -12
  6. data/citygrid_api.yml.sample +10 -2
  7. data/citygrid_api.yml.sandbox +46 -0
  8. data/dashboard.rb +1 -1
  9. data/fixtures/vcr_cassettes/AdGroupCriterion_mutate.yml +3 -3
  10. data/fixtures/vcr_cassettes/AdGroupCriterion_search.yml +3 -3
  11. data/fixtures/vcr_cassettes/Adding_a_place.yml +4 -4
  12. data/fixtures/vcr_cassettes/Geo.yml +30 -13
  13. data/fixtures/vcr_cassettes/Getting_an_offer.yml +413 -0
  14. data/fixtures/vcr_cassettes/Getting_an_offer_by_listing_ID.yml +12 -12
  15. data/fixtures/vcr_cassettes/Import_a_cg_account.yml +28 -16
  16. data/fixtures/vcr_cassettes/Initiating_a_Details.yml +14 -30
  17. data/fixtures/vcr_cassettes/Initiating_new_MultiDetails.yml +13 -13
  18. data/fixtures/vcr_cassettes/Mutating_AdGroup_Ads.yml +4 -4
  19. data/fixtures/vcr_cassettes/Report_summary_daily.yml +34 -34
  20. data/fixtures/vcr_cassettes/Report_summary_user_actions.yml +14 -10
  21. data/fixtures/vcr_cassettes/Search_Ad_Group_by_Campaign_Id.yml +3 -3
  22. data/fixtures/vcr_cassettes/Search_Billing_by_Campaign_Id.yml +31 -12
  23. data/fixtures/vcr_cassettes/Search_account_manager_by_Campaign_Id.yml +25 -12
  24. data/fixtures/vcr_cassettes/Searching_AdGroup_Geo.yml +6 -6
  25. data/fixtures/vcr_cassettes/Searching_budgets.yml +31 -12
  26. data/fixtures/vcr_cassettes/Searching_categories_by_listing_id.yml +3 -3
  27. data/fixtures/vcr_cassettes/Searching_categories_by_query.yml +3 -3
  28. data/fixtures/vcr_cassettes/Upload_an_image_Add_a_preview.yml +31 -12
  29. data/fixtures/vcr_cassettes/{Method_of_Payment_mutate.yml → create_a_mop.yml} +24 -12
  30. data/fixtures/vcr_cassettes/create_an_offer.yml +51 -0
  31. data/fixtures/vcr_cassettes/create_campaign.yml +5 -5
  32. data/fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign.yml +61 -0
  33. data/fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign_then_search_.yml +91 -0
  34. data/fixtures/vcr_cassettes/getting_reviews_by_listing_id.yml +91 -0
  35. data/fixtures/vcr_cassettes/log_in_a_session.yml +3 -3
  36. data/fixtures/vcr_cassettes/log_in_a_session_mutate_places.yml +7 -7
  37. data/fixtures/vcr_cassettes/query_account_type_by_id.yml +24 -12
  38. data/fixtures/vcr_cassettes/search_for_an_account_by_id.yml +24 -13
  39. data/fixtures/vcr_cassettes/search_for_an_account_by_name.yml +27 -17
  40. data/fixtures/vcr_cassettes/search_for_call_detail_by_campaign.yml +49 -0
  41. data/fixtures/vcr_cassettes/search_for_mop_by_account_id.yml +65 -0
  42. data/fixtures/vcr_cassettes/searching_for_a_CityGrid_listing.yml +57 -53
  43. data/fixtures/vcr_cassettes/searching_for_a_special_CityGrid_listing.yml +10 -10
  44. data/fixtures/vcr_cassettes/user_log_in_with_raw_API.yml +24 -0
  45. data/fixtures/vcr_cassettes/user_log_in_with_session.yml +24 -0
  46. data/lib/citygrid/api/accounts/account.rb +2 -2
  47. data/lib/citygrid/api/accounts/method_of_payment.rb +2 -2
  48. data/lib/citygrid/api/accounts/user.rb +8 -4
  49. data/lib/citygrid/api/advertising/account_manager.rb +1 -1
  50. data/lib/citygrid/api/advertising/ad_group.rb +2 -2
  51. data/lib/citygrid/api/advertising/ad_group_ad.rb +2 -2
  52. data/lib/citygrid/api/advertising/ad_group_criterion.rb +2 -2
  53. data/lib/citygrid/api/advertising/ad_group_geo.rb +2 -2
  54. data/lib/citygrid/api/advertising/billing.rb +2 -1
  55. data/lib/citygrid/api/advertising/budget.rb +2 -2
  56. data/lib/citygrid/api/advertising/call_detail.rb +2 -2
  57. data/lib/citygrid/api/advertising/campaign.rb +2 -2
  58. data/lib/citygrid/api/advertising/category.rb +2 -2
  59. data/lib/citygrid/api/advertising/geolocation.rb +2 -2
  60. data/lib/citygrid/api/advertising/image.rb +3 -3
  61. data/lib/citygrid/api/advertising/offers.rb +10 -0
  62. data/lib/citygrid/api/advertising/places.rb +2 -2
  63. data/lib/citygrid/api/content/offers.rb +11 -2
  64. data/lib/citygrid/api/content/places.rb +1 -1
  65. data/lib/citygrid/api/content/response.rb +14 -0
  66. data/lib/citygrid/api/content/reviews.rb +5 -2
  67. data/lib/citygrid/api/mutable.rb +13 -0
  68. data/lib/citygrid/api/searchable.rb +4 -6
  69. data/lib/citygrid/api.rb +70 -52
  70. data/lib/citygrid/session.rb +5 -9
  71. data/lib/citygrid.rb +28 -1
  72. data/test/api/accounts/test_account.rb +53 -32
  73. data/test/api/accounts/test_method_of_payment.rb +40 -43
  74. data/test/api/accounts/test_user.rb +16 -0
  75. data/test/api/advertising/test_call_detail.rb +17 -2
  76. data/test/api/advertising/test_offers.rb +33 -0
  77. data/test/api/advertising/test_places.rb +18 -0
  78. data/test/api/content/test_offers.rb +14 -14
  79. data/test/api/content/test_response.rb +51 -0
  80. data/test/api/content/test_reviews.rb +11 -0
  81. data/test/helper.rb +18 -11
  82. metadata +41 -29
  83. data/README +0 -21
  84. data/citygrid_api.yml.backup +0 -35
  85. data/fixtures/vcr_cassettes/Call_Detail_by_campaign.yml +0 -79
  86. data/fixtures/vcr_cassettes/Method_of_Payment_search.yml +0 -59
  87. data/lib/citygrid/api/mutatable.rb +0 -15
@@ -1,59 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :post
5
- uri: https://api-qassl.citygrid.com:443/accounts/user/v2/login?password=pppppp&username=kunimom
6
- body: !!null
7
- headers: !!null
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- date:
14
- - Fri, 30 Dec 2011 01:05:56 GMT
15
- server:
16
- - Apache-Coyote/1.1
17
- content-type:
18
- - application/json
19
- vary:
20
- - Accept-Encoding
21
- transfer-encoding:
22
- - chunked
23
- body: ! '{"code":201,"authToken":"93920c4e2a1a93900685eef9f55bfb01"}'
24
- http_version: '1.1'
25
- - !ruby/struct:VCR::HTTPInteraction
26
- request: !ruby/struct:VCR::Request
27
- method: :get
28
- uri: https://api-qassl.citygrid.com:443/accounts/mop/v2/get?accountId=111
29
- body: !!null
30
- headers:
31
- accept:
32
- - application/json
33
- content-type:
34
- - Application/JSON
35
- authtoken:
36
- - 93920c4e2a1a93900685eef9f55bfb01
37
- response: !ruby/struct:VCR::Response
38
- status: !ruby/struct:VCR::ResponseStatus
39
- code: 200
40
- message: OK
41
- headers:
42
- date:
43
- - Fri, 30 Dec 2011 01:05:57 GMT
44
- server:
45
- - Apache-Coyote/1.1
46
- content-type:
47
- - application/json
48
- vary:
49
- - Accept-Encoding
50
- transfer-encoding:
51
- - chunked
52
- body: ! '{"totalNumEntries":2,"mopResources":[{"paymentType":"ACH","accountNumber":"[locked]d6EEySDBLAR+RA==","routingNumber":"031200730","id":13351,"state":"TX","country":"united
53
- states","description":null,"active":false,"firstName":"Mary","lastName":"Martinez","phoneNumber":"(512)478-9222","address1":"1300
54
- Belonia Terrace","city":"Austin","postalCode":"78741","address2":null,"accountId":111,"securityCode":null,"paymentType":"ACH","nameOnAccount":"Enchiladas
55
- Y Mas, Inc."},{"paymentType":"Check","id":12211,"state":"TX","country":"united
56
- states","description":null,"active":true,"firstName":"Mary","lastName":"Martinez","phoneNumber":"(512)478-9222","address1":"1300
57
- Belonia Terrace","city":"Austin","postalCode":"78741","address2":null,"accountId":111,"securityCode":null,"paymentType":"Check","nameOnAccount":"Enchiladas
58
- Y Mas, Inc."}],"response":{"message":"OK","code":200}}'
59
- http_version: '1.1'
@@ -1,15 +0,0 @@
1
- # /mutate endpoint
2
-
3
- class CityGrid
4
- class API
5
- module Mutatable
6
- def mutate options = {}
7
- token = extract_auth_token options
8
- request_and_handle :post,
9
- "#{endpoint}/mutate",
10
- :body => options.to_json,
11
- :headers => merge_headers("authToken" => token)
12
- end
13
- end
14
- end
15
- end