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,104 @@
1
+ module AdWords
2
+ require 'adwords4r/v4/CreativeService'
3
+
4
+ require 'soap/rpc/driver'
5
+
6
+ class CreativeService < ::SOAP::RPC::Driver
7
+ DefaultEndpointUrl = "https://adwords.google.com/api/adwords/v4/CreativeService"
8
+ MappingRegistry = ::SOAP::Mapping::Registry.new
9
+
10
+ Methods = [
11
+ [ "",
12
+ "getAllCreatives",
13
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getAllCreatives"], true],
14
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getAllCreativesResponse"], true] ],
15
+ { :request_style => :document, :request_use => :literal,
16
+ :response_style => :document, :response_use => :literal }
17
+ ],
18
+ [ "",
19
+ "getActiveCreatives",
20
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getActiveCreatives"], true],
21
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getActiveCreativesResponse"], true] ],
22
+ { :request_style => :document, :request_use => :literal,
23
+ :response_style => :document, :response_use => :literal }
24
+ ],
25
+ [ "",
26
+ "getCreative",
27
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCreative"], true],
28
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCreativeResponse"], true] ],
29
+ { :request_style => :document, :request_use => :literal,
30
+ :response_style => :document, :response_use => :literal }
31
+ ],
32
+ [ "",
33
+ "addCreative",
34
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCreative"], true],
35
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCreativeResponse"], true] ],
36
+ { :request_style => :document, :request_use => :literal,
37
+ :response_style => :document, :response_use => :literal }
38
+ ],
39
+ [ "",
40
+ "addCreativeList",
41
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCreativeList"], true],
42
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCreativeListResponse"], true] ],
43
+ { :request_style => :document, :request_use => :literal,
44
+ :response_style => :document, :response_use => :literal }
45
+ ],
46
+ [ "",
47
+ "deleteCreative",
48
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "deleteCreative"], true],
49
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "deleteCreativeResponse"], true] ],
50
+ { :request_style => :document, :request_use => :literal,
51
+ :response_style => :document, :response_use => :literal }
52
+ ],
53
+ [ "",
54
+ "deleteCreativeList",
55
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "deleteCreativeList"], true],
56
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "deleteCreativeListResponse"], true] ],
57
+ { :request_style => :document, :request_use => :literal,
58
+ :response_style => :document, :response_use => :literal }
59
+ ],
60
+ [ "",
61
+ "activateCreative",
62
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "activateCreative"], true],
63
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "activateCreativeResponse"], true] ],
64
+ { :request_style => :document, :request_use => :literal,
65
+ :response_style => :document, :response_use => :literal }
66
+ ],
67
+ [ "",
68
+ "activateCreativeList",
69
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "activateCreativeList"], true],
70
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "activateCreativeListResponse"], true] ],
71
+ { :request_style => :document, :request_use => :literal,
72
+ :response_style => :document, :response_use => :literal }
73
+ ]
74
+ ]
75
+
76
+ def initialize(endpoint_url = nil)
77
+ endpoint_url ||= DefaultEndpointUrl
78
+ super(endpoint_url, nil)
79
+ self.mapping_registry = MappingRegistry
80
+ init_methods
81
+ end
82
+
83
+ private
84
+
85
+ def init_methods
86
+ Methods.each do |definitions|
87
+ opt = definitions.last
88
+ if opt[:request_style] == :document
89
+ add_document_operation(*definitions)
90
+ else
91
+ add_rpc_operation(*definitions)
92
+ qname = definitions[0]
93
+ name = definitions[2]
94
+ if qname.name != name and qname.name.capitalize == name.capitalize
95
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
96
+ __send__(name, *arg)
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
103
+
104
+ end
@@ -0,0 +1,411 @@
1
+ module AdWords
2
+ require 'xsd/qname'
3
+
4
+ # {https://adwords.google.com/api/adwords/v4}getAllCriteria
5
+ class GetAllCriteria
6
+ @@schema_type = "getAllCriteria"
7
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
8
+ @@schema_qualified = "true"
9
+ @@schema_element = [
10
+ ["adGroupId", "SOAP::SOAPInt"]
11
+ ]
12
+
13
+ attr_accessor :adGroupId
14
+
15
+ def initialize(adGroupId = nil)
16
+ @adGroupId = adGroupId
17
+ end
18
+ end
19
+
20
+ # {https://adwords.google.com/api/adwords/v4}getAllCriteriaResponse
21
+ class GetAllCriteriaResponse < ::Array
22
+ @@schema_element = [
23
+ ["getAllCriteriaReturn", ["Criterion[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "getAllCriteriaReturn")]]
24
+ ]
25
+ end
26
+
27
+ # {https://adwords.google.com/api/adwords/v4}getCriteria
28
+ class GetCriteria
29
+ @@schema_type = "getCriteria"
30
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
31
+ @@schema_qualified = "true"
32
+ @@schema_element = [
33
+ ["adGroupId", "SOAP::SOAPInt"],
34
+ ["criterionIds", "SOAP::SOAPLong[]"]
35
+ ]
36
+
37
+ attr_accessor :adGroupId
38
+ attr_accessor :criterionIds
39
+
40
+ def initialize(adGroupId = nil, criterionIds = [])
41
+ @adGroupId = adGroupId
42
+ @criterionIds = criterionIds
43
+ end
44
+ end
45
+
46
+ # {https://adwords.google.com/api/adwords/v4}getCriteriaResponse
47
+ class GetCriteriaResponse < ::Array
48
+ @@schema_element = [
49
+ ["getCriteriaReturn", ["Criterion[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "getCriteriaReturn")]]
50
+ ]
51
+ end
52
+
53
+ # {https://adwords.google.com/api/adwords/v4}updateCriteria
54
+ class UpdateCriteria < ::Array
55
+ @@schema_element = [
56
+ ["Criteria", ["Criterion[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "Criteria")]]
57
+ ]
58
+ end
59
+
60
+ # {https://adwords.google.com/api/adwords/v4}updateCriteriaResponse
61
+ class UpdateCriteriaResponse
62
+ @@schema_type = "updateCriteriaResponse"
63
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
64
+ @@schema_qualified = "true"
65
+ @@schema_element = []
66
+
67
+ def initialize
68
+ end
69
+ end
70
+
71
+ # {https://adwords.google.com/api/adwords/v4}addCriteria
72
+ class AddCriteria < ::Array
73
+ @@schema_element = [
74
+ ["newCriteria", ["Criterion[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "newCriteria")]]
75
+ ]
76
+ end
77
+
78
+ # {https://adwords.google.com/api/adwords/v4}addCriteriaResponse
79
+ class AddCriteriaResponse < ::Array
80
+ @@schema_element = [
81
+ ["addCriteriaReturn", ["Criterion[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "addCriteriaReturn")]]
82
+ ]
83
+ end
84
+
85
+ # {https://adwords.google.com/api/adwords/v4}removeCriteria
86
+ class RemoveCriteria
87
+ @@schema_type = "removeCriteria"
88
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
89
+ @@schema_qualified = "true"
90
+ @@schema_element = [
91
+ ["adGroupId", "SOAP::SOAPInt"],
92
+ ["criterionIds", "SOAP::SOAPLong[]"]
93
+ ]
94
+
95
+ attr_accessor :adGroupId
96
+ attr_accessor :criterionIds
97
+
98
+ def initialize(adGroupId = nil, criterionIds = [])
99
+ @adGroupId = adGroupId
100
+ @criterionIds = criterionIds
101
+ end
102
+ end
103
+
104
+ # {https://adwords.google.com/api/adwords/v4}removeCriteriaResponse
105
+ class RemoveCriteriaResponse
106
+ @@schema_type = "removeCriteriaResponse"
107
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
108
+ @@schema_qualified = "true"
109
+ @@schema_element = []
110
+
111
+ def initialize
112
+ end
113
+ end
114
+
115
+ # {https://adwords.google.com/api/adwords/v4}getCriterionStats
116
+ class GetCriterionStats
117
+ @@schema_type = "getCriterionStats"
118
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
119
+ @@schema_qualified = "true"
120
+ @@schema_element = [
121
+ ["adGroupId", "SOAP::SOAPInt"],
122
+ ["criterionIds", "SOAP::SOAPLong[]"],
123
+ ["startDay", "SOAP::SOAPDate"],
124
+ ["endDay", "SOAP::SOAPDate"],
125
+ ["inPST", "SOAP::SOAPBoolean"]
126
+ ]
127
+
128
+ attr_accessor :adGroupId
129
+ attr_accessor :criterionIds
130
+ attr_accessor :startDay
131
+ attr_accessor :endDay
132
+ attr_accessor :inPST
133
+
134
+ def initialize(adGroupId = nil, criterionIds = [], startDay = nil, endDay = nil, inPST = nil)
135
+ @adGroupId = adGroupId
136
+ @criterionIds = criterionIds
137
+ @startDay = startDay
138
+ @endDay = endDay
139
+ @inPST = inPST
140
+ end
141
+ end
142
+
143
+ # {https://adwords.google.com/api/adwords/v4}getCriterionStatsResponse
144
+ class GetCriterionStatsResponse < ::Array
145
+ @@schema_element = [
146
+ ["getCriterionStatsReturn", ["StatsRecord[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "getCriterionStatsReturn")]]
147
+ ]
148
+ end
149
+
150
+ # {https://adwords.google.com/api/adwords/v4}getCampaignNegativeCriteria
151
+ class GetCampaignNegativeCriteria
152
+ @@schema_type = "getCampaignNegativeCriteria"
153
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
154
+ @@schema_qualified = "true"
155
+ @@schema_element = [
156
+ ["campaignId", "SOAP::SOAPInt"]
157
+ ]
158
+
159
+ attr_accessor :campaignId
160
+
161
+ def initialize(campaignId = nil)
162
+ @campaignId = campaignId
163
+ end
164
+ end
165
+
166
+ # {https://adwords.google.com/api/adwords/v4}getCampaignNegativeCriteriaResponse
167
+ class GetCampaignNegativeCriteriaResponse < ::Array
168
+ @@schema_element = [
169
+ ["getCampaignNegativeCriteriaReturn", ["Criterion[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "getCampaignNegativeCriteriaReturn")]]
170
+ ]
171
+ end
172
+
173
+ # {https://adwords.google.com/api/adwords/v4}setCampaignNegativeCriteria
174
+ class SetCampaignNegativeCriteria
175
+ @@schema_type = "setCampaignNegativeCriteria"
176
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
177
+ @@schema_qualified = "true"
178
+ @@schema_element = [
179
+ ["campaignId", "SOAP::SOAPInt"],
180
+ ["criteria", "Criterion[]"]
181
+ ]
182
+
183
+ attr_accessor :campaignId
184
+ attr_accessor :criteria
185
+
186
+ def initialize(campaignId = nil, criteria = [])
187
+ @campaignId = campaignId
188
+ @criteria = criteria
189
+ end
190
+ end
191
+
192
+ # {https://adwords.google.com/api/adwords/v4}setCampaignNegativeCriteriaResponse
193
+ class SetCampaignNegativeCriteriaResponse
194
+ @@schema_type = "setCampaignNegativeCriteriaResponse"
195
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
196
+ @@schema_qualified = "true"
197
+ @@schema_element = []
198
+
199
+ def initialize
200
+ end
201
+ end
202
+
203
+ # {https://adwords.google.com/api/adwords/v4}Criterion
204
+ class Criterion
205
+ @@schema_type = "Criterion"
206
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
207
+ @@schema_element = [
208
+ ["adGroupId", "SOAP::SOAPInt"],
209
+ ["criterionType", "SOAP::SOAPString"],
210
+ ["destinationUrl", "SOAP::SOAPString"],
211
+ ["exemptionRequest", "SOAP::SOAPString"],
212
+ ["id", "SOAP::SOAPLong"],
213
+ ["language", "SOAP::SOAPString"],
214
+ ["negative", "SOAP::SOAPBoolean"],
215
+ ["status", "SOAP::SOAPString"]
216
+ ]
217
+
218
+ attr_accessor :adGroupId
219
+ attr_accessor :criterionType
220
+ attr_accessor :destinationUrl
221
+ attr_accessor :exemptionRequest
222
+ attr_accessor :id
223
+ attr_accessor :language
224
+ attr_accessor :negative
225
+ attr_accessor :status
226
+
227
+ def initialize(adGroupId = nil, criterionType = nil, destinationUrl = nil, exemptionRequest = nil, id = nil, language = nil, negative = nil, status = nil)
228
+ @adGroupId = adGroupId
229
+ @criterionType = criterionType
230
+ @destinationUrl = destinationUrl
231
+ @exemptionRequest = exemptionRequest
232
+ @id = id
233
+ @language = language
234
+ @negative = negative
235
+ @status = status
236
+ end
237
+ end
238
+
239
+ # {https://adwords.google.com/api/adwords/v4}Keyword
240
+ class Keyword
241
+ @@schema_type = "Keyword"
242
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
243
+ @@schema_element = [
244
+ ["adGroupId", "SOAP::SOAPInt"],
245
+ ["criterionType", "SOAP::SOAPString"],
246
+ ["destinationUrl", "SOAP::SOAPString"],
247
+ ["exemptionRequest", "SOAP::SOAPString"],
248
+ ["id", "SOAP::SOAPLong"],
249
+ ["language", "SOAP::SOAPString"],
250
+ ["negative", "SOAP::SOAPBoolean"],
251
+ ["status", "SOAP::SOAPString"],
252
+ ["maxCpc", "SOAP::SOAPLong"],
253
+ ["minCpc", "SOAP::SOAPLong"],
254
+ ["text", "SOAP::SOAPString"],
255
+ ["type", "SOAP::SOAPString"]
256
+ ]
257
+
258
+ attr_accessor :adGroupId
259
+ attr_accessor :criterionType
260
+ attr_accessor :destinationUrl
261
+ attr_accessor :exemptionRequest
262
+ attr_accessor :id
263
+ attr_accessor :language
264
+ attr_accessor :negative
265
+ attr_accessor :status
266
+ attr_accessor :maxCpc
267
+ attr_accessor :minCpc
268
+ attr_accessor :text
269
+ attr_accessor :type
270
+
271
+ def initialize(adGroupId = nil, criterionType = nil, destinationUrl = nil, exemptionRequest = nil, id = nil, language = nil, negative = nil, status = nil, maxCpc = nil, minCpc = nil, text = nil, type = nil)
272
+ @adGroupId = adGroupId
273
+ @criterionType = criterionType
274
+ @destinationUrl = destinationUrl
275
+ @exemptionRequest = exemptionRequest
276
+ @id = id
277
+ @language = language
278
+ @negative = negative
279
+ @status = status
280
+ @maxCpc = maxCpc
281
+ @minCpc = minCpc
282
+ @text = text
283
+ @type = type
284
+ end
285
+ end
286
+
287
+ # {https://adwords.google.com/api/adwords/v4}Website
288
+ class Website
289
+ @@schema_type = "Website"
290
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
291
+ @@schema_element = [
292
+ ["adGroupId", "SOAP::SOAPInt"],
293
+ ["criterionType", "SOAP::SOAPString"],
294
+ ["destinationUrl", "SOAP::SOAPString"],
295
+ ["exemptionRequest", "SOAP::SOAPString"],
296
+ ["id", "SOAP::SOAPLong"],
297
+ ["language", "SOAP::SOAPString"],
298
+ ["negative", "SOAP::SOAPBoolean"],
299
+ ["status", "SOAP::SOAPString"],
300
+ ["maxCpm", "SOAP::SOAPLong"],
301
+ ["url", "SOAP::SOAPString"]
302
+ ]
303
+
304
+ attr_accessor :adGroupId
305
+ attr_accessor :criterionType
306
+ attr_accessor :destinationUrl
307
+ attr_accessor :exemptionRequest
308
+ attr_accessor :id
309
+ attr_accessor :language
310
+ attr_accessor :negative
311
+ attr_accessor :status
312
+ attr_accessor :maxCpm
313
+ attr_accessor :url
314
+
315
+ def initialize(adGroupId = nil, criterionType = nil, destinationUrl = nil, exemptionRequest = nil, id = nil, language = nil, negative = nil, status = nil, maxCpm = nil, url = nil)
316
+ @adGroupId = adGroupId
317
+ @criterionType = criterionType
318
+ @destinationUrl = destinationUrl
319
+ @exemptionRequest = exemptionRequest
320
+ @id = id
321
+ @language = language
322
+ @negative = negative
323
+ @status = status
324
+ @maxCpm = maxCpm
325
+ @url = url
326
+ end
327
+ end
328
+
329
+ # {https://adwords.google.com/api/adwords/v4}ApiException
330
+ class ApiException
331
+ @@schema_type = "ApiException"
332
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
333
+ @@schema_element = [
334
+ ["code", "SOAP::SOAPInt"],
335
+ ["internal", "SOAP::SOAPBoolean"],
336
+ ["message", "SOAP::SOAPString"],
337
+ ["trigger", "SOAP::SOAPString"],
338
+ ["violations", "SOAP::SOAPString"]
339
+ ]
340
+
341
+ attr_accessor :code
342
+ attr_accessor :internal
343
+ attr_accessor :message
344
+ attr_accessor :trigger
345
+ attr_accessor :violations
346
+
347
+ def initialize(code = nil, internal = nil, message = nil, trigger = nil, violations = nil)
348
+ @code = code
349
+ @internal = internal
350
+ @message = message
351
+ @trigger = trigger
352
+ @violations = violations
353
+ end
354
+ end
355
+
356
+ # {https://adwords.google.com/api/adwords/v4}StatsRecord
357
+ class StatsRecord
358
+ @@schema_type = "StatsRecord"
359
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
360
+ @@schema_element = [
361
+ ["averagePosition", "SOAP::SOAPDouble"],
362
+ ["clicks", "SOAP::SOAPLong"],
363
+ ["conversionRate", "SOAP::SOAPDouble"],
364
+ ["conversions", "SOAP::SOAPLong"],
365
+ ["cost", "SOAP::SOAPLong"],
366
+ ["id", "SOAP::SOAPLong"],
367
+ ["impressions", "SOAP::SOAPLong"]
368
+ ]
369
+
370
+ attr_accessor :averagePosition
371
+ attr_accessor :clicks
372
+ attr_accessor :conversionRate
373
+ attr_accessor :conversions
374
+ attr_accessor :cost
375
+ attr_accessor :id
376
+ attr_accessor :impressions
377
+
378
+ def initialize(averagePosition = nil, clicks = nil, conversionRate = nil, conversions = nil, cost = nil, id = nil, impressions = nil)
379
+ @averagePosition = averagePosition
380
+ @clicks = clicks
381
+ @conversionRate = conversionRate
382
+ @conversions = conversions
383
+ @cost = cost
384
+ @id = id
385
+ @impressions = impressions
386
+ end
387
+ end
388
+
389
+ # {https://adwords.google.com/api/adwords/v4}CriterionStatus
390
+ class CriterionStatus < ::String
391
+ @@schema_type = "CriterionStatus"
392
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
393
+
394
+ Deleted = CriterionStatus.new("Deleted")
395
+ Disabled = CriterionStatus.new("Disabled")
396
+ Disapproved = CriterionStatus.new("Disapproved")
397
+ InTrial = CriterionStatus.new("InTrial")
398
+ Normal = CriterionStatus.new("Normal")
399
+ OnHold = CriterionStatus.new("OnHold")
400
+ end
401
+
402
+ # {https://adwords.google.com/api/adwords/v4}KeywordType
403
+ class KeywordType < ::String
404
+ @@schema_type = "KeywordType"
405
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
406
+
407
+ Broad = KeywordType.new("Broad")
408
+ Exact = KeywordType.new("Exact")
409
+ Phrase = KeywordType.new("Phrase")
410
+ end
411
+ end