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.
- data/.sass-cache/c6f2c767b164f077e5b9fb1f18a7886d7c755211/test.scssc +0 -0
- data/README.rdoc +42 -13
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/citygrid_api.gemspec +23 -12
- data/citygrid_api.yml.sample +10 -2
- data/citygrid_api.yml.sandbox +46 -0
- data/dashboard.rb +1 -1
- data/fixtures/vcr_cassettes/AdGroupCriterion_mutate.yml +3 -3
- data/fixtures/vcr_cassettes/AdGroupCriterion_search.yml +3 -3
- data/fixtures/vcr_cassettes/Adding_a_place.yml +4 -4
- data/fixtures/vcr_cassettes/Geo.yml +30 -13
- data/fixtures/vcr_cassettes/Getting_an_offer.yml +413 -0
- data/fixtures/vcr_cassettes/Getting_an_offer_by_listing_ID.yml +12 -12
- data/fixtures/vcr_cassettes/Import_a_cg_account.yml +28 -16
- data/fixtures/vcr_cassettes/Initiating_a_Details.yml +14 -30
- data/fixtures/vcr_cassettes/Initiating_new_MultiDetails.yml +13 -13
- data/fixtures/vcr_cassettes/Mutating_AdGroup_Ads.yml +4 -4
- data/fixtures/vcr_cassettes/Report_summary_daily.yml +34 -34
- data/fixtures/vcr_cassettes/Report_summary_user_actions.yml +14 -10
- data/fixtures/vcr_cassettes/Search_Ad_Group_by_Campaign_Id.yml +3 -3
- data/fixtures/vcr_cassettes/Search_Billing_by_Campaign_Id.yml +31 -12
- data/fixtures/vcr_cassettes/Search_account_manager_by_Campaign_Id.yml +25 -12
- data/fixtures/vcr_cassettes/Searching_AdGroup_Geo.yml +6 -6
- data/fixtures/vcr_cassettes/Searching_budgets.yml +31 -12
- data/fixtures/vcr_cassettes/Searching_categories_by_listing_id.yml +3 -3
- data/fixtures/vcr_cassettes/Searching_categories_by_query.yml +3 -3
- data/fixtures/vcr_cassettes/Upload_an_image_Add_a_preview.yml +31 -12
- data/fixtures/vcr_cassettes/{Method_of_Payment_mutate.yml → create_a_mop.yml} +24 -12
- data/fixtures/vcr_cassettes/create_an_offer.yml +51 -0
- data/fixtures/vcr_cassettes/create_campaign.yml +5 -5
- data/fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign.yml +61 -0
- data/fixtures/vcr_cassettes/create_campaign_then_create_ad_group_belonging_to_campaign_then_search_.yml +91 -0
- data/fixtures/vcr_cassettes/getting_reviews_by_listing_id.yml +91 -0
- data/fixtures/vcr_cassettes/log_in_a_session.yml +3 -3
- data/fixtures/vcr_cassettes/log_in_a_session_mutate_places.yml +7 -7
- data/fixtures/vcr_cassettes/query_account_type_by_id.yml +24 -12
- data/fixtures/vcr_cassettes/search_for_an_account_by_id.yml +24 -13
- data/fixtures/vcr_cassettes/search_for_an_account_by_name.yml +27 -17
- data/fixtures/vcr_cassettes/search_for_call_detail_by_campaign.yml +49 -0
- data/fixtures/vcr_cassettes/search_for_mop_by_account_id.yml +65 -0
- data/fixtures/vcr_cassettes/searching_for_a_CityGrid_listing.yml +57 -53
- data/fixtures/vcr_cassettes/searching_for_a_special_CityGrid_listing.yml +10 -10
- data/fixtures/vcr_cassettes/user_log_in_with_raw_API.yml +24 -0
- data/fixtures/vcr_cassettes/user_log_in_with_session.yml +24 -0
- data/lib/citygrid/api/accounts/account.rb +2 -2
- data/lib/citygrid/api/accounts/method_of_payment.rb +2 -2
- data/lib/citygrid/api/accounts/user.rb +8 -4
- data/lib/citygrid/api/advertising/account_manager.rb +1 -1
- data/lib/citygrid/api/advertising/ad_group.rb +2 -2
- data/lib/citygrid/api/advertising/ad_group_ad.rb +2 -2
- data/lib/citygrid/api/advertising/ad_group_criterion.rb +2 -2
- data/lib/citygrid/api/advertising/ad_group_geo.rb +2 -2
- data/lib/citygrid/api/advertising/billing.rb +2 -1
- data/lib/citygrid/api/advertising/budget.rb +2 -2
- data/lib/citygrid/api/advertising/call_detail.rb +2 -2
- data/lib/citygrid/api/advertising/campaign.rb +2 -2
- data/lib/citygrid/api/advertising/category.rb +2 -2
- data/lib/citygrid/api/advertising/geolocation.rb +2 -2
- data/lib/citygrid/api/advertising/image.rb +3 -3
- data/lib/citygrid/api/advertising/offers.rb +10 -0
- data/lib/citygrid/api/advertising/places.rb +2 -2
- data/lib/citygrid/api/content/offers.rb +11 -2
- data/lib/citygrid/api/content/places.rb +1 -1
- data/lib/citygrid/api/content/response.rb +14 -0
- data/lib/citygrid/api/content/reviews.rb +5 -2
- data/lib/citygrid/api/mutable.rb +13 -0
- data/lib/citygrid/api/searchable.rb +4 -6
- data/lib/citygrid/api.rb +70 -52
- data/lib/citygrid/session.rb +5 -9
- data/lib/citygrid.rb +28 -1
- data/test/api/accounts/test_account.rb +53 -32
- data/test/api/accounts/test_method_of_payment.rb +40 -43
- data/test/api/accounts/test_user.rb +16 -0
- data/test/api/advertising/test_call_detail.rb +17 -2
- data/test/api/advertising/test_offers.rb +33 -0
- data/test/api/advertising/test_places.rb +18 -0
- data/test/api/content/test_offers.rb +14 -14
- data/test/api/content/test_response.rb +51 -0
- data/test/api/content/test_reviews.rb +11 -0
- data/test/helper.rb +18 -11
- metadata +41 -29
- data/README +0 -21
- data/citygrid_api.yml.backup +0 -35
- data/fixtures/vcr_cassettes/Call_Detail_by_campaign.yml +0 -79
- data/fixtures/vcr_cassettes/Method_of_Payment_search.yml +0 -59
- 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
|