google-adwords-api 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/examples/v201101/add_conversion.rb +97 -0
- data/examples/v201101/add_user_list.rb +28 -2
- data/examples/v201101/get_all_conversions.rb +88 -0
- data/examples/v201101/get_keyword_opportunities.rb +103 -0
- data/examples/v201101/update_conversion.rb +96 -0
- data/lib/adwords_api/api_config.rb +6 -3
- data/lib/adwords_api/errors.rb +4 -1
- data/lib/adwords_api/extensions.rb +1 -1
- data/lib/adwords_api/v13/AccountServiceDriver.rb +5 -5
- data/lib/adwords_api/v13/ReportServiceDriver.rb +7 -7
- data/lib/adwords_api/v13/TrafficEstimatorServiceDriver.rb +4 -4
- data/lib/adwords_api/v200909/AdExtensionOverrideServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/AdGroupAdServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/AdGroupCriterionService.rb +506 -506
- data/lib/adwords_api/v200909/AdGroupCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/AdGroupCriterionServiceMappingRegistry.rb +428 -428
- data/lib/adwords_api/v200909/AdGroupServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/AdParamServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/BulkMutateJobServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/CampaignAdExtensionServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/CampaignCriterionService.rb +133 -133
- data/lib/adwords_api/v200909/CampaignCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/CampaignCriterionServiceMappingRegistry.rb +184 -184
- data/lib/adwords_api/v200909/CampaignServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/CampaignTargetServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/GeoLocationServiceDriver.rb +1 -1
- data/lib/adwords_api/v200909/InfoServiceDriver.rb +1 -1
- data/lib/adwords_api/v200909/TargetingIdeaService.rb +907 -907
- data/lib/adwords_api/v200909/TargetingIdeaServiceDriver.rb +2 -2
- data/lib/adwords_api/v200909/TargetingIdeaServiceMappingRegistry.rb +384 -384
- data/lib/adwords_api/v201003/AdExtensionOverrideServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/AdGroupAdServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/AdGroupCriterionService.rb +527 -527
- data/lib/adwords_api/v201003/AdGroupCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/AdGroupCriterionServiceMappingRegistry.rb +469 -469
- data/lib/adwords_api/v201003/AdGroupServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/AdParamServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/BidLandscapeServiceDriver.rb +1 -1
- data/lib/adwords_api/v201003/BulkMutateJobServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/CampaignAdExtensionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/CampaignCriterionService.rb +133 -133
- data/lib/adwords_api/v201003/CampaignCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/CampaignCriterionServiceMappingRegistry.rb +186 -186
- data/lib/adwords_api/v201003/CampaignServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/CampaignTargetServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/GeoLocationServiceDriver.rb +1 -1
- data/lib/adwords_api/v201003/InfoServiceDriver.rb +1 -1
- data/lib/adwords_api/v201003/MediaServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/ReportDefinitionServiceDriver.rb +3 -3
- data/lib/adwords_api/v201003/TargetingIdeaService.rb +1304 -1304
- data/lib/adwords_api/v201003/TargetingIdeaServiceDriver.rb +2 -2
- data/lib/adwords_api/v201003/TargetingIdeaServiceMappingRegistry.rb +401 -401
- data/lib/adwords_api/v201008/AdExtensionOverrideServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/AdGroupAdServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/AdGroupCriterionService.rb +598 -598
- data/lib/adwords_api/v201008/AdGroupCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/AdGroupCriterionServiceMappingRegistry.rb +680 -680
- data/lib/adwords_api/v201008/AdGroupServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/AdParamServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/AlertServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/BidLandscapeServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/BulkMutateJobServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/CampaignAdExtensionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/CampaignCriterionService.rb +178 -178
- data/lib/adwords_api/v201008/CampaignCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/CampaignCriterionServiceMappingRegistry.rb +228 -228
- data/lib/adwords_api/v201008/CampaignServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/CampaignTargetServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/CustomerSyncServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/ExperimentServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/GeoLocationServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/InfoServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/MediaServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/ReportDefinitionServiceDriver.rb +3 -3
- data/lib/adwords_api/v201008/ServicedAccountServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/TargetingIdeaService.rb +1459 -1459
- data/lib/adwords_api/v201008/TargetingIdeaServiceDriver.rb +2 -2
- data/lib/adwords_api/v201008/TargetingIdeaServiceMappingRegistry.rb +447 -447
- data/lib/adwords_api/v201008/TrafficEstimatorService.rb +855 -855
- data/lib/adwords_api/v201008/TrafficEstimatorServiceDriver.rb +1 -1
- data/lib/adwords_api/v201008/TrafficEstimatorServiceMappingRegistry.rb +126 -126
- data/lib/adwords_api/v201008/UserListServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/AdExtensionOverrideServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/AdGroupAdService.rb +2 -0
- data/lib/adwords_api/v201101/AdGroupAdServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/AdGroupCriterionService.rb +700 -700
- data/lib/adwords_api/v201101/AdGroupCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/AdGroupCriterionServiceMappingRegistry.rb +670 -670
- data/lib/adwords_api/v201101/AdGroupServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/AdParamServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/AlertServiceDriver.rb +1 -1
- data/lib/adwords_api/v201101/BulkMutateJobService.rb +2 -0
- data/lib/adwords_api/v201101/BulkMutateJobServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/BulkOpportunityService.rb +1367 -0
- data/lib/adwords_api/v201101/BulkOpportunityServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/BulkOpportunityServiceMappingRegistry.rb +1668 -0
- data/lib/adwords_api/v201101/BulkOpportunityServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/CampaignAdExtensionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/CampaignCriterionService.rb +216 -216
- data/lib/adwords_api/v201101/CampaignCriterionServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/CampaignCriterionServiceMappingRegistry.rb +234 -234
- data/lib/adwords_api/v201101/CampaignServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/CampaignTargetServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/ConversionTrackerService.rb +1105 -0
- data/lib/adwords_api/v201101/ConversionTrackerServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/ConversionTrackerServiceMappingRegistry.rb +1161 -0
- data/lib/adwords_api/v201101/ConversionTrackerServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/CustomerSyncServiceDriver.rb +1 -1
- data/lib/adwords_api/v201101/DataServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/ExperimentServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/GeoLocationServiceDriver.rb +1 -1
- data/lib/adwords_api/v201101/InfoServiceDriver.rb +1 -1
- data/lib/adwords_api/v201101/MediaServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/ReportDefinitionServiceDriver.rb +3 -3
- data/lib/adwords_api/v201101/ReportDefinitionServiceWrapper.rb +14 -0
- data/lib/adwords_api/v201101/ServicedAccountServiceDriver.rb +1 -1
- data/lib/adwords_api/v201101/TargetingIdeaService.rb +1490 -1490
- data/lib/adwords_api/v201101/TargetingIdeaServiceDriver.rb +2 -2
- data/lib/adwords_api/v201101/TargetingIdeaServiceMappingRegistry.rb +507 -507
- data/lib/adwords_api/v201101/TrafficEstimatorService.rb +841 -841
- data/lib/adwords_api/v201101/TrafficEstimatorServiceDriver.rb +1 -1
- data/lib/adwords_api/v201101/TrafficEstimatorServiceMappingRegistry.rb +126 -126
- data/lib/adwords_api/v201101/UserListServiceDriver.rb +2 -2
- metadata +17 -5
@@ -0,0 +1,332 @@
|
|
1
|
+
# This file was automatically generated during the "rake generate" step of
|
2
|
+
# library setup.
|
3
|
+
require 'adwords_api/v201101/ConversionTrackerServiceDriver.rb'
|
4
|
+
|
5
|
+
module AdwordsApi
|
6
|
+
module V201101
|
7
|
+
module ConversionTrackerService
|
8
|
+
|
9
|
+
# Wrapper class for the v201101 ConversionTrackerService service.
|
10
|
+
# This class is automatically generated.
|
11
|
+
class ConversionTrackerServiceWrapper
|
12
|
+
|
13
|
+
# Holds the API object to which the wrapper belongs.
|
14
|
+
attr_reader :api
|
15
|
+
|
16
|
+
# Version and service utility fields.
|
17
|
+
attr_reader :version, :service
|
18
|
+
|
19
|
+
REGISTRY = AdwordsApi::V201101::ConversionTrackerService::DefaultMappingRegistry::LiteralRegistry
|
20
|
+
# This takes advantage of the code generated by soap4r to get the
|
21
|
+
# correct namespace for a given service. It accesses one of the fields
|
22
|
+
# in the description of the service's methods, which indicates the
|
23
|
+
# namespace.
|
24
|
+
# Since we're using a fixed version of soap4r (1.5.8), and this is
|
25
|
+
# automatically generated as part of the stub generation, it will
|
26
|
+
# always point to what we want.
|
27
|
+
NAMESPACE = 'https://adwords.google.com/api/adwords/cm/v201101'
|
28
|
+
|
29
|
+
# Holds a shortcut to the parent module.
|
30
|
+
# Use this to avoid typing the full class name when creating classes
|
31
|
+
# belonging to this service, e.g.
|
32
|
+
# service_object.module::ClassName
|
33
|
+
# instead of
|
34
|
+
# AdwordsApi::V201101::ConversionTrackerService::ClassName
|
35
|
+
# This will make it easier to migrate your code between API versions.
|
36
|
+
attr_reader :module
|
37
|
+
|
38
|
+
public
|
39
|
+
|
40
|
+
# Constructor for ConversionTrackerServiceWrapper.
|
41
|
+
#
|
42
|
+
# Args:
|
43
|
+
# - driver: SOAP::RPC::Driver object with the remote SOAP methods for
|
44
|
+
# this service
|
45
|
+
# - api: the API object to which the wrapper belongs
|
46
|
+
#
|
47
|
+
def initialize(driver, api)
|
48
|
+
@driver = driver
|
49
|
+
@api = api
|
50
|
+
@module = AdwordsApi::V201101::ConversionTrackerService
|
51
|
+
@version = :v201101
|
52
|
+
@service = :ConversionTrackerService
|
53
|
+
end
|
54
|
+
|
55
|
+
# Returns the namespace for this service.
|
56
|
+
def namespace
|
57
|
+
return NAMESPACE
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
# Converts from underscore_separated names to camelCase names.
|
63
|
+
#
|
64
|
+
# Args:
|
65
|
+
# - text: the text to be converted
|
66
|
+
#
|
67
|
+
def camel_case(text)
|
68
|
+
text.gsub(/_\w/) {|match| match[1..-1].upcase}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Converts from camelCase names to underscore_separated names.
|
72
|
+
#
|
73
|
+
# Args:
|
74
|
+
# - text: the text to be converted
|
75
|
+
#
|
76
|
+
def underscore(text)
|
77
|
+
text.gsub(/[a-z0-9][A-Z]/) do |match|
|
78
|
+
match[0,1] + '_' + match[1,1].downcase
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Validates whether an object is of the correct type.
|
83
|
+
# This method is invoked by the hash to object converter during
|
84
|
+
# runtime to check the type validity of every object.
|
85
|
+
#
|
86
|
+
# Args:
|
87
|
+
# - object: the hash "object" being evaluated
|
88
|
+
# - type: the expected type (the class object itself)
|
89
|
+
#
|
90
|
+
# Returns:
|
91
|
+
# nil, upon success
|
92
|
+
#
|
93
|
+
# Raises:
|
94
|
+
# - ArgumentError: in case of an unexpected type
|
95
|
+
#
|
96
|
+
def validate_object(object, type)
|
97
|
+
return nil if object.is_a? type
|
98
|
+
|
99
|
+
wsdl_type_obj = type.new
|
100
|
+
|
101
|
+
if object.is_a? Hash
|
102
|
+
xsi_type = object[:xsi_type] or object['xsi_type']
|
103
|
+
if xsi_type
|
104
|
+
begin
|
105
|
+
subtype = @module.class_eval(xsi_type)
|
106
|
+
user_type_obj = subtype.new
|
107
|
+
rescue
|
108
|
+
raise ArgumentError, "Specified xsi_type '" + xsi_type +
|
109
|
+
"' is unknown"
|
110
|
+
end
|
111
|
+
unless user_type_obj.is_a? type
|
112
|
+
raise ArgumentError, "Specified xsi_type '" + xsi_type +
|
113
|
+
"' is not a subclass of " + type.to_s
|
114
|
+
end
|
115
|
+
else
|
116
|
+
object.each do |key, value|
|
117
|
+
if key.to_s != 'xsi_type'
|
118
|
+
if !wsdl_type_obj.respond_to?(camel_case(key.to_s).to_sym)
|
119
|
+
raise ArgumentError, "Unknown property '" + key.to_s +
|
120
|
+
"' for type " + type.to_s
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
return nil
|
127
|
+
end
|
128
|
+
|
129
|
+
# Sets a property on a real (soap4r-generated) object.
|
130
|
+
#
|
131
|
+
# Args:
|
132
|
+
# - object: the object being modified
|
133
|
+
# - property: the property being set
|
134
|
+
# - value: the value it's being set to
|
135
|
+
#
|
136
|
+
def set_object_property(object, property, value)
|
137
|
+
begin
|
138
|
+
object.send(property.to_s + '=', value)
|
139
|
+
rescue
|
140
|
+
object_class = object.class.name.split('::').last
|
141
|
+
error = AdsCommon::Errors::MissingPropertyError.new(
|
142
|
+
property, object_class)
|
143
|
+
message = "'Missing property `" + property.to_s +
|
144
|
+
"' for object class `" + object_class + "'"
|
145
|
+
raise(error, message)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
public
|
150
|
+
|
151
|
+
# Converts dynamic objects (property hashes) into real soap4r objects.
|
152
|
+
# This is meant to be called when setting properties on a class, so
|
153
|
+
# the method receives an optional parameter specifying the class and
|
154
|
+
# property. This way, it's possible to determine the default type for
|
155
|
+
# the object if none is provided.
|
156
|
+
#
|
157
|
+
# Args:
|
158
|
+
# - object: the object being converted
|
159
|
+
# - parent_class: the class whose property is being set
|
160
|
+
# - property: the property being set
|
161
|
+
#
|
162
|
+
def convert_to_object(object, parent_class = nil, property = nil)
|
163
|
+
property = camel_case(property.to_s) if property
|
164
|
+
if object.is_a? Hash
|
165
|
+
# Process a hash.
|
166
|
+
specified_class = object[:xsi_type] or object['xsi_type']
|
167
|
+
default_class = nil
|
168
|
+
# Determine default class for this object, given the property
|
169
|
+
# being set.
|
170
|
+
if parent_class and property
|
171
|
+
parent = REGISTRY.schema_definition_from_class(parent_class)
|
172
|
+
element = parent.elements.entries.find do |entry|
|
173
|
+
entry.varname.to_s == property.to_s
|
174
|
+
end
|
175
|
+
default_class = element.mapped_class if element
|
176
|
+
end
|
177
|
+
validate_object(object, default_class)
|
178
|
+
real_class = nil
|
179
|
+
if specified_class
|
180
|
+
real_class = @module.class_eval(specified_class)
|
181
|
+
else
|
182
|
+
real_class = default_class
|
183
|
+
end
|
184
|
+
# Instance real object.
|
185
|
+
real_object = real_class.new
|
186
|
+
# Set each of its properties.
|
187
|
+
object.each do |entry, value|
|
188
|
+
entry = entry.to_s
|
189
|
+
unless entry == 'xsi_type'
|
190
|
+
if @api.config.read('service.use_ruby_names')
|
191
|
+
entry = camel_case(entry)
|
192
|
+
end
|
193
|
+
if value.is_a? Hash
|
194
|
+
# Recurse.
|
195
|
+
set_object_property(real_object, entry,
|
196
|
+
convert_to_object(value, real_class, entry))
|
197
|
+
elsif value.is_a? Array
|
198
|
+
set_object_property(real_object, entry,
|
199
|
+
value.map do |item|
|
200
|
+
# Recurse.
|
201
|
+
convert_to_object(item, real_class, entry)
|
202
|
+
end
|
203
|
+
)
|
204
|
+
else
|
205
|
+
set_object_property(real_object, entry, value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
return real_object
|
210
|
+
elsif object.is_a? Array
|
211
|
+
# Process an array
|
212
|
+
return object.map do |entry|
|
213
|
+
# Recurse.
|
214
|
+
convert_to_object(entry, parent_class, property)
|
215
|
+
end
|
216
|
+
else
|
217
|
+
return object
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
# Converts real soap4r objects into dynamic ones (property hashes).
|
222
|
+
# This is meant to be called for return objects of remote calls.
|
223
|
+
#
|
224
|
+
# Args:
|
225
|
+
# - object: the object being converted
|
226
|
+
#
|
227
|
+
def convert_from_object(object)
|
228
|
+
if object.class.name =~
|
229
|
+
/AdwordsApi::V201101::\w+::\w+/
|
230
|
+
# Handle soap4r object
|
231
|
+
object_class = REGISTRY.schema_definition_from_class(object.class)
|
232
|
+
if object_class.elements and !object_class.elements.entries.empty?
|
233
|
+
# Process complex object.
|
234
|
+
hash = {}
|
235
|
+
hash[:xsi_type] = object.class.name.split('::').last
|
236
|
+
object_class.elements.entries.each do |entry|
|
237
|
+
property = entry.varname.to_s
|
238
|
+
if object.respond_to? property and !property.include?('_Type')
|
239
|
+
value = object.send(property)
|
240
|
+
property_name = nil
|
241
|
+
if @api.config.read('service.use_ruby_names')
|
242
|
+
property_name = underscore(property).to_sym
|
243
|
+
else
|
244
|
+
property_name = property.to_sym
|
245
|
+
end
|
246
|
+
# Recurse.
|
247
|
+
hash[property_name] = convert_from_object(value) if value
|
248
|
+
end
|
249
|
+
end
|
250
|
+
return hash
|
251
|
+
else
|
252
|
+
# Process simple object.
|
253
|
+
parent = object.class.superclass
|
254
|
+
return parent.new(object)
|
255
|
+
end
|
256
|
+
elsif object.is_a? Array
|
257
|
+
# Handle arrays
|
258
|
+
return object.map do |entry|
|
259
|
+
# Recurse.
|
260
|
+
convert_from_object(entry)
|
261
|
+
end
|
262
|
+
else
|
263
|
+
# Handle native objects
|
264
|
+
return object
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
|
269
|
+
public
|
270
|
+
|
271
|
+
# Calls the {get}[http://code.google.com/apis/adwords/docs/reference/v201101/ConversionTrackerService.html#get] method of the ConversionTrackerService service.
|
272
|
+
# Check {the online documentation for this method}[http://code.google.com/apis/adwords/docs/reference/v201101/ConversionTrackerService.html#get].
|
273
|
+
#
|
274
|
+
# Args:
|
275
|
+
# - serviceSelector: AdwordsApi::V201101::ConversionTrackerService::Selector
|
276
|
+
#
|
277
|
+
# Returns:
|
278
|
+
# - rval: AdwordsApi::V201101::ConversionTrackerService::ConversionTrackerPage
|
279
|
+
#
|
280
|
+
# Raises:
|
281
|
+
# Error::ApiError (or a subclass thereof) if a SOAP fault occurs.
|
282
|
+
#
|
283
|
+
def get(serviceSelector)
|
284
|
+
begin
|
285
|
+
arg_array = []
|
286
|
+
validate_object(serviceSelector, AdwordsApi::V201101::ConversionTrackerService::Selector)
|
287
|
+
arg_array << convert_to_object(serviceSelector, AdwordsApi::V201101::ConversionTrackerService::Get,
|
288
|
+
'serviceSelector')
|
289
|
+
# Construct request object and make API call
|
290
|
+
obj = AdwordsApi::V201101::ConversionTrackerService::Get.new(*arg_array)
|
291
|
+
reply = convert_from_object(@driver.get(obj))
|
292
|
+
reply = reply[:rval] if reply.include?(:rval)
|
293
|
+
return reply
|
294
|
+
rescue SOAP::FaultError => fault
|
295
|
+
raise AdwordsApi::Errors.create_api_exception(fault,
|
296
|
+
self)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
# Calls the {mutate}[http://code.google.com/apis/adwords/docs/reference/v201101/ConversionTrackerService.html#mutate] method of the ConversionTrackerService service.
|
301
|
+
# Check {the online documentation for this method}[http://code.google.com/apis/adwords/docs/reference/v201101/ConversionTrackerService.html#mutate].
|
302
|
+
#
|
303
|
+
# Args:
|
304
|
+
# - operations: SOAP::SOAPArray of AdwordsApi::V201101::ConversionTrackerService::ConversionTrackerOperation
|
305
|
+
#
|
306
|
+
# Returns:
|
307
|
+
# - rval: AdwordsApi::V201101::ConversionTrackerService::ConversionTrackerReturnValue
|
308
|
+
#
|
309
|
+
# Raises:
|
310
|
+
# Error::ApiError (or a subclass thereof) if a SOAP fault occurs.
|
311
|
+
#
|
312
|
+
def mutate(operations)
|
313
|
+
begin
|
314
|
+
arg_array = []
|
315
|
+
validate_object(operations, SOAP::SOAPArray)
|
316
|
+
arg_array << convert_to_object(operations, AdwordsApi::V201101::ConversionTrackerService::Mutate,
|
317
|
+
'operations')
|
318
|
+
# Construct request object and make API call
|
319
|
+
obj = AdwordsApi::V201101::ConversionTrackerService::Mutate.new(*arg_array)
|
320
|
+
reply = convert_from_object(@driver.mutate(obj))
|
321
|
+
reply = reply[:rval] if reply.include?(:rval)
|
322
|
+
return reply
|
323
|
+
rescue SOAP::FaultError => fault
|
324
|
+
raise AdwordsApi::Errors.create_api_exception(fault,
|
325
|
+
self)
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|
@@ -16,7 +16,7 @@ class CustomerSyncServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/ch/v201101", "getResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::CustomerSyncService::ApiException_"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/ch/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::CustomerSyncService::ApiException_"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/ch/v201101", :name=>"ApiException"}} }
|
20
20
|
]
|
21
21
|
]
|
22
22
|
|
@@ -16,7 +16,7 @@ class DataServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getAdGroupBidLandscapeResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::DataService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::DataService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
20
20
|
],
|
21
21
|
[ "",
|
22
22
|
"getCriterionBidLandscape",
|
@@ -24,7 +24,7 @@ class DataServiceInterface < ::SOAP::RPC::Driver
|
|
24
24
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getCriterionBidLandscapeResponse"]] ],
|
25
25
|
{ :request_style => :document, :request_use => :literal,
|
26
26
|
:response_style => :document, :response_use => :literal,
|
27
|
-
:faults => {"AdwordsApi::V201101::DataService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
27
|
+
:faults => {"AdwordsApi::V201101::DataService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
28
28
|
]
|
29
29
|
]
|
30
30
|
|
@@ -16,7 +16,7 @@ class ExperimentServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::ExperimentService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::ExperimentService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
20
20
|
],
|
21
21
|
[ "",
|
22
22
|
"mutate",
|
@@ -24,7 +24,7 @@ class ExperimentServiceInterface < ::SOAP::RPC::Driver
|
|
24
24
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "mutateResponse"]] ],
|
25
25
|
{ :request_style => :document, :request_use => :literal,
|
26
26
|
:response_style => :document, :response_use => :literal,
|
27
|
-
:faults => {"AdwordsApi::V201101::ExperimentService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
27
|
+
:faults => {"AdwordsApi::V201101::ExperimentService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
28
28
|
]
|
29
29
|
]
|
30
30
|
|
@@ -16,7 +16,7 @@ class GeoLocationServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::GeoLocationService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::GeoLocationService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
20
20
|
]
|
21
21
|
]
|
22
22
|
|
@@ -16,7 +16,7 @@ class InfoServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/info/v201101", "getResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::InfoService::ApiException_"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/info/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::InfoService::ApiException_"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/info/v201101", :name=>"ApiException"}} }
|
20
20
|
]
|
21
21
|
]
|
22
22
|
|
@@ -16,7 +16,7 @@ class MediaServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::MediaService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::MediaService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
20
20
|
],
|
21
21
|
[ "",
|
22
22
|
"upload",
|
@@ -24,7 +24,7 @@ class MediaServiceInterface < ::SOAP::RPC::Driver
|
|
24
24
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "uploadResponse"]] ],
|
25
25
|
{ :request_style => :document, :request_use => :literal,
|
26
26
|
:response_style => :document, :response_use => :literal,
|
27
|
-
:faults => {"AdwordsApi::V201101::MediaService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
27
|
+
:faults => {"AdwordsApi::V201101::MediaService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
28
28
|
]
|
29
29
|
]
|
30
30
|
|
@@ -16,7 +16,7 @@ class ReportDefinitionServiceInterface < ::SOAP::RPC::Driver
|
|
16
16
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getResponse"]] ],
|
17
17
|
{ :request_style => :document, :request_use => :literal,
|
18
18
|
:response_style => :document, :response_use => :literal,
|
19
|
-
:faults => {"AdwordsApi::V201101::ReportDefinitionService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
19
|
+
:faults => {"AdwordsApi::V201101::ReportDefinitionService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
20
20
|
],
|
21
21
|
[ "",
|
22
22
|
"getReportFields",
|
@@ -24,7 +24,7 @@ class ReportDefinitionServiceInterface < ::SOAP::RPC::Driver
|
|
24
24
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "getReportFieldsResponse"]] ],
|
25
25
|
{ :request_style => :document, :request_use => :literal,
|
26
26
|
:response_style => :document, :response_use => :literal,
|
27
|
-
:faults => {"AdwordsApi::V201101::ReportDefinitionService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
27
|
+
:faults => {"AdwordsApi::V201101::ReportDefinitionService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
28
28
|
],
|
29
29
|
[ "",
|
30
30
|
"mutate",
|
@@ -32,7 +32,7 @@ class ReportDefinitionServiceInterface < ::SOAP::RPC::Driver
|
|
32
32
|
["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/cm/v201101", "mutateResponse"]] ],
|
33
33
|
{ :request_style => :document, :request_use => :literal,
|
34
34
|
:response_style => :document, :response_use => :literal,
|
35
|
-
:faults => {"AdwordsApi::V201101::ReportDefinitionService::ApiException"=>{:encodingstyle=>"document", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :
|
35
|
+
:faults => {"AdwordsApi::V201101::ReportDefinitionService::ApiException"=>{:encodingstyle=>"document", :use=>"literal", :namespace=>nil, :ns=>"https://adwords.google.com/api/adwords/cm/v201101", :name=>"ApiException"}} }
|
36
36
|
]
|
37
37
|
]
|
38
38
|
|
@@ -358,6 +358,20 @@
|
|
358
358
|
end
|
359
359
|
end
|
360
360
|
|
361
|
+
# <i>Extension method</i> -- Calls the
|
362
|
+
# AdwordsApi::Extensions.download_report method with +self+ as the
|
363
|
+
# first parameter.
|
364
|
+
def download_report(report_definition_id)
|
365
|
+
return AdwordsApi::Extensions.download_report(self, report_definition_id)
|
366
|
+
end
|
367
|
+
|
368
|
+
# <i>Extension method</i> -- Calls the
|
369
|
+
# AdwordsApi::Extensions.download_report_as_file method with +self+ as the
|
370
|
+
# first parameter.
|
371
|
+
def download_report_as_file(report_definition_id, path)
|
372
|
+
return AdwordsApi::Extensions.download_report_as_file(self, report_definition_id, path)
|
373
|
+
end
|
374
|
+
|
361
375
|
end
|
362
376
|
end
|
363
377
|
end
|