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,111 @@
1
+ module AdWords
2
+ require 'adwords4r/v4/CampaignService'
3
+
4
+ require 'soap/rpc/driver'
5
+
6
+ class CampaignService < ::SOAP::RPC::Driver
7
+ DefaultEndpointUrl = "https://adwords.google.com/api/adwords/v4/CampaignService"
8
+ MappingRegistry = ::SOAP::Mapping::Registry.new
9
+
10
+ Methods = [
11
+ [ "",
12
+ "getCampaign",
13
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCampaign"], true],
14
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCampaignResponse"], true] ],
15
+ { :request_style => :document, :request_use => :literal,
16
+ :response_style => :document, :response_use => :literal }
17
+ ],
18
+ [ "",
19
+ "getCampaignList",
20
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCampaignList"], true],
21
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCampaignListResponse"], true] ],
22
+ { :request_style => :document, :request_use => :literal,
23
+ :response_style => :document, :response_use => :literal }
24
+ ],
25
+ [ "",
26
+ "getAllAdWordsCampaigns",
27
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getAllAdWordsCampaigns"], true],
28
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getAllAdWordsCampaignsResponse"], true] ],
29
+ { :request_style => :document, :request_use => :literal,
30
+ :response_style => :document, :response_use => :literal }
31
+ ],
32
+ [ "",
33
+ "addCampaign",
34
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCampaign"], true],
35
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCampaignResponse"], true] ],
36
+ { :request_style => :document, :request_use => :literal,
37
+ :response_style => :document, :response_use => :literal }
38
+ ],
39
+ [ "",
40
+ "addCampaignList",
41
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCampaignList"], true],
42
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "addCampaignListResponse"], true] ],
43
+ { :request_style => :document, :request_use => :literal,
44
+ :response_style => :document, :response_use => :literal }
45
+ ],
46
+ [ "",
47
+ "updateCampaign",
48
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "updateCampaign"], true],
49
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "updateCampaignResponse"], true] ],
50
+ { :request_style => :document, :request_use => :literal,
51
+ :response_style => :document, :response_use => :literal }
52
+ ],
53
+ [ "",
54
+ "updateCampaignList",
55
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "updateCampaignList"], true],
56
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "updateCampaignListResponse"], true] ],
57
+ { :request_style => :document, :request_use => :literal,
58
+ :response_style => :document, :response_use => :literal }
59
+ ],
60
+ [ "",
61
+ "getOptimizeAdServing",
62
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getOptimizeAdServing"], true],
63
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getOptimizeAdServingResponse"], true] ],
64
+ { :request_style => :document, :request_use => :literal,
65
+ :response_style => :document, :response_use => :literal }
66
+ ],
67
+ [ "",
68
+ "setOptimizeAdServing",
69
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "setOptimizeAdServing"], true],
70
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "setOptimizeAdServingResponse"], true] ],
71
+ { :request_style => :document, :request_use => :literal,
72
+ :response_style => :document, :response_use => :literal }
73
+ ],
74
+ [ "",
75
+ "getCampaignStats",
76
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCampaignStats"], true],
77
+ ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v4", "getCampaignStatsResponse"], true] ],
78
+ { :request_style => :document, :request_use => :literal,
79
+ :response_style => :document, :response_use => :literal }
80
+ ]
81
+ ]
82
+
83
+ def initialize(endpoint_url = nil)
84
+ endpoint_url ||= DefaultEndpointUrl
85
+ super(endpoint_url, nil)
86
+ self.mapping_registry = MappingRegistry
87
+ init_methods
88
+ end
89
+
90
+ private
91
+
92
+ def init_methods
93
+ Methods.each do |definitions|
94
+ opt = definitions.last
95
+ if opt[:request_style] == :document
96
+ add_document_operation(*definitions)
97
+ else
98
+ add_rpc_operation(*definitions)
99
+ qname = definitions[0]
100
+ name = definitions[2]
101
+ if qname.name != name and qname.name.capitalize == name.capitalize
102
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
103
+ __send__(name, *arg)
104
+ end
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
110
+
111
+ end
@@ -0,0 +1,401 @@
1
+ module AdWords
2
+ require 'xsd/qname'
3
+
4
+ # {https://adwords.google.com/api/adwords/v4}getAllCreatives
5
+ class GetAllCreatives
6
+ @@schema_type = "getAllCreatives"
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}getAllCreativesResponse
21
+ class GetAllCreativesResponse < ::Array
22
+ @@schema_element = [
23
+ ["getAllCreativesReturn", ["Creative[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "getAllCreativesReturn")]]
24
+ ]
25
+ end
26
+
27
+ # {https://adwords.google.com/api/adwords/v4}getActiveCreatives
28
+ class GetActiveCreatives
29
+ @@schema_type = "getActiveCreatives"
30
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
31
+ @@schema_qualified = "true"
32
+ @@schema_element = [
33
+ ["adGroupId", "SOAP::SOAPInt"]
34
+ ]
35
+
36
+ attr_accessor :adGroupId
37
+
38
+ def initialize(adGroupId = nil)
39
+ @adGroupId = adGroupId
40
+ end
41
+ end
42
+
43
+ # {https://adwords.google.com/api/adwords/v4}getActiveCreativesResponse
44
+ class GetActiveCreativesResponse < ::Array
45
+ @@schema_element = [
46
+ ["getActiveCreativesReturn", ["Creative[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "getActiveCreativesReturn")]]
47
+ ]
48
+ end
49
+
50
+ # {https://adwords.google.com/api/adwords/v4}getCreative
51
+ class GetCreative
52
+ @@schema_type = "getCreative"
53
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
54
+ @@schema_qualified = "true"
55
+ @@schema_element = [
56
+ ["adGroupId", "SOAP::SOAPInt"],
57
+ ["creativeId", "SOAP::SOAPInt"]
58
+ ]
59
+
60
+ attr_accessor :adGroupId
61
+ attr_accessor :creativeId
62
+
63
+ def initialize(adGroupId = nil, creativeId = nil)
64
+ @adGroupId = adGroupId
65
+ @creativeId = creativeId
66
+ end
67
+ end
68
+
69
+ # {https://adwords.google.com/api/adwords/v4}getCreativeResponse
70
+ class GetCreativeResponse
71
+ @@schema_type = "getCreativeResponse"
72
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
73
+ @@schema_qualified = "true"
74
+ @@schema_element = [
75
+ ["getCreativeReturn", "Creative"]
76
+ ]
77
+
78
+ attr_accessor :getCreativeReturn
79
+
80
+ def initialize(getCreativeReturn = nil)
81
+ @getCreativeReturn = getCreativeReturn
82
+ end
83
+ end
84
+
85
+ # {https://adwords.google.com/api/adwords/v4}addCreative
86
+ class AddCreative
87
+ @@schema_type = "addCreative"
88
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
89
+ @@schema_qualified = "true"
90
+ @@schema_element = [
91
+ ["creative", "Creative"]
92
+ ]
93
+
94
+ attr_accessor :creative
95
+
96
+ def initialize(creative = nil)
97
+ @creative = creative
98
+ end
99
+ end
100
+
101
+ # {https://adwords.google.com/api/adwords/v4}addCreativeResponse
102
+ class AddCreativeResponse
103
+ @@schema_type = "addCreativeResponse"
104
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
105
+ @@schema_qualified = "true"
106
+ @@schema_element = [
107
+ ["addCreativeReturn", "Creative"]
108
+ ]
109
+
110
+ attr_accessor :addCreativeReturn
111
+
112
+ def initialize(addCreativeReturn = nil)
113
+ @addCreativeReturn = addCreativeReturn
114
+ end
115
+ end
116
+
117
+ # {https://adwords.google.com/api/adwords/v4}addCreativeList
118
+ class AddCreativeList < ::Array
119
+ @@schema_element = [
120
+ ["creatives", ["Creative[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "creatives")]]
121
+ ]
122
+ end
123
+
124
+ # {https://adwords.google.com/api/adwords/v4}addCreativeListResponse
125
+ class AddCreativeListResponse < ::Array
126
+ @@schema_element = [
127
+ ["addCreativeListReturn", ["Creative[]", XSD::QName.new("https://adwords.google.com/api/adwords/v4", "addCreativeListReturn")]]
128
+ ]
129
+ end
130
+
131
+ # {https://adwords.google.com/api/adwords/v4}deleteCreative
132
+ class DeleteCreative
133
+ @@schema_type = "deleteCreative"
134
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
135
+ @@schema_qualified = "true"
136
+ @@schema_element = [
137
+ ["adGroupId", "SOAP::SOAPInt"],
138
+ ["creativeId", "SOAP::SOAPInt"]
139
+ ]
140
+
141
+ attr_accessor :adGroupId
142
+ attr_accessor :creativeId
143
+
144
+ def initialize(adGroupId = nil, creativeId = nil)
145
+ @adGroupId = adGroupId
146
+ @creativeId = creativeId
147
+ end
148
+ end
149
+
150
+ # {https://adwords.google.com/api/adwords/v4}deleteCreativeResponse
151
+ class DeleteCreativeResponse
152
+ @@schema_type = "deleteCreativeResponse"
153
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
154
+ @@schema_qualified = "true"
155
+ @@schema_element = []
156
+
157
+ def initialize
158
+ end
159
+ end
160
+
161
+ # {https://adwords.google.com/api/adwords/v4}deleteCreativeList
162
+ class DeleteCreativeList
163
+ @@schema_type = "deleteCreativeList"
164
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
165
+ @@schema_qualified = "true"
166
+ @@schema_element = [
167
+ ["adGroupIds", "SOAP::SOAPInt[]"],
168
+ ["creativeIds", "SOAP::SOAPInt[]"]
169
+ ]
170
+
171
+ attr_accessor :adGroupIds
172
+ attr_accessor :creativeIds
173
+
174
+ def initialize(adGroupIds = [], creativeIds = [])
175
+ @adGroupIds = adGroupIds
176
+ @creativeIds = creativeIds
177
+ end
178
+ end
179
+
180
+ # {https://adwords.google.com/api/adwords/v4}deleteCreativeListResponse
181
+ class DeleteCreativeListResponse
182
+ @@schema_type = "deleteCreativeListResponse"
183
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
184
+ @@schema_qualified = "true"
185
+ @@schema_element = []
186
+
187
+ def initialize
188
+ end
189
+ end
190
+
191
+ # {https://adwords.google.com/api/adwords/v4}activateCreative
192
+ class ActivateCreative
193
+ @@schema_type = "activateCreative"
194
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
195
+ @@schema_qualified = "true"
196
+ @@schema_element = [
197
+ ["adGroupId", "SOAP::SOAPInt"],
198
+ ["creativeId", "SOAP::SOAPInt"]
199
+ ]
200
+
201
+ attr_accessor :adGroupId
202
+ attr_accessor :creativeId
203
+
204
+ def initialize(adGroupId = nil, creativeId = nil)
205
+ @adGroupId = adGroupId
206
+ @creativeId = creativeId
207
+ end
208
+ end
209
+
210
+ # {https://adwords.google.com/api/adwords/v4}activateCreativeResponse
211
+ class ActivateCreativeResponse
212
+ @@schema_type = "activateCreativeResponse"
213
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
214
+ @@schema_qualified = "true"
215
+ @@schema_element = []
216
+
217
+ def initialize
218
+ end
219
+ end
220
+
221
+ # {https://adwords.google.com/api/adwords/v4}activateCreativeList
222
+ class ActivateCreativeList
223
+ @@schema_type = "activateCreativeList"
224
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
225
+ @@schema_qualified = "true"
226
+ @@schema_element = [
227
+ ["adGroupIds", "SOAP::SOAPInt[]"],
228
+ ["creativeIds", "SOAP::SOAPInt[]"]
229
+ ]
230
+
231
+ attr_accessor :adGroupIds
232
+ attr_accessor :creativeIds
233
+
234
+ def initialize(adGroupIds = [], creativeIds = [])
235
+ @adGroupIds = adGroupIds
236
+ @creativeIds = creativeIds
237
+ end
238
+ end
239
+
240
+ # {https://adwords.google.com/api/adwords/v4}activateCreativeListResponse
241
+ class ActivateCreativeListResponse
242
+ @@schema_type = "activateCreativeListResponse"
243
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
244
+ @@schema_qualified = "true"
245
+ @@schema_element = []
246
+
247
+ def initialize
248
+ end
249
+ end
250
+
251
+ # {https://adwords.google.com/api/adwords/v4}Image
252
+ class Image
253
+ @@schema_type = "Image"
254
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
255
+ @@schema_element = [
256
+ ["data", "SOAP::SOAPBase64"],
257
+ ["height", "SOAP::SOAPInt"],
258
+ ["imageUrl", "SOAP::SOAPString"],
259
+ ["mimeType", "SOAP::SOAPString"],
260
+ ["name", "SOAP::SOAPString"],
261
+ ["thumbnailUrl", "SOAP::SOAPString"],
262
+ ["type", "SOAP::SOAPString"],
263
+ ["width", "SOAP::SOAPInt"]
264
+ ]
265
+
266
+ attr_accessor :data
267
+ attr_accessor :height
268
+ attr_accessor :imageUrl
269
+ attr_accessor :mimeType
270
+ attr_accessor :name
271
+ attr_accessor :thumbnailUrl
272
+ attr_accessor :type
273
+ attr_accessor :width
274
+
275
+ def initialize(data = nil, height = nil, imageUrl = nil, mimeType = nil, name = nil, thumbnailUrl = nil, type = nil, width = nil)
276
+ @data = data
277
+ @height = height
278
+ @imageUrl = imageUrl
279
+ @mimeType = mimeType
280
+ @name = name
281
+ @thumbnailUrl = thumbnailUrl
282
+ @type = type
283
+ @width = width
284
+ end
285
+ end
286
+
287
+ # {https://adwords.google.com/api/adwords/v4}Creative
288
+ class Creative
289
+ @@schema_type = "Creative"
290
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
291
+ @@schema_element = [
292
+ ["adGroupId", "SOAP::SOAPInt"],
293
+ ["deleted", "SOAP::SOAPBoolean"],
294
+ ["description1", "SOAP::SOAPString"],
295
+ ["description2", "SOAP::SOAPString"],
296
+ ["destinationUrl", "SOAP::SOAPString"],
297
+ ["disapproved", "SOAP::SOAPBoolean"],
298
+ ["displayUrl", "SOAP::SOAPString"],
299
+ ["exemptionRequest", "SOAP::SOAPString"],
300
+ ["headline", "SOAP::SOAPString"],
301
+ ["id", "SOAP::SOAPInt"],
302
+ ["image", "Image"]
303
+ ]
304
+
305
+ attr_accessor :adGroupId
306
+ attr_accessor :deleted
307
+ attr_accessor :description1
308
+ attr_accessor :description2
309
+ attr_accessor :destinationUrl
310
+ attr_accessor :disapproved
311
+ attr_accessor :displayUrl
312
+ attr_accessor :exemptionRequest
313
+ attr_accessor :headline
314
+ attr_accessor :id
315
+ attr_accessor :image
316
+
317
+ def initialize(adGroupId = nil, deleted = nil, description1 = nil, description2 = nil, destinationUrl = nil, disapproved = nil, displayUrl = nil, exemptionRequest = nil, headline = nil, id = nil, image = nil)
318
+ @adGroupId = adGroupId
319
+ @deleted = deleted
320
+ @description1 = description1
321
+ @description2 = description2
322
+ @destinationUrl = destinationUrl
323
+ @disapproved = disapproved
324
+ @displayUrl = displayUrl
325
+ @exemptionRequest = exemptionRequest
326
+ @headline = headline
327
+ @id = id
328
+ @image = image
329
+ end
330
+ end
331
+
332
+ # {https://adwords.google.com/api/adwords/v4}AdPolicyViolation
333
+ class AdPolicyViolation
334
+ @@schema_type = "AdPolicyViolation"
335
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
336
+ @@schema_element = [
337
+ ["detail", "SOAP::SOAPString"],
338
+ ["index", "SOAP::SOAPInt"],
339
+ ["isExemptable", "SOAP::SOAPBoolean"],
340
+ ["line", "SOAP::SOAPInt"],
341
+ ["textIndex", "SOAP::SOAPInt"],
342
+ ["textLength", "SOAP::SOAPInt"],
343
+ ["trigger", "SOAP::SOAPString"]
344
+ ]
345
+
346
+ attr_accessor :detail
347
+ attr_accessor :index
348
+ attr_accessor :isExemptable
349
+ attr_accessor :line
350
+ attr_accessor :textIndex
351
+ attr_accessor :textLength
352
+ attr_accessor :trigger
353
+
354
+ def initialize(detail = nil, index = nil, isExemptable = nil, line = nil, textIndex = nil, textLength = nil, trigger = nil)
355
+ @detail = detail
356
+ @index = index
357
+ @isExemptable = isExemptable
358
+ @line = line
359
+ @textIndex = textIndex
360
+ @textLength = textLength
361
+ @trigger = trigger
362
+ end
363
+ end
364
+
365
+ # {https://adwords.google.com/api/adwords/v4}ApiException
366
+ class ApiException
367
+ @@schema_type = "ApiException"
368
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
369
+ @@schema_element = [
370
+ ["code", "SOAP::SOAPInt"],
371
+ ["internal", "SOAP::SOAPBoolean"],
372
+ ["message", "SOAP::SOAPString"],
373
+ ["trigger", "SOAP::SOAPString"],
374
+ ["violations", "SOAP::SOAPString"]
375
+ ]
376
+
377
+ attr_accessor :code
378
+ attr_accessor :internal
379
+ attr_accessor :message
380
+ attr_accessor :trigger
381
+ attr_accessor :violations
382
+
383
+ def initialize(code = nil, internal = nil, message = nil, trigger = nil, violations = nil)
384
+ @code = code
385
+ @internal = internal
386
+ @message = message
387
+ @trigger = trigger
388
+ @violations = violations
389
+ end
390
+ end
391
+
392
+ # {https://adwords.google.com/api/adwords/v4}ImageType
393
+ class ImageType < ::String
394
+ @@schema_type = "ImageType"
395
+ @@schema_ns = "https://adwords.google.com/api/adwords/v4"
396
+
397
+ DynamicImage = ImageType.new("dynamicImage")
398
+ Flash = ImageType.new("flash")
399
+ Image = ImageType.new("image")
400
+ end
401
+ end