adwords4r 0.4 → 0.5

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.
@@ -0,0 +1,83 @@
1
+ module AdWords
2
+ require 'adwords4r/v4/ReportService'
3
+
4
+ require 'soap/rpc/driver'
5
+
6
+ class ReportServiceInterface < ::SOAP::RPC::Driver
7
+ DefaultEndpointUrl = "https://adwords.google.com/api/adwords/v4/ReportService"
8
+ MappingRegistry = ::SOAP::Mapping::Registry.new
9
+
10
+ Methods = [
11
+ [ "",
12
+ "scheduleReportJob",
13
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "scheduleReportJob"], true],
14
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "scheduleReportJobResponse"], true] ],
15
+ { :request_style => :document, :request_use => :literal,
16
+ :response_style => :document, :response_use => :literal }
17
+ ],
18
+ [ "",
19
+ "getReportJobStatus",
20
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getReportJobStatus"], true],
21
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getReportJobStatusResponse"], true] ],
22
+ { :request_style => :document, :request_use => :literal,
23
+ :response_style => :document, :response_use => :literal }
24
+ ],
25
+ [ "",
26
+ "getReportDownloadUrl",
27
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getReportDownloadUrl"], true],
28
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getReportDownloadUrlResponse"], true] ],
29
+ { :request_style => :document, :request_use => :literal,
30
+ :response_style => :document, :response_use => :literal }
31
+ ],
32
+ [ "",
33
+ "getGzipReportDownloadUrl",
34
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getGzipReportDownloadUrl"], true],
35
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getGzipReportDownloadUrlResponse"], true] ],
36
+ { :request_style => :document, :request_use => :literal,
37
+ :response_style => :document, :response_use => :literal }
38
+ ],
39
+ [ "",
40
+ "getAllJobs",
41
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getAllJobs"], true],
42
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getAllJobsResponse"], true] ],
43
+ { :request_style => :document, :request_use => :literal,
44
+ :response_style => :document, :response_use => :literal }
45
+ ],
46
+ [ "",
47
+ "deleteReport",
48
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "deleteReport"], true],
49
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "deleteReportResponse"], true] ],
50
+ { :request_style => :document, :request_use => :literal,
51
+ :response_style => :document, :response_use => :literal }
52
+ ]
53
+ ]
54
+
55
+ def initialize(endpoint_url = nil)
56
+ endpoint_url ||= DefaultEndpointUrl
57
+ super(endpoint_url, nil)
58
+ self.mapping_registry = MappingRegistry
59
+ init_methods
60
+ end
61
+
62
+ private
63
+
64
+ def init_methods
65
+ Methods.each do |definitions|
66
+ opt = definitions.last
67
+ if opt[:request_style] == :document
68
+ add_document_operation(*definitions)
69
+ else
70
+ add_rpc_operation(*definitions)
71
+ qname = definitions[0]
72
+ name = definitions[2]
73
+ if qname.name != name and qname.name.capitalize == name.capitalize
74
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
75
+ __send__(name, *arg)
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+
83
+ end
@@ -0,0 +1,274 @@
1
+ module AdWords
2
+ require 'xsd/qname'
3
+
4
+ # {https://adwords.google.com/api/adwords/v4}estimateCampaignList
5
+ class EstimateCampaignList < ::Array
6
+ @@schema_element = [
7
+ ["campaignRequests", ["CampaignRequest[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "campaignRequests")]]
8
+ ]
9
+ end
10
+
11
+ # {https://adwords.google.com/api/adwords/v4}estimateCampaignListResponse
12
+ class EstimateCampaignListResponse < ::Array
13
+ @@schema_element = [
14
+ ["estimateCampaignListReturn", ["CampaignEstimate[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "estimateCampaignListReturn")]]
15
+ ]
16
+ end
17
+
18
+ # {https://adwords.google.com/api/adwords/v4}estimateAdGroupList
19
+ class EstimateAdGroupList < ::Array
20
+ @@schema_element = [
21
+ ["adGroupRequests", ["AdGroupRequest[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "adGroupRequests")]]
22
+ ]
23
+ end
24
+
25
+ # {https://adwords.google.com/api/adwords/v4}estimateAdGroupListResponse
26
+ class EstimateAdGroupListResponse < ::Array
27
+ @@schema_element = [
28
+ ["estimateAdGroupListReturn", ["AdGroupEstimate[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "estimateAdGroupListReturn")]]
29
+ ]
30
+ end
31
+
32
+ # {https://adwords.google.com/api/adwords/v4}estimateKeywordList
33
+ class EstimateKeywordList < ::Array
34
+ @@schema_element = [
35
+ ["keywordRequests", ["KeywordRequest[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "keywordRequests")]]
36
+ ]
37
+ end
38
+
39
+ # {https://adwords.google.com/api/adwords/v4}estimateKeywordListResponse
40
+ class EstimateKeywordListResponse < ::Array
41
+ @@schema_element = [
42
+ ["estimateKeywordListReturn", ["KeywordEstimate[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "estimateKeywordListReturn")]]
43
+ ]
44
+ end
45
+
46
+ # {https://adwords.google.com/api/adwords/v4}ApiException
47
+ class ApiException
48
+ @@schema_type = "ApiException"
49
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
50
+ @@schema_element = [
51
+ ["code", "SOAP::SOAPInt"],
52
+ ["internal", "SOAP::SOAPBoolean"],
53
+ ["message", "SOAP::SOAPString"],
54
+ ["trigger", "SOAP::SOAPString"],
55
+ ["violations", "SOAP::SOAPString"]
56
+ ]
57
+
58
+ attr_accessor :code
59
+ attr_accessor :internal
60
+ attr_accessor :message
61
+ attr_accessor :trigger
62
+ attr_accessor :violations
63
+
64
+ def initialize(code = nil, internal = nil, message = nil, trigger = nil, violations = nil)
65
+ @code = code
66
+ @internal = internal
67
+ @message = message
68
+ @trigger = trigger
69
+ @violations = violations
70
+ end
71
+ end
72
+
73
+ # {https://adwords.google.com/api/adwords/v4}CampaignRequest
74
+ class CampaignRequest
75
+ @@schema_type = "CampaignRequest"
76
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
77
+ @@schema_element = [
78
+ ["adGroupRequests", "AdGroupRequest[]"],
79
+ ["geoTargeting", "GeoTarget"],
80
+ ["id", "SOAP::SOAPInt"],
81
+ ["languageTargeting", "LanguageTarget"],
82
+ ["networkTargeting", "NetworkTarget"]
83
+ ]
84
+
85
+ attr_accessor :adGroupRequests
86
+ attr_accessor :geoTargeting
87
+ attr_accessor :id
88
+ attr_accessor :languageTargeting
89
+ attr_accessor :networkTargeting
90
+
91
+ def initialize(adGroupRequests = [], geoTargeting = nil, id = nil, languageTargeting = nil, networkTargeting = nil)
92
+ @adGroupRequests = adGroupRequests
93
+ @geoTargeting = geoTargeting
94
+ @id = id
95
+ @languageTargeting = languageTargeting
96
+ @networkTargeting = networkTargeting
97
+ end
98
+ end
99
+
100
+ # {https://adwords.google.com/api/adwords/v4}AdGroupRequest
101
+ class AdGroupRequest
102
+ @@schema_type = "AdGroupRequest"
103
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
104
+ @@schema_element = [
105
+ ["id", "SOAP::SOAPInt"],
106
+ ["keywordRequests", "KeywordRequest[]"],
107
+ ["maxCpc", "SOAP::SOAPLong"]
108
+ ]
109
+
110
+ attr_accessor :id
111
+ attr_accessor :keywordRequests
112
+ attr_accessor :maxCpc
113
+
114
+ def initialize(id = nil, keywordRequests = [], maxCpc = nil)
115
+ @id = id
116
+ @keywordRequests = keywordRequests
117
+ @maxCpc = maxCpc
118
+ end
119
+ end
120
+
121
+ # {https://adwords.google.com/api/adwords/v4}KeywordRequest
122
+ class KeywordRequest
123
+ @@schema_type = "KeywordRequest"
124
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
125
+ @@schema_element = [
126
+ ["id", "SOAP::SOAPLong"],
127
+ ["maxCpc", "SOAP::SOAPLong"],
128
+ ["negative", "SOAP::SOAPBoolean"],
129
+ ["text", "SOAP::SOAPString"],
130
+ ["type", "SOAP::SOAPString"]
131
+ ]
132
+
133
+ attr_accessor :id
134
+ attr_accessor :maxCpc
135
+ attr_accessor :negative
136
+ attr_accessor :text
137
+ attr_accessor :type
138
+
139
+ def initialize(id = nil, maxCpc = nil, negative = nil, text = nil, type = nil)
140
+ @id = id
141
+ @maxCpc = maxCpc
142
+ @negative = negative
143
+ @text = text
144
+ @type = type
145
+ end
146
+ end
147
+
148
+ # {https://adwords.google.com/api/adwords/v4}GeoTarget
149
+ class GeoTarget
150
+ @@schema_type = "GeoTarget"
151
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
152
+ @@schema_element = [
153
+ ["cities", "SOAP::SOAPString[]"],
154
+ ["countries", "SOAP::SOAPString[]"],
155
+ ["metros", "SOAP::SOAPString[]"],
156
+ ["regions", "SOAP::SOAPString[]"]
157
+ ]
158
+
159
+ attr_accessor :cities
160
+ attr_accessor :countries
161
+ attr_accessor :metros
162
+ attr_accessor :regions
163
+
164
+ def initialize(cities = [], countries = [], metros = [], regions = [])
165
+ @cities = cities
166
+ @countries = countries
167
+ @metros = metros
168
+ @regions = regions
169
+ end
170
+ end
171
+
172
+ # {https://adwords.google.com/api/adwords/v4}LanguageTarget
173
+ class LanguageTarget < ::Array
174
+ @@schema_element = [
175
+ ["languages", ["SOAP::SOAPString[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "languages")]]
176
+ ]
177
+ end
178
+
179
+ # {https://adwords.google.com/api/adwords/v4}NetworkTarget
180
+ class NetworkTarget < ::Array
181
+ @@schema_element = [
182
+ ["networkTypes", ["SOAP::SOAPString[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "networkTypes")]]
183
+ ]
184
+ end
185
+
186
+ # {https://adwords.google.com/api/adwords/v4}CampaignEstimate
187
+ class CampaignEstimate
188
+ @@schema_type = "CampaignEstimate"
189
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
190
+ @@schema_element = [
191
+ ["adGroupEstimates", "AdGroupEstimate[]"],
192
+ ["id", "SOAP::SOAPInt"]
193
+ ]
194
+
195
+ attr_accessor :adGroupEstimates
196
+ attr_accessor :id
197
+
198
+ def initialize(adGroupEstimates = [], id = nil)
199
+ @adGroupEstimates = adGroupEstimates
200
+ @id = id
201
+ end
202
+ end
203
+
204
+ # {https://adwords.google.com/api/adwords/v4}AdGroupEstimate
205
+ class AdGroupEstimate
206
+ @@schema_type = "AdGroupEstimate"
207
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
208
+ @@schema_element = [
209
+ ["id", "SOAP::SOAPInt"],
210
+ ["keywordEstimates", "KeywordEstimate[]"]
211
+ ]
212
+
213
+ attr_accessor :id
214
+ attr_accessor :keywordEstimates
215
+
216
+ def initialize(id = nil, keywordEstimates = [])
217
+ @id = id
218
+ @keywordEstimates = keywordEstimates
219
+ end
220
+ end
221
+
222
+ # {https://adwords.google.com/api/adwords/v4}KeywordEstimate
223
+ class KeywordEstimate
224
+ @@schema_type = "KeywordEstimate"
225
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
226
+ @@schema_element = [
227
+ ["lowerAvgPosition", "Float"],
228
+ ["upperAvgPosition", "Float"],
229
+ ["lowerClicksPerDay", "Float"],
230
+ ["upperClicksPerDay", "Float"],
231
+ ["lowerCpc", "SOAP::SOAPLong"],
232
+ ["upperCpc", "SOAP::SOAPLong"],
233
+ ["id", "SOAP::SOAPLong"]
234
+ ]
235
+
236
+ attr_accessor :lowerAvgPosition
237
+ attr_accessor :upperAvgPosition
238
+ attr_accessor :lowerClicksPerDay
239
+ attr_accessor :upperClicksPerDay
240
+ attr_accessor :lowerCpc
241
+ attr_accessor :upperCpc
242
+ attr_accessor :id
243
+
244
+ def initialize(lowerAvgPosition = nil, upperAvgPosition = nil, lowerClicksPerDay = nil, upperClicksPerDay = nil, lowerCpc = nil, upperCpc = nil, id = nil)
245
+ @lowerAvgPosition = lowerAvgPosition
246
+ @upperAvgPosition = upperAvgPosition
247
+ @lowerClicksPerDay = lowerClicksPerDay
248
+ @upperClicksPerDay = upperClicksPerDay
249
+ @lowerCpc = lowerCpc
250
+ @upperCpc = upperCpc
251
+ @id = id
252
+ end
253
+ end
254
+
255
+ # {https://adwords.google.com/api/adwords/v4}NetworkType
256
+ class NetworkType < ::String
257
+ @@schema_type = "NetworkType"
258
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
259
+
260
+ ContentNetwork = NetworkType.new("ContentNetwork")
261
+ GoogleSearch = NetworkType.new("GoogleSearch")
262
+ SearchNetwork = NetworkType.new("SearchNetwork")
263
+ end
264
+
265
+ # {https://adwords.google.com/api/adwords/v4}KeywordType
266
+ class KeywordType < ::String
267
+ @@schema_type = "KeywordType"
268
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
269
+
270
+ Broad = KeywordType.new("Broad")
271
+ Exact = KeywordType.new("Exact")
272
+ Phrase = KeywordType.new("Phrase")
273
+ end
274
+ end
@@ -0,0 +1,62 @@
1
+ module AdWords
2
+ require 'adwords4r/v4/TrafficEstimatorService'
3
+
4
+ require 'soap/rpc/driver'
5
+
6
+ class TrafficEstimatorInterface < ::SOAP::RPC::Driver
7
+ DefaultEndpointUrl = "https://adwords.google.com/api/adwords/v4/TrafficEstimatorService"
8
+ MappingRegistry = ::SOAP::Mapping::Registry.new
9
+
10
+ Methods = [
11
+ [ "",
12
+ "estimateCampaignList",
13
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "estimateCampaignList"], true],
14
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "estimateCampaignListResponse"], true] ],
15
+ { :request_style => :document, :request_use => :literal,
16
+ :response_style => :document, :response_use => :literal }
17
+ ],
18
+ [ "",
19
+ "estimateAdGroupList",
20
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "estimateAdGroupList"], true],
21
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "estimateAdGroupListResponse"], true] ],
22
+ { :request_style => :document, :request_use => :literal,
23
+ :response_style => :document, :response_use => :literal }
24
+ ],
25
+ [ "",
26
+ "estimateKeywordList",
27
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "estimateKeywordList"], true],
28
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "estimateKeywordListResponse"], true] ],
29
+ { :request_style => :document, :request_use => :literal,
30
+ :response_style => :document, :response_use => :literal }
31
+ ]
32
+ ]
33
+
34
+ def initialize(endpoint_url = nil)
35
+ endpoint_url ||= DefaultEndpointUrl
36
+ super(endpoint_url, nil)
37
+ self.mapping_registry = MappingRegistry
38
+ init_methods
39
+ end
40
+
41
+ private
42
+
43
+ def init_methods
44
+ Methods.each do |definitions|
45
+ opt = definitions.last
46
+ if opt[:request_style] == :document
47
+ add_document_operation(*definitions)
48
+ else
49
+ add_rpc_operation(*definitions)
50
+ qname = definitions[0]
51
+ name = definitions[2]
52
+ if qname.name != name and qname.name.capitalize == name.capitalize
53
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
54
+ __send__(name, *arg)
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+
62
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: adwords4r
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.4"
7
- date: 2006-05-03 00:00:00 -07:00
6
+ version: "0.5"
7
+ date: 2006-06-12 00:00:00 -07:00
8
8
  summary: Client library for the AdWords API.
9
9
  require_paths:
10
10
  - lib
@@ -28,6 +28,7 @@ cert_chain:
28
28
  authors:
29
29
  - Patrick Chanezon
30
30
  files:
31
+ - adwords.properties
31
32
  - Authors.txt
32
33
  - ChangeLog.txt
33
34
  - Copying.txt
@@ -80,9 +81,32 @@ files:
80
81
  - lib/adwords4r/v3/ReportServiceDriver.rb
81
82
  - lib/adwords4r/v3/TrafficEstimatorService.rb
82
83
  - lib/adwords4r/v3/TrafficEstimatorServiceDriver.rb
84
+ - lib/adwords4r/v4/AccountService.rb
85
+ - lib/adwords4r/v4/AccountServiceDriver.rb
86
+ - lib/adwords4r/v4/AdGroupService.rb
87
+ - lib/adwords4r/v4/AdGroupServiceDriver.rb
88
+ - lib/adwords4r/v4/CampaignService.rb
89
+ - lib/adwords4r/v4/CampaignServiceDriver.rb
90
+ - lib/adwords4r/v4/CreativeService.rb
91
+ - lib/adwords4r/v4/CreativeServiceDriver.rb
92
+ - lib/adwords4r/v4/CriterionService.rb
93
+ - lib/adwords4r/v4/CriterionServiceDriver.rb
94
+ - lib/adwords4r/v4/InfoService.rb
95
+ - lib/adwords4r/v4/InfoServiceDriver.rb
96
+ - lib/adwords4r/v4/KeywordService.rb
97
+ - lib/adwords4r/v4/KeywordServiceDriver.rb
98
+ - lib/adwords4r/v4/KeywordToolService.rb
99
+ - lib/adwords4r/v4/KeywordToolServiceDriver.rb
100
+ - lib/adwords4r/v4/ReportService.rb
101
+ - lib/adwords4r/v4/ReportServiceDriver.rb
102
+ - lib/adwords4r/v4/TrafficEstimatorService.rb
103
+ - lib/adwords4r/v4/TrafficEstimatorServiceDriver.rb
83
104
  - examples/campaign.rb
84
105
  - examples/framework.rb
106
+ - examples/get_free_usage_this_month.rb
85
107
  - examples/get_unit_count.rb
108
+ - examples/report_demo.rb
109
+ - examples/traffic_estimator.rb
86
110
  - scripts/publish.rb
87
111
  test_files: []
88
112
 
@@ -96,5 +120,6 @@ extensions: []
96
120
 
97
121
  requirements:
98
122
  - soap4r v 1.5.4 or greater
123
+ - http-access2 v 2.0.5 or greater
99
124
  dependencies: []
100
125