appnexusapi 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appnexusapi/device_model_resource.rb +2 -0
- data/lib/appnexusapi/device_model_service.rb +6 -0
- data/lib/appnexusapi/media_type_resource.rb +2 -0
- data/lib/appnexusapi/media_type_service.rb +8 -0
- data/lib/appnexusapi/operating_system_resource.rb +2 -0
- data/lib/appnexusapi/service.rb +15 -1
- data/lib/appnexusapi/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d997128b65520339be989fcb96749c33587abb72
|
4
|
+
data.tar.gz: fb3acadae3fde3bdb335593d8da3f42f0b1b9e7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94b2a45688b0407a998f2dbcc106318c157832b648bb4fb961a4354235d3c071f65be500f5f2c7583d8d06f6e7ba508806f15291c30fe4c3e875a0f856a0be2f
|
7
|
+
data.tar.gz: 2e227bdd933b135a1b60ada7a5ff906115d8062a1d531491548dd01bafaa5b11f68782dfe8a303e550fc44fe221b6ac4bac21f979780289eb87ca30e4bbe9dac
|
data/lib/appnexusapi/service.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
class AppnexusApi::Service
|
2
|
+
DEFAULT_NUMBER_OF_ELEMENTS = 100
|
2
3
|
|
3
4
|
def initialize(connection)
|
4
5
|
@connection = connection
|
@@ -37,7 +38,7 @@ class AppnexusApi::Service
|
|
37
38
|
def get(params={})
|
38
39
|
return_response = params.delete(:return_response) || false
|
39
40
|
params = {
|
40
|
-
"num_elements" =>
|
41
|
+
"num_elements" => DEFAULT_NUMBER_OF_ELEMENTS,
|
41
42
|
"start_element" => 0
|
42
43
|
}.merge(params)
|
43
44
|
response = @connection.get(uri_suffix, params).body['response']
|
@@ -54,6 +55,19 @@ class AppnexusApi::Service
|
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
58
|
+
def get_all(params = {})
|
59
|
+
responses = []
|
60
|
+
last_responses = get(params)
|
61
|
+
|
62
|
+
while last_responses.size > 0
|
63
|
+
responses += last_responses
|
64
|
+
last_responses = get(params.merge('start_element' => responses.size))
|
65
|
+
sleep(1) # The gem has no error handling at all for rate limit errors; sleeping for a second prevents errors
|
66
|
+
end
|
67
|
+
|
68
|
+
responses
|
69
|
+
end
|
70
|
+
|
57
71
|
def create(attributes={})
|
58
72
|
raise(AppnexusApi::NotImplemented, "Service is read-only.") if @read_only
|
59
73
|
attributes = { name => attributes }
|
data/lib/appnexusapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appnexusapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Aaron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -115,6 +115,8 @@ files:
|
|
115
115
|
- lib/appnexusapi/creative_service.rb
|
116
116
|
- lib/appnexusapi/creative_template_resource.rb
|
117
117
|
- lib/appnexusapi/creative_template_service.rb
|
118
|
+
- lib/appnexusapi/device_model_resource.rb
|
119
|
+
- lib/appnexusapi/device_model_service.rb
|
118
120
|
- lib/appnexusapi/domain_list_resource.rb
|
119
121
|
- lib/appnexusapi/domain_list_service.rb
|
120
122
|
- lib/appnexusapi/error.rb
|
@@ -130,8 +132,11 @@ files:
|
|
130
132
|
- lib/appnexusapi/log_level_data_download_service.rb
|
131
133
|
- lib/appnexusapi/log_level_data_resource.rb
|
132
134
|
- lib/appnexusapi/log_level_data_service.rb
|
135
|
+
- lib/appnexusapi/media_type_resource.rb
|
136
|
+
- lib/appnexusapi/media_type_service.rb
|
133
137
|
- lib/appnexusapi/member_resource.rb
|
134
138
|
- lib/appnexusapi/member_service.rb
|
139
|
+
- lib/appnexusapi/operating_system_resource.rb
|
135
140
|
- lib/appnexusapi/operating_system_service.rb
|
136
141
|
- lib/appnexusapi/platform_member_resource.rb
|
137
142
|
- lib/appnexusapi/platform_member_service.rb
|