appnexusapi 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcb81e6d6e3e396e606b8f5f34133564bb1e23d4
4
- data.tar.gz: c818e90587d6ea29f0732b4e0d26e6b4632c2a73
3
+ metadata.gz: d997128b65520339be989fcb96749c33587abb72
4
+ data.tar.gz: fb3acadae3fde3bdb335593d8da3f42f0b1b9e7a
5
5
  SHA512:
6
- metadata.gz: fbf3d7e3efe189261e35340b03ed7b06f34c5e99f8a11a3c3b1d0de6a93738a034dab5f7cbc867419dc03a027a01e97c2da35dbfbe53c762e7ad47c0ff69a467
7
- data.tar.gz: 4a09f2255dc0e823f18b4c436ea959959afd087842389f125d5785dec9a18816a5fa5ad7396fb99091db7fd16c7761146cb5f16da58bdc0511fbecfb80d2f7a4
6
+ metadata.gz: 94b2a45688b0407a998f2dbcc106318c157832b648bb4fb961a4354235d3c071f65be500f5f2c7583d8d06f6e7ba508806f15291c30fe4c3e875a0f856a0be2f
7
+ data.tar.gz: 2e227bdd933b135a1b60ada7a5ff906115d8062a1d531491548dd01bafaa5b11f68782dfe8a303e550fc44fe221b6ac4bac21f979780289eb87ca30e4bbe9dac
@@ -0,0 +1,2 @@
1
+ class AppnexusApi::DeviceModelResource < AppnexusApi::Resource
2
+ end
@@ -0,0 +1,6 @@
1
+ class AppnexusApi::DeviceModelService < AppnexusApi::Service
2
+ def initialize(connection)
3
+ @read_only = true
4
+ super(connection)
5
+ end
6
+ end
@@ -0,0 +1,2 @@
1
+ class AppnexusApi::MediaTypeResource < AppnexusApi::Resource
2
+ end
@@ -0,0 +1,8 @@
1
+ class AppnexusApi::MediaTypeService < AppnexusApi::Service
2
+
3
+ def initialize(connection)
4
+ @read_only = true
5
+ super(connection)
6
+ end
7
+
8
+ end
@@ -0,0 +1,2 @@
1
+ class AppnexusApi::OperatingSystemResource < AppnexusApi::Resource
2
+ end
@@ -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" => 100,
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 }
@@ -1,3 +1,3 @@
1
1
  module AppnexusApi
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
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.6
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-16 00:00:00.000000000 Z
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