google-ads-common 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6dea057cca6ae39b6511699238e37f2f68a49c0
4
- data.tar.gz: 2e48d936448f87385b04a70ffe9bf0d122f8d38d
3
+ metadata.gz: '067293eb179d644ad5b96f6a03efed2ae0a9feda'
4
+ data.tar.gz: a5315b11005916c7ebc3ecfc00ed75d3db325b97
5
5
  SHA512:
6
- metadata.gz: a64cf5a9debeaf2bd41dad73dacfd5356fcdd52d585954b66b539d617934dbbf79d43d522c479d718b7bf2b414afb202497538c64e80ced339319259a7007b47
7
- data.tar.gz: ff6f3b0736385234e34bb8548dfe74bd865632e6ab26d9b93bb14c7a98b0af452e82120a8aeea20ca1c4f8374a7d95a0bab1466aec6e10f9d97a8167b8fd8b31
6
+ metadata.gz: 2d7af7a96d81234c804467b962d17818bf076d1f22305e10df2e68339bb358924464b65385dbae5bd912e740f1f7c638d30d8dfdfa698accbe8215094becc80c
7
+ data.tar.gz: 24f0e5d3a6f77aeca775c2c88ef30fa65935561903d525ccefb039b880347fb3bed36f529d5bb07e0a93d5d8555f8f265a3b22062e41100f6b8f6d8bf25f8abe
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 1.0.2:
2
+ - Added enumeration values to SOAP service registry objects (pull
3
+ request #153).
4
+
1
5
  1.0.1:
2
6
  - Fixed issue #139. Library now gives a more appropriate warning when it
3
7
  can't get an access token.
@@ -109,7 +109,6 @@ module AdsCommon
109
109
  #
110
110
  def endpoint(version, service)
111
111
  base = get_wsdl_base(version)
112
- # TODO(dklimkin): Unflatten subdir constants. Cross-API refactor 0.9.0.
113
112
  if !subdir_config().nil?
114
113
  base = base.to_s + subdir_config()[[version, service]].to_s
115
114
  end
@@ -127,7 +126,6 @@ module AdsCommon
127
126
  #
128
127
  def subdir(version, service)
129
128
  return nil if subdir_config().nil?
130
- # TODO(dklimkin): Unflatten subdir constants. Cross-API refactor 0.9.0.
131
129
  subdir_config()[[version, service]]
132
130
  end
133
131
 
@@ -145,6 +145,9 @@ module AdsCommon
145
145
  'sequence | complexContent/extension/sequence') do |seq_node|
146
146
  type[:fields] += get_element_fields(seq_node)
147
147
  end
148
+
149
+ extract_enumerations(type_element, type)
150
+
148
151
  REXML::XPath.each(type_element, 'choice') do |seq_node|
149
152
  type[:choices] ||= []
150
153
  type[:choices] += get_element_fields(seq_node)
@@ -152,6 +155,22 @@ module AdsCommon
152
155
  return type
153
156
  end
154
157
 
158
+ # Extracts all possible enumerations for a type and adds them as an
159
+ # `enumerations` key on the type.
160
+ def extract_enumerations(type_element, type)
161
+ REXML::XPath.each(type_element,
162
+ "restriction[@base='xsd:string']") do |enum_node|
163
+ type.delete(:fields)
164
+ type[:type] = enum_node.attribute('base').to_s.gsub(/^.+:/, '')
165
+ end
166
+ REXML::XPath.each(type_element,
167
+ "restriction[@base='xsd:string']/enumeration") do |enum_node|
168
+ type[:enumerations] ||= []
169
+ type[:enumerations] << enum_node.attribute('value').to_s
170
+ end
171
+ return type
172
+ end
173
+
155
174
  # Extracts input parameters of given method as an array.
156
175
  def extract_input_parameters(op_node, doc)
157
176
  op_name = get_element_name(op_node)
@@ -19,6 +19,6 @@
19
19
 
20
20
  module AdsCommon
21
21
  module ApiConfig
22
- CLIENT_LIB_VERSION = '1.0.1'
22
+ CLIENT_LIB_VERSION = '1.0.2'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-ads-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Gomes
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-02-15 00:00:00.000000000 Z
13
+ date: 2018-06-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: google-ads-savon
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: 1.3.6
197
197
  requirements: []
198
198
  rubyforge_project: google-ads-common
199
- rubygems_version: 2.6.8
199
+ rubygems_version: 2.6.13
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Common code for Google Ads APIs