rocketfuel_api 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/config/endpoints_for_services.yaml +17 -0
- data/lib/rocketfuel_api/service.rb +7 -10
- data/lib/rocketfuel_api/service/advertisement_ad_assignment.rb +0 -6
- data/lib/rocketfuel_api/service/advertisement_card.rb +0 -6
- data/lib/rocketfuel_api/service/assigned_flight.rb +0 -6
- data/lib/rocketfuel_api/service/campaign.rb +0 -6
- data/lib/rocketfuel_api/service/campaign_pixel.rb +0 -6
- data/lib/rocketfuel_api/service/company.rb +0 -6
- data/lib/rocketfuel_api/service/flight.rb +0 -6
- data/lib/rocketfuel_api/service/line_item.rb +0 -6
- data/lib/rocketfuel_api/service/pixel.rb +0 -6
- data/lib/rocketfuel_api/service/pixel_search.rb +0 -6
- data/lib/rocketfuel_api/service/reporting.rb +0 -6
- data/lib/rocketfuel_api/service/reporting_dimension.rb +0 -6
- data/lib/rocketfuel_api/service/reporting_metric.rb +0 -6
- data/lib/rocketfuel_api/service/sub_network.rb +0 -6
- data/lib/rocketfuel_api/service/tactic.rb +0 -6
- data/lib/rocketfuel_api/service/third_party_pixel_search.rb +0 -6
- data/lib/rocketfuel_api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2356648db6cb773e93d12bf0c4b0a576fc17d3da
|
4
|
+
data.tar.gz: 8ea8ffd2797fd0ba516604eca4a9862288320b44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825a043e75a174a884e46d7098f4ff3a2e97edd6a511c41729a95b19e316ef84f3c2a1581a62c7495edd0b435244c1b72e4a8a26559aa5360e5d9af358e12f69
|
7
|
+
data.tar.gz: 204a02272d3714d633a9174951fe28c771dc4b776eee5de321b827f094c64948f08d2e222f9c61f67be8172dd813b95f44d2fbe22988a31e5a756ec6cb4cf754
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RocketfuelApi [![CircleCI](https://circleci.com/gh/ad2games/rocketfuel_api.svg?style=svg)](https://circleci.com/gh/ad2games/rocketfuel_api)
|
2
2
|
|
3
|
-
|
3
|
+
Unofficial client library for [Rocketfuel API](https://api.rocketfuel.com)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
service:
|
2
|
+
advertisement_ad_assignment: 'ads/ad_assignments'
|
3
|
+
advertisement_card: 'ads/cards'
|
4
|
+
assigned_flight: 'assigned_flights'
|
5
|
+
campaign_pixel: 'campaigns/pixels'
|
6
|
+
campaign: 'campaigns'
|
7
|
+
company: 'companies'
|
8
|
+
flight: 'flights'
|
9
|
+
line_item: 'line_items'
|
10
|
+
pixel_search: 'pixels/search'
|
11
|
+
pixel: 'pixels'
|
12
|
+
reporting_dimension: 'reports/dimensions'
|
13
|
+
reporting_metric: 'reports/metrics'
|
14
|
+
reporting: 'reports'
|
15
|
+
sub_network: 'sub_networks'
|
16
|
+
tactic: 'tactics'
|
17
|
+
thrid_party_pixel_search: 'thrid_party_pixels/search'
|
@@ -19,12 +19,13 @@ class RocketfuelApi::Service
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def plural_name
|
23
|
-
name + 's'
|
24
|
-
end
|
25
|
-
|
26
22
|
def uri_suffix
|
27
|
-
|
23
|
+
file_path = RocketfuelApi.root.join('lib', 'config', 'endpoints_for_services.yaml')
|
24
|
+
endpoints = YAML.load_file(file_path)
|
25
|
+
endpoint = endpoints['service'][name]
|
26
|
+
|
27
|
+
endpoint || raise(RocketfuelApi::NotImplemented,
|
28
|
+
format('No endpoint for service %s available.', name))
|
28
29
|
end
|
29
30
|
|
30
31
|
def get(id, params = {})
|
@@ -42,8 +43,6 @@ class RocketfuelApi::Service
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def create(route_params = {}, body = {})
|
45
|
-
raise(RocketfuelApi::NotImplemented, 'Service is read-only.') if @read_only
|
46
|
-
|
47
46
|
body = { uri_name => body }
|
48
47
|
route = @connection.build_url(uri_suffix, route_params)
|
49
48
|
response = @connection.post(route, body)
|
@@ -56,8 +55,6 @@ class RocketfuelApi::Service
|
|
56
55
|
end
|
57
56
|
|
58
57
|
def update(id, route_params = {}, body = {})
|
59
|
-
raise(AppnexusApi::NotImplemented, 'Service is read-only.') if @read_only
|
60
|
-
|
61
58
|
body = { uri_name => body }
|
62
59
|
route = @connection.build_url(uri_suffix, route_params.merge('id' => id))
|
63
60
|
response = @connection.put(route, body)
|
@@ -78,7 +75,7 @@ class RocketfuelApi::Service
|
|
78
75
|
when Hash
|
79
76
|
resource_class.new(response, self)
|
80
77
|
else
|
81
|
-
raise format(
|
78
|
+
raise(RocketfuelApi::NotImplemented, format('Unknown response type %s.', response.class))
|
82
79
|
end
|
83
80
|
end
|
84
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketfuel_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Greffenius
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- Rakefile
|
127
127
|
- bin/console
|
128
128
|
- bin/setup
|
129
|
+
- lib/config/endpoints_for_services.yaml
|
129
130
|
- lib/rocketfuel_api.rb
|
130
131
|
- lib/rocketfuel_api/connection.rb
|
131
132
|
- lib/rocketfuel_api/error.rb
|